X-Git-Url: https://git.mxchange.org/?p=shipsimu.git;a=blobdiff_plain;f=index.php;h=b133cc80204fd30628b2cbc3396061591387735d;hp=8dd613285f43e9be1f2d36727d2c0e47c6cbf897;hb=2e472bcbab0c23f070d39cfc66bef639706f0868;hpb=2b720aae73539d210c7bfd5c820b0646016456fd
diff --git a/index.php b/index.php
index 8dd6132..b133cc8 100644
--- a/index.php
+++ b/index.php
@@ -75,27 +75,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()
));
}
@@ -113,6 +108,7 @@ class ApplicationEntryPoint {
// Assign variables
$tplEngine->assignVariable('message', $message);
$tplEngine->assignVariable('backtrace', $backtrace);
+ $tplEngine->assignVariable('total_objects', ObjectFactory::getTotal());
// Load the template
$tplEngine->loadCodeTemplate('emergency_exit');