modifiers fixed

This commit is contained in:
Steffen Schröder 2014-06-20 15:00:09 +02:00
parent 6e08ee9ac7
commit 88b471f283
3 changed files with 5 additions and 8 deletions

View File

@ -22,7 +22,7 @@ class AutoLoader {
/** /**
* Register the Class Aliases needed to keep compatibility * Register the Class Aliases needed to keep compatibility
*/ */
private function registerClassAliases() { private static function registerClassAliases() {
class_alias('ManiaControl\\Utils\\Formatter', 'ManiaControl\\Formatter'); class_alias('ManiaControl\\Utils\\Formatter', 'ManiaControl\\Formatter');
class_alias('ManiaControl\\Utils\\ColorUtil', 'ManiaControl\\ColorUtil'); class_alias('ManiaControl\\Utils\\ColorUtil', 'ManiaControl\\ColorUtil');
} }

View File

@ -191,10 +191,10 @@ abstract class FileUtil {
/** /**
* Delete old ManiaControl Log Files * Delete old ManiaControl Log Files
* *
* @param int $maxFileAgeInDays * @param float $maxFileAgeInDays
* @return bool * @return bool
*/ */
public static function deleteOldLogFiles($maxFileAgeInDays = 14) { public static function deleteOldLogFiles($maxFileAgeInDays = 10.) {
$logsFolderPath = Logger::getLogsFolderPath(); $logsFolderPath = Logger::getLogsFolderPath();
if (!is_readable($logsFolderPath)) { if (!is_readable($logsFolderPath)) {
return false; return false;
@ -210,7 +210,7 @@ abstract class FileUtil {
continue; continue;
} }
$fileModTime = filemtime($filePath); $fileModTime = filemtime($filePath);
$timeDeltaDays = ($time - $fileModTime) / (24 * 3600); $timeDeltaDays = ($time - $fileModTime) / (24. * 3600.);
if ($timeDeltaDays > $maxFileAgeInDays) { if ($timeDeltaDays > $maxFileAgeInDays) {
unlink($filePath); unlink($filePath);
} }

View File

@ -2,8 +2,6 @@
namespace ManiaControl; namespace ManiaControl;
use ManiaControl\Files\FileUtil;
/** /**
* ManiaControl Logger Class * ManiaControl Logger Class
* *
@ -18,13 +16,12 @@ class Logger {
*/ */
public static function setup() { public static function setup() {
self::setupErrorLogFileName(); self::setupErrorLogFileName();
FileUtil::deleteOldLogFiles();
} }
/** /**
* Set the Error Log File Name * Set the Error Log File Name
*/ */
private function setupErrorLogFileName() { private static function setupErrorLogFileName() {
$logsFolder = self::createLogsFolder(); $logsFolder = self::createLogsFolder();
if ($logsFolder) { if ($logsFolder) {
$logFileName = $logsFolder . 'ManiaControl'; $logFileName = $logsFolder . 'ManiaControl';