X-Git-Url: https://git.mxchange.org/?p=shipsimu.git;a=blobdiff_plain;f=index.php;h=857b1561ba6e88ae5e09a3c20ef388835583df1a;hp=8dd613285f43e9be1f2d36727d2c0e47c6cbf897;hb=8ec67fe499cb16175eeb739d38e6172da3cf1a4a;hpb=b226bbefe6bc09bcd75432c3c3ba32bf7da45b71 diff --git a/index.php b/index.php index 8dd6132..857b156 100644 --- a/index.php +++ b/index.php @@ -1,4 +1,6 @@ + * @author Roland Haeder * @version 0.0.0 * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org + * @link http://www.ship-simu.org * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,8 +36,8 @@ class ApplicationEntryPoint { * @return void */ private static $instances = array ( - 'cfg', // The configuration system - 'loader', // The class loader system + 'cfg', // The configuration system + 'loader', // The class loader system 'debug', // Debug output 'db', // Database layer 'io', // Base I/O system (local file [or network]) @@ -67,7 +69,7 @@ class ApplicationEntryPoint { } // Get some instances - $tpl = FrameworkConfiguration::getInstance()->readConfig('tpl_engine'); + $tpl = FrameworkConfiguration::getInstance()->readConfig('template_class'); $lang = LanguageSystem::getInstance(); $io = FileIoHandler::getInstance(); @@ -75,27 +77,22 @@ class ApplicationEntryPoint { if ((class_exists($tpl)) && (is_object($lang)) && (is_object($io))) { // Use the template engine for putting out (nicer look) the message try { - $eval = sprintf("\$tplEngine = %s::create%s(\"%s%s\", \$lang, \$io);", - FrameworkConfiguration::getInstance()->readConfig('tpl_engine'), - FrameworkConfiguration::getInstance()->readConfig('tpl_engine'), - PATH, - FrameworkConfiguration::getInstance()->readConfig('tpl_base_path') - ); - eval($eval); + // Get the template instance from our object factory + $tplEngine = ObjectFactory::createObjectByConfiguredName('template_class', array(FrameworkConfiguration::getInstance()->readConfig('tpl_base_path'), $lang, $io)); } catch (BasePathIsEmptyException $e) { - die(sprintf("[Main:] Die Template-Engine konnte nicht initialisieren. Grund: %s", + die(sprintf("[Main:] Could not initialize template engine for this reason: %s", $e->getMessage() )); } catch (InvalidBasePathStringException $e) { - die(sprintf("[Main:] Die Template-Engine konnte nicht initialisieren. Grund: %s", + die(sprintf("[Main:] Could not initialize template engine for this reason: %s", $e->getMessage() )); } catch (BasePathIsNoDirectoryException $e) { - die(sprintf("[Main:] Die Template-Engine konnte nicht initialisieren. Grund: %s", + die(sprintf("[Main:] Could not initialize template engine for this reason: %s", $e->getMessage() )); } catch (BasePathReadProtectedException $e) { - die(sprintf("[Main:] Die Template-Engine konnte nicht initialisieren. Grund: %s", + die(sprintf("[Main:] Could not initialize template engine for this reason: %s", $e->getMessage() )); } @@ -113,6 +110,8 @@ class ApplicationEntryPoint { // Assign variables $tplEngine->assignVariable('message', $message); $tplEngine->assignVariable('backtrace', $backtrace); + $tplEngine->assignVariable('total_includes', ClassLoader::getInstance()->getTotal()); + $tplEngine->assignVariable('total_objects', ObjectFactory::getTotal()); // Load the template $tplEngine->loadCodeTemplate('emergency_exit');