X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=index.php;h=857b1561ba6e88ae5e09a3c20ef388835583df1a;hb=c1f597699e277f0a7d8635ff2064364e0fa1536c;hp=9cabcb0a844cabeadea6e465976870f6ee4bf10d;hpb=30d74f6c90bb37a58e10c8a789cd2b185f26a1fb;p=shipsimu.git diff --git a/index.php b/index.php index 9cabcb0..857b156 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 - * @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 @@ -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,35 +69,30 @@ class ApplicationEntryPoint { } // Get some instances - $tpl = FrameworkConfiguration::getInstance()->readConfig("tpl_engine"); + $tpl = FrameworkConfiguration::getInstance()->readConfig('template_class'); $lang = LanguageSystem::getInstance(); - $io = FileIOHandler::getInstance(); + $io = FileIoHandler::getInstance(); // Is the template engine loaded? 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() )); } @@ -110,11 +108,13 @@ class ApplicationEntryPoint { } // Assign variables - $tplEngine->assignVariable("message", $message); - $tplEngine->assignVariable("backtrace", $backtrace); + $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"); + $tplEngine->loadCodeTemplate('emergency_exit'); // Compile the template $tplEngine->compileTemplate(); @@ -148,16 +148,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()