modifiers fixed
This commit is contained in:
parent
6e08ee9ac7
commit
88b471f283
@ -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');
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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';
|
||||
|
Loading…
Reference in New Issue
Block a user