From 4e1983b06a95e5f72366e79d2352c91cc8e4a68e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Sat, 24 May 2014 21:09:55 +0200 Subject: [PATCH] try to prevent logging errors --- application/ManiaControl.php | 69 ++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/application/ManiaControl.php b/application/ManiaControl.php index da05a727..9a6c1de8 100644 --- a/application/ManiaControl.php +++ b/application/ManiaControl.php @@ -1,5 +1,8 @@ = MIN_PHP_VERSION) { @@ -81,34 +108,6 @@ if (extension_loaded('curl')) { exit(); } -/** - * Log and echo the given text - * - * @param string $message - * @param bool $eol - * @param bool $date - */ -function logMessage($message, $eol = true, $date = true) { - if ($date) { - $date = date('d.M y H:i:s'); - $message = $date . ' ' . $message; - } - - if ($eol) { - $message .= PHP_EOL; - } - - if (defined('LOG_CURRENT_FILE')) { - if (!is_writable(dirname(LOG_CURRENT_FILE)) || !file_put_contents(LOG_CURRENT_FILE, $message, FILE_APPEND)) { - echo 'Current-Logfile not write-able, please check the File Permissions!'; - } - } - if (!is_writable(dirname(LOG_FILE)) || !file_put_contents(LOG_FILE, $message, FILE_APPEND)) { - echo 'Logfile not write-able, please check the File Permissions!'; - } - echo $message; -} - // Autoload Function that loads ManiaControl Class Files on Demand spl_autoload_register(function ($className) { $classPath = str_replace('\\', DIRECTORY_SEPARATOR, $className);