Fixes Of Autoloader
This commit is contained in:
@@ -9,32 +9,6 @@ class LogRecordType{
|
||||
const INFO = 'info';
|
||||
}
|
||||
|
||||
class LogKeeper
|
||||
{
|
||||
function cleaningDir ($dir, $seconds) {
|
||||
$todayFileName = date ("Y-m-d").'.log';
|
||||
$logFiles = scandir ($dir);
|
||||
foreach ($logFiles as $key => $file) {
|
||||
if (in_array ($file,array (".", "..", ".gitkeep", $todayFileName)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (!is_dir($dir . $file)) {
|
||||
if (strtotime(str_replace(".log", "", $file)) < (strtotime("now") - $seconds)) {
|
||||
unlink ($dir . $file);
|
||||
}
|
||||
} else {
|
||||
$this->cleaningDir ($path . $file . "/", $seconds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function purge ($days) {
|
||||
$seconds = $days * 86400;
|
||||
$this->cleaningDir ('../logs/', $seconds);
|
||||
}
|
||||
}
|
||||
|
||||
class LogManager
|
||||
{
|
||||
|
||||
|
Reference in New Issue
Block a user