X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=index.php;h=48976ab9738d0d5034fd46860f766b190a987402;hb=1eb7aa239f8a539ebb458863e3bbd76e56160add;hp=1956b02c17d14b1c0e9e27af45ab606cd0a60b73;hpb=7625f0ed496dbf1bb3efbb3bd327dbd0fd747af4;p=shipsimu.git diff --git a/index.php b/index.php index 1956b02..48976ab 100644 --- a/index.php +++ b/index.php @@ -1,4 +1,7 @@ + * @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 @@ -33,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]) @@ -66,7 +69,7 @@ class ApplicationEntryPoint { } // Get some instances - $tpl = FrameworkConfiguration::getInstance()->readConfig("tpl_engine"); + $tpl = FrameworkConfiguration::getInstance()->readConfig('tpl_engine'); $lang = LanguageSystem::getInstance(); $io = FileIoHandler::getInstance(); @@ -74,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('tpl_engine', 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() )); } @@ -110,11 +108,12 @@ class ApplicationEntryPoint { } // Assign variables - $tplEngine->assignVariable("message", $message); - $tplEngine->assignVariable("backtrace", $backtrace); + $tplEngine->assignVariable('message', $message); + $tplEngine->assignVariable('backtrace', $backtrace); + $tplEngine->assignVariable('total_objects', ObjectFactory::getTotal()); // Load the template - $tplEngine->loadCodeTemplate("emergency_exit"); + $tplEngine->loadCodeTemplate('emergency_exit'); // Compile the template $tplEngine->compileTemplate(); @@ -148,16 +147,16 @@ class ApplicationEntryPoint { global $_SERVER; // Load config file - require(dirname(__FILE__) . "/inc/config.php"); + require(dirname(__FILE__) . '/inc/config.php'); // Load all include files - require(PATH . "inc/includes.php"); + require(PATH . 'inc/includes.php'); // Load all framework classes - require(PATH . "inc/classes.php"); + require(PATH . 'inc/classes.php'); // Include the application selector - require(PATH . "inc/selector.php"); + require(PATH . 'inc/selector.php'); } // END - main()