From ea223a6d260eeb2f2df036abcbc331e3f3fe9ca7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Tue, 17 Jun 2014 22:59:49 +0200 Subject: [PATCH] replaced deprecated logMessage function --- application/core/ErrorHandler.php | 8 ++++---- application/core/Files/FileUtil.php | 9 +++++---- application/core/ManiaControl.php | 2 +- application/core/Utils/SystemUtil.php | 20 +++++++++++--------- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/application/core/ErrorHandler.php b/application/core/ErrorHandler.php index 5288f18f..79a6e726 100644 --- a/application/core/ErrorHandler.php +++ b/application/core/ErrorHandler.php @@ -144,9 +144,9 @@ class ErrorHandler { $response = FileUtil::loadFile($url); $success = json_decode($response); if ($success) { - logMessage('Error-Report successful!'); + Logger::log('Error-Report successful!'); } else { - logMessage('Error-Report failed! ' . print_r($response, true)); + Logger::log('Error-Report failed! ' . print_r($response, true)); } } @@ -399,9 +399,9 @@ class ErrorHandler { $response = FileUtil::loadFile($url); $success = json_decode($response); if ($success) { - logMessage('Exception successfully reported!'); + Logger::log('Exception successfully reported!'); } else { - logMessage('Exception-Report failed! ' . print_r($response, true)); + Logger::log('Exception-Report failed! ' . print_r($response, true)); } } diff --git a/application/core/Files/FileUtil.php b/application/core/Files/FileUtil.php index c4e27d47..9e0997c5 100644 --- a/application/core/Files/FileUtil.php +++ b/application/core/Files/FileUtil.php @@ -2,6 +2,7 @@ namespace ManiaControl\Files; +use ManiaControl\Logger; use ManiaControl\ManiaControl; use ManiaControl\Utils\Formatter; @@ -76,16 +77,16 @@ abstract class FileUtil { public static function loadConfig($fileName) { $fileLocation = ManiaControlDir . 'configs' . DIRECTORY_SEPARATOR . $fileName; if (!file_exists($fileLocation)) { - logMessage("Config File doesn't exist! ({$fileName})"); + Logger::log("Config File doesn't exist! ({$fileName})"); return null; } if (!is_readable($fileLocation)) { - logMessage("Config File isn't readable! Please check the File Permissions. ({$fileName})"); + Logger::log("Config File isn't readable! Please check the File Permissions. ({$fileName})"); return null; } $configXml = @simplexml_load_file($fileLocation); if (!$configXml) { - logMessage("Config file isn't maintained properly! ({$fileName})"); + Logger::log("Config file isn't maintained properly! ({$fileName})"); return null; } return $configXml; @@ -147,7 +148,7 @@ abstract class FileUtil { } if (!is_writable($fileName)) { $message = "Write-Access missing for File '{$fileName}'!"; - logMessage($message); + Logger::log($message); return false; } } diff --git a/application/core/ManiaControl.php b/application/core/ManiaControl.php index d7823275..de7a7a8e 100644 --- a/application/core/ManiaControl.php +++ b/application/core/ManiaControl.php @@ -146,7 +146,7 @@ class ManiaControl implements CommandListener, TimerListener { if ($stripCodes) { $message = Formatter::stripCodes($message); } - logMessage($message); + Logger::log($message); } /** diff --git a/application/core/Utils/SystemUtil.php b/application/core/Utils/SystemUtil.php index 17864579..ec1d5a1b 100644 --- a/application/core/Utils/SystemUtil.php +++ b/application/core/Utils/SystemUtil.php @@ -2,6 +2,8 @@ namespace ManiaControl\Utils; +use ManiaControl\Logger; + /** * System Utility Class * @@ -76,31 +78,31 @@ class SystemUtil { $phpVersion = phpversion(); $message = 'Checking for minimum required PHP-Version ' . MIN_PHP_VERSION . ' ... '; if ($phpVersion < MIN_PHP_VERSION) { - logMessage($message . $phpVersion . ' TOO OLD VERSION!'); - logMessage(' -- Make sure that you install at least PHP ' . MIN_PHP_VERSION . '!'); + Logger::log($message . $phpVersion . ' TOO OLD VERSION!'); + Logger::log(' -- Make sure that you install at least PHP ' . MIN_PHP_VERSION . '!'); $success = false; } else { - logMessage($message . MIN_PHP_VERSION . ' OK!'); + Logger::log($message . MIN_PHP_VERSION . ' OK!'); } // Check for MySQLi $message = 'Checking for installed MySQLi ... '; if (!extension_loaded('mysqli')) { - logMessage($message . 'NOT FOUND!'); - logMessage(" -- You don't have MySQLi installed! Check: http://www.php.net/manual/en/mysqli.installation.php"); + Logger::log($message . 'NOT FOUND!'); + Logger::log(" -- You don't have MySQLi installed! Check: http://www.php.net/manual/en/mysqli.installation.php"); $success = false; } else { - logMessage($message . 'FOUND!'); + Logger::log($message . 'FOUND!'); } // Check for cURL $message = 'Checking for installed cURL ... '; if (!extension_loaded('curl')) { - logMessage($message . 'NOT FOUND!'); - logMessage(" -- You don't have cURL installed! Check: http://www.php.net/manual/en/curl.installation.php"); + Logger::log($message . 'NOT FOUND!'); + Logger::log(" -- You don't have cURL installed! Check: http://www.php.net/manual/en/curl.installation.php"); $success = false; } else { - logMessage($message . 'FOUND!'); + Logger::log($message . 'FOUND!'); } if (!$success) {