Skip to content

Commit

Permalink
Update log.class.php
Browse files Browse the repository at this point in the history
  • Loading branch information
zoic21 authored Dec 12, 2024
1 parent 043e545 commit 94aa378
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/class/log.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public static function chunkLog($_path) {
$maxLineLog = self::DEFAULT_MAX_LINE;
}
try {
com_shell::execute(system::getCmdSudo() . 'chmod 664 ' . $_path . ' > /dev/null 2>&1;'. system::getCmdSudo() . 'chown -R ' . system::get('www-uid') . ':' . system::get('www-gid') . ' ' . $path.' > /dev/null 2>&1;'system::getCmdSudo() . ' echo "$(tail -n ' . $maxLineLog . ' ' . $_path . ')" > ' . $_path);
com_shell::execute(system::getCmdSudo() . 'chmod 664 ' . $_path . ' > /dev/null 2>&1;'. system::getCmdSudo() . 'chown -R ' . system::get('www-uid') . ':' . system::get('www-gid') . ' ' . $path.' > /dev/null 2>&1;'.system::getCmdSudo() . ' echo "$(tail -n ' . $maxLineLog . ' ' . $_path . ')" > ' . $_path);
} catch (\Exception $e) {
}
@chown($_path, system::get('www-uid'));
Expand Down Expand Up @@ -196,7 +196,7 @@ public static function authorizeClearLog($_log, $_subPath = '') {
public static function clear($_log) {
if (self::authorizeClearLog($_log)) {
$path = self::getPathToLog($_log);
com_shell::execute(system::getCmdSudo() . 'chmod 664 ' . $path . '> /dev/null 2>&1;'. system::getCmdSudo() . 'chown -R ' . system::get('www-uid') . ':' . system::get('www-gid') . ' ' . $path.' > /dev/null 2>&1;'system::getCmdSudo() . ' cat /dev/null > ' . $path);
com_shell::execute(system::getCmdSudo() . 'chmod 664 ' . $path . '> /dev/null 2>&1;'. system::getCmdSudo() . 'chown -R ' . system::get('www-uid') . ':' . system::get('www-gid') . ' ' . $path.' > /dev/null 2>&1;'.system::getCmdSudo() . ' cat /dev/null > ' . $path);
return true;
}
return;
Expand All @@ -222,7 +222,7 @@ public static function remove($_log) {
}
if (self::authorizeClearLog($_log)) {
$path = self::getPathToLog($_log);
com_shell::execute(system::getCmdSudo() . 'chmod 664 ' . $path . ' > /dev/null 2>&1;'. system::getCmdSudo() . 'chown -R ' . system::get('www-uid') . ':' . system::get('www-gid') . ' ' . $path.' > /dev/null 2>&1;'system::getCmdSudo() . ' cat /dev/null > ' . $path.';rm ' . $path . ' 2>&1 > /dev/null');
com_shell::execute(system::getCmdSudo() . 'chmod 664 ' . $path . ' > /dev/null 2>&1;'. system::getCmdSudo() . 'chown -R ' . system::get('www-uid') . ':' . system::get('www-gid') . ' ' . $path.' > /dev/null 2>&1;'.system::getCmdSudo() . ' cat /dev/null > ' . $path.';rm ' . $path . ' 2>&1 > /dev/null');



Expand Down

0 comments on commit 94aa378

Please sign in to comment.