Removed obsolete parameter 'applicationInstance' from all template engines
[mailer.git] / index.php
index 4cef375d4e157428a51840175e9bfe3114948aff..2c960e2063ac434d42b882f74d9893082958b1fe 100644 (file)
--- a/index.php
+++ b/index.php
@@ -98,7 +98,7 @@ final class ApplicationEntryPoint {
                        // Use the template engine for putting out (nicer look) the message
                        try {
                                // Get the template instance from our object factory
-                               $templateInstance = ObjectFactory::createObjectByName($tpl, array(ApplicationHelper::getInstance()));
+                               $templateInstance = ObjectFactory::createObjectByName($tpl);
                        } catch (FrameworkException $e) {
                                die(sprintf("[Main:] Could not initialize template engine for reason: <span class=\"exception_reason\">%s</span>",
                                        $e->getMessage()
@@ -132,29 +132,35 @@ final class ApplicationEntryPoint {
                                $templateInstance->assignApplicationData($appInstance);
                        } // END - if
 
-                       // Assign variables
-                       $templateInstance->assignVariable('message', $message);
-                       $templateInstance->assignVariable('code', $code);
-                       $templateInstance->assignVariable('extra', $extraData);
-                       $templateInstance->assignVariable('backtrace', $backtrace);
-                       $templateInstance->assignVariable('total_includes', ClassLoader::getInstance()->getTotal());
-                       $templateInstance->assignVariable('total_objects', ObjectFactory::getTotal());
-                       $templateInstance->assignVariable('title', $languageInstance->getMessage('emergency_exit_title'));
-
-                       // Load the template
-                       $templateInstance->loadCodeTemplate('emergency_exit');
-
-                       // Compile the template
-                       $templateInstance->compileTemplate();
-
-                       // Compile all variables
-                       $templateInstance->compileVariables();
-
-                       // Transfer data to response
-                       $templateInstance->transferToResponse($responseInstance);
-
-                       // Flush the response
-                       $responseInstance->flushBuffer();
+                       // We only try this
+                       try {
+                               // Assign variables
+                               $templateInstance->assignVariable('message', $message);
+                               $templateInstance->assignVariable('code', $code);
+                               $templateInstance->assignVariable('extra', $extraData);
+                               $templateInstance->assignVariable('backtrace', $backtrace);
+                               $templateInstance->assignVariable('total_includes', ClassLoader::getInstance()->getTotal());
+                               $templateInstance->assignVariable('total_objects', ObjectFactory::getTotal());
+                               $templateInstance->assignVariable('title', $languageInstance->getMessage('emergency_exit_title'));
+
+                               // Load the template
+                               $templateInstance->loadCodeTemplate('emergency_exit');
+
+                               // Compile the template
+                               $templateInstance->compileTemplate();
+
+                               // Compile all variables
+                               $templateInstance->compileVariables();
+
+                               // Transfer data to response
+                               $templateInstance->transferToResponse($responseInstance);
+
+                               // Flush the response
+                               $responseInstance->flushBuffer();
+                       } catch (FileIoException $e) {
+                               // Even the template 'emergency_exit' wasn't found so output both message
+                               die($message . ', exception: ' . $e->getMessage());
+                       }
 
                        // Good bye...
                        exit();
@@ -170,7 +176,7 @@ final class ApplicationEntryPoint {
         * Determines the correct absolute path for all includes only once per run.
         * Other calls of this method are being "cached".
         *
-        * @return      $basePath       Base path (core) for all includes
+        * @return      $corePath       Base path (core) for all includes
         */
        protected static function detectCorePath () {
                // Is it not set?