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
*/
private function registerClassAliases() {
private static function registerClassAliases() {
class_alias('ManiaControl\\Utils\\Formatter', 'ManiaControl\\Formatter');
class_alias('ManiaControl\\Utils\\ColorUtil', 'ManiaControl\\ColorUtil');
}

View File

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

View File

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