replaced deprecated logMessage function
This commit is contained in:
parent
296fb77028
commit
ea223a6d26
@ -144,9 +144,9 @@ class ErrorHandler {
|
|||||||
$response = FileUtil::loadFile($url);
|
$response = FileUtil::loadFile($url);
|
||||||
$success = json_decode($response);
|
$success = json_decode($response);
|
||||||
if ($success) {
|
if ($success) {
|
||||||
logMessage('Error-Report successful!');
|
Logger::log('Error-Report successful!');
|
||||||
} else {
|
} 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);
|
$response = FileUtil::loadFile($url);
|
||||||
$success = json_decode($response);
|
$success = json_decode($response);
|
||||||
if ($success) {
|
if ($success) {
|
||||||
logMessage('Exception successfully reported!');
|
Logger::log('Exception successfully reported!');
|
||||||
} else {
|
} else {
|
||||||
logMessage('Exception-Report failed! ' . print_r($response, true));
|
Logger::log('Exception-Report failed! ' . print_r($response, true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace ManiaControl\Files;
|
namespace ManiaControl\Files;
|
||||||
|
|
||||||
|
use ManiaControl\Logger;
|
||||||
use ManiaControl\ManiaControl;
|
use ManiaControl\ManiaControl;
|
||||||
use ManiaControl\Utils\Formatter;
|
use ManiaControl\Utils\Formatter;
|
||||||
|
|
||||||
@ -76,16 +77,16 @@ abstract class FileUtil {
|
|||||||
public static function loadConfig($fileName) {
|
public static function loadConfig($fileName) {
|
||||||
$fileLocation = ManiaControlDir . 'configs' . DIRECTORY_SEPARATOR . $fileName;
|
$fileLocation = ManiaControlDir . 'configs' . DIRECTORY_SEPARATOR . $fileName;
|
||||||
if (!file_exists($fileLocation)) {
|
if (!file_exists($fileLocation)) {
|
||||||
logMessage("Config File doesn't exist! ({$fileName})");
|
Logger::log("Config File doesn't exist! ({$fileName})");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (!is_readable($fileLocation)) {
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
$configXml = @simplexml_load_file($fileLocation);
|
$configXml = @simplexml_load_file($fileLocation);
|
||||||
if (!$configXml) {
|
if (!$configXml) {
|
||||||
logMessage("Config file isn't maintained properly! ({$fileName})");
|
Logger::log("Config file isn't maintained properly! ({$fileName})");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return $configXml;
|
return $configXml;
|
||||||
@ -147,7 +148,7 @@ abstract class FileUtil {
|
|||||||
}
|
}
|
||||||
if (!is_writable($fileName)) {
|
if (!is_writable($fileName)) {
|
||||||
$message = "Write-Access missing for File '{$fileName}'!";
|
$message = "Write-Access missing for File '{$fileName}'!";
|
||||||
logMessage($message);
|
Logger::log($message);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,7 +146,7 @@ class ManiaControl implements CommandListener, TimerListener {
|
|||||||
if ($stripCodes) {
|
if ($stripCodes) {
|
||||||
$message = Formatter::stripCodes($message);
|
$message = Formatter::stripCodes($message);
|
||||||
}
|
}
|
||||||
logMessage($message);
|
Logger::log($message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace ManiaControl\Utils;
|
namespace ManiaControl\Utils;
|
||||||
|
|
||||||
|
use ManiaControl\Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* System Utility Class
|
* System Utility Class
|
||||||
*
|
*
|
||||||
@ -76,31 +78,31 @@ class SystemUtil {
|
|||||||
$phpVersion = phpversion();
|
$phpVersion = phpversion();
|
||||||
$message = 'Checking for minimum required PHP-Version ' . MIN_PHP_VERSION . ' ... ';
|
$message = 'Checking for minimum required PHP-Version ' . MIN_PHP_VERSION . ' ... ';
|
||||||
if ($phpVersion < MIN_PHP_VERSION) {
|
if ($phpVersion < MIN_PHP_VERSION) {
|
||||||
logMessage($message . $phpVersion . ' TOO OLD VERSION!');
|
Logger::log($message . $phpVersion . ' TOO OLD VERSION!');
|
||||||
logMessage(' -- Make sure that you install at least PHP ' . MIN_PHP_VERSION . '!');
|
Logger::log(' -- Make sure that you install at least PHP ' . MIN_PHP_VERSION . '!');
|
||||||
$success = false;
|
$success = false;
|
||||||
} else {
|
} else {
|
||||||
logMessage($message . MIN_PHP_VERSION . ' OK!');
|
Logger::log($message . MIN_PHP_VERSION . ' OK!');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for MySQLi
|
// Check for MySQLi
|
||||||
$message = 'Checking for installed MySQLi ... ';
|
$message = 'Checking for installed MySQLi ... ';
|
||||||
if (!extension_loaded('mysqli')) {
|
if (!extension_loaded('mysqli')) {
|
||||||
logMessage($message . 'NOT FOUND!');
|
Logger::log($message . 'NOT FOUND!');
|
||||||
logMessage(" -- You don't have MySQLi installed! Check: http://www.php.net/manual/en/mysqli.installation.php");
|
Logger::log(" -- You don't have MySQLi installed! Check: http://www.php.net/manual/en/mysqli.installation.php");
|
||||||
$success = false;
|
$success = false;
|
||||||
} else {
|
} else {
|
||||||
logMessage($message . 'FOUND!');
|
Logger::log($message . 'FOUND!');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for cURL
|
// Check for cURL
|
||||||
$message = 'Checking for installed cURL ... ';
|
$message = 'Checking for installed cURL ... ';
|
||||||
if (!extension_loaded('curl')) {
|
if (!extension_loaded('curl')) {
|
||||||
logMessage($message . 'NOT FOUND!');
|
Logger::log($message . 'NOT FOUND!');
|
||||||
logMessage(" -- You don't have cURL installed! Check: http://www.php.net/manual/en/curl.installation.php");
|
Logger::log(" -- You don't have cURL installed! Check: http://www.php.net/manual/en/curl.installation.php");
|
||||||
$success = false;
|
$success = false;
|
||||||
} else {
|
} else {
|
||||||
logMessage($message . 'FOUND!');
|
Logger::log($message . 'FOUND!');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$success) {
|
if (!$success) {
|
||||||
|
Loading…
Reference in New Issue
Block a user