From 96a90b0b0ca909283655570a40a9c7fc5404be1e Mon Sep 17 00:00:00 2001 From: kremsy Date: Mon, 27 Jan 2014 20:16:20 +0100 Subject: [PATCH] improved error handler, added exception handler --- application/ManiaControl.php | 87 +++++++++++++++++++++++------------- 1 file changed, 57 insertions(+), 30 deletions(-) diff --git a/application/ManiaControl.php b/application/ManiaControl.php index 71406a10..5f1e5688 100644 --- a/application/ManiaControl.php +++ b/application/ManiaControl.php @@ -1,10 +1,11 @@ getMessage()} Trace: {$ex->getTraceAsString()}!"; + logMessage($message); +} // Autoload Function that loads ManiaControl Class Files on Demand -spl_autoload_register( - function ($className) { - $classPath = str_replace('\\', DIRECTORY_SEPARATOR, $className); - $classPath = preg_replace('/ManiaControl/', 'core', $classPath, 1); - $filePath = ManiaControlDir . DIRECTORY_SEPARATOR . $classPath . '.php'; - if (file_exists($filePath)) { - require_once $filePath; - } - }); +spl_autoload_register(function ($className) { + $classPath = str_replace('\\', DIRECTORY_SEPARATOR, $className); + $classPath = preg_replace('/ManiaControl/', 'core', $classPath, 1); + $filePath = ManiaControlDir . DIRECTORY_SEPARATOR . $classPath . '.php'; + if (file_exists($filePath)) { + require_once $filePath; + } +}); // Start ManiaControl $maniaControl = new \ManiaControl\ManiaControl();