More style convensions applied, interface updated
authorRoland Häder <roland@mxchange.org>
Wed, 28 May 2008 19:06:00 +0000 (19:06 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 28 May 2008 19:06:00 +0000 (19:06 +0000)
41 files changed:
application/selector/class_ApplicationHelper.php
application/selector/class_ApplicationSelector.php
application/selector/init.php
application/selector/loader.php
application/selector/starter.php
application/ship-simu/class_ApplicationHelper.php
application/ship-simu/init.php
application/ship-simu/loader.php
application/ship-simu/main/class_Merchant.php
application/ship-simu/main/class_WorksContract.php
application/ship-simu/main/companies/class_ShippingCompany.php
application/ship-simu/main/constructions/berths/class_Berth.php
application/ship-simu/main/constructions/docks/class_DryDock.php
application/ship-simu/main/constructions/harbors/class_Harbor.php
application/ship-simu/main/constructions/terminals/class_Terminal.php
application/ship-simu/main/constructions/yards/class_Shipyard.php
application/ship-simu/main/drives/motor/class_Motor.php
application/ship-simu/main/parts/maschineroom/class_MaschineRoom.php
application/ship-simu/main/ships/passenger/class_PassengerShip.php
application/ship-simu/main/structures/extended/cabines/class_BaseCabin.php
application/ship-simu/main/structures/extended/decks/class_BaseDeck.php
application/ship-simu/main/structures/extended/upper/class_Bridge.php
application/ship-simu/starter.php
inc/classes/exceptions/template/class_InvalidTemplateVariableNameException.php
inc/classes/interfaces/application/class_ManageableApplication.php
inc/classes/main/class_BaseFrameworkSystem.php
inc/classes/main/commands/web/class_WebHomeCommand.php
inc/classes/main/commands/web/class_WebRegisterCommand.php
inc/classes/main/controller/form/class_WebDoFormController.php
inc/classes/main/factories/web/class_NewsFactory.php
inc/classes/main/helper/web/class_WebFormHelper.php
inc/classes/main/language/class_LanguageSystem.php
inc/classes/main/output/class_ConsoleOutput.php
inc/classes/main/request/class_HttpRequest.php
inc/classes/main/resolver/web/class_WebCommandResolver.php
inc/classes/main/resolver/web/class_WebControllerResolver.php
inc/classes/main/response/class_HttpResponse.php
inc/classes/main/template/class_TemplateEngine.php
inc/classes/middleware/compressor/class_CompressorChannel.php
inc/loader/class_ClassLoader.php
inc/selector.php

index feafd24..3452f96 100644 (file)
@@ -193,6 +193,17 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
                // Insert all application templates
                $selInstance->insertApplicationTemplates();
        }
+
+       /**
+        * Handle the indexed array of fatal messages and puts them out in an
+        * acceptable fasion
+        *
+        * @param       $messageList    An array of fatal messages
+        * @return      void
+        */
+       public function handleFatalMessages (array $messageList) {
+               die("<pre>".print_r($messageList, true)."</pre>");
+       }
 }
 
 // [EOF]
index 2af2f70..03e03ef 100644 (file)
@@ -141,9 +141,9 @@ class ApplicationSelector extends BaseFrameworkSystem {
                        } elseif (!is_object($app)) {
                                // Not an object
                                throw new NoObjectException($app, self::EXCEPTION_IS_NO_OBJECT);
-                       } elseif (!method_exists($app, $this->getConfigInstance()->readConfig("entry_method"))) {
+                       } elseif (!method_exists($app, $this->getConfigInstance()->readConfig('entry_method'))) {
                                // Method not found!
-                               throw new MissingMethodException(array($app, $this->getConfigInstance()->readConfig("entry_method")), self::EXCEPTION_MISSING_METHOD);
+                               throw new MissingMethodException(array($app, $this->getConfigInstance()->readConfig('entry_method')), self::EXCEPTION_MISSING_METHOD);
                        }
 
                        // Add the current instance to the list
@@ -186,7 +186,7 @@ class ApplicationSelector extends BaseFrameworkSystem {
         * @return      $shortName      This selector's short name
         */
        public function getAppShortName() {
-               $shortName = $this->getConfigInstance()->readConfig("selector_path");
+               $shortName = $this->getConfigInstance()->readConfig('selector_path');
                return $shortName;
        }
 
@@ -212,11 +212,11 @@ class ApplicationSelector extends BaseFrameworkSystem {
                // Generate the base path for all applications
                $appBasePath = sprintf("%s%s/",
                        PATH,
-                       $this->getConfigInstance()->readConfig("application_path")
+                       $this->getConfigInstance()->readConfig('application_path')
                );
 
                // Add the selector path to the ignore list
-               $this->addDirIgnoreList($this->getConfigInstance()->readConfig("selector_path"));
+               $this->addDirIgnoreList($this->getConfigInstance()->readConfig('selector_path'));
 
                // Get a directory pointer for the application path
                $dirInstance = FrameworkDirectoryPointer::createFrameworkDirectoryPointer($appBasePath);
@@ -233,7 +233,7 @@ class ApplicationSelector extends BaseFrameworkSystem {
                        // Is this a readable directory? (files will be ignored silently)
                        if ((is_dir($fqfn)) && (is_readable($fqfn))) {
                                // Then get the init.php script for analyzing
-                               $initScript = sprintf("%s/init%s", $fqfn, $this->getConfigInstance()->readConfig("php_extension"));
+                               $initScript = sprintf("%s/init%s", $fqfn, $this->getConfigInstance()->readConfig('php_extension'));
 
                                // Load the application's init.php script and append the
                                // application to the ArrayObject
@@ -266,7 +266,7 @@ class ApplicationSelector extends BaseFrameworkSystem {
 
                        // Try to load the web template
                        $tplEngine->loadWebTemplate(sprintf("%s_%s",
-                               $this->getConfigInstance()->readConfig("tpl_selector_prefix"),
+                               $this->getConfigInstance()->readConfig('tpl_selector_prefix'),
                                strtolower($appInstance->getAppShortName())
                        ));
 
@@ -301,7 +301,7 @@ class ApplicationSelector extends BaseFrameworkSystem {
                $tplEngine = $this->prepareTemplateEngine($this);
 
                // Load the selector's template
-               $tplEngine->loadCodeTemplate($this->getConfigInstance()->readConfig("selector_main_tpl"));
+               $tplEngine->loadCodeTemplate($this->getConfigInstance()->readConfig('selector_main_tpl'));
 
                // Now store it in the class
                $this->setSelectorTemplateEngine($tplEngine);
@@ -323,7 +323,7 @@ class ApplicationSelector extends BaseFrameworkSystem {
                $tplEngine = $this->prepareTemplateEngine($this);
 
                // Load template which shall later hold all application templates
-               $tplEngine->loadCodeTemplate($this->getConfigInstance()->readConfig("selector_apps_tpl"));
+               $tplEngine->loadCodeTemplate($this->getConfigInstance()->readConfig('selector_apps_tpl'));
 
                // Add all loaded application templates together
                $dummy = "";
@@ -349,16 +349,6 @@ class ApplicationSelector extends BaseFrameworkSystem {
 
                } // END - for
        }
-
-       /**
-        * Stub!
-        */
-       public function saveObjectToDatabase () {
-               $this->getDebugInstance()->output(sprintf("[%s:] Stub <strong>%s</strong> erreicht.",
-                       $this->__toString(),
-                       __FUNCTION__
-               ));
-       }
 }
 
 // [EOF]
index cf84d68..6a02f97 100644 (file)
 //
 // Get an instance of the initializer
 $eval = sprintf("\$app = %s::getInstance();",
-       FrameworkConfiguration::getInstance()->readConfig("app_helper_class")
+       FrameworkConfiguration::getInstance()->readConfig('app_helper_class')
 );
 eval($eval);
 
 // Set application name and version
 $app->setAppName("Applikationsausw&auml;hler");
 $app->setAppVersion("0.1a");
-$app->setAppShortName(FrameworkConfiguration::getInstance()->readConfig("selector_name"));
+$app->setAppShortName(FrameworkConfiguration::getInstance()->readConfig('selector_name'));
 
 // Initialize output system
 require(PATH . 'inc/output.php');
index 71c44c6..aafbd38 100644 (file)
@@ -28,7 +28,7 @@ if (!isset($application)) {
 }
 
 // Load all classes
-ClassLoader::getInstance()->loadClasses(sprintf("%s/%s/", FrameworkConfiguration::getInstance()->readConfig("application_path"), $application));
+ClassLoader::getInstance()->loadClasses(sprintf("%s/%s/", FrameworkConfiguration::getInstance()->readConfig('application_path'), $application));
 
 // Include all classes
 ClassLoader::getInstance()->includeAllClasses();
index a4b17b3..ca9d294 100644 (file)
@@ -30,26 +30,26 @@ if ((empty($app)) || (is_null($app))) {
        // Something went wrong!
        ApplicationEntryPoint::app_die(sprintf("[Main:] The application <strong>%s</strong> could not be launched because the helper class <strong>%s</strong> is not loaded.",
                $application,
-               FrameworkConfiguration::getInstance()->readConfig("app_helper_class")
+               FrameworkConfiguration::getInstance()->readConfig('app_helper_class')
        ));
 } elseif (!is_object($app)) {
        // No object!
        ApplicationEntryPoint::app_die(sprintf("[Main:] The application <strong>%s</strong> could not be launched because &#39;app&#39; is not an object.",
                $application
        ));
-} elseif (!method_exists($app, FrameworkConfiguration::getInstance()->readConfig("entry_method"))) {
+} elseif (!method_exists($app, FrameworkConfiguration::getInstance()->readConfig('entry_method'))) {
        // Method not found!
        ApplicationEntryPoint::app_die(sprintf("[Main:] The application <strong>%s</strong> could not be launched because the method <strong>%s</strong> is missing.",
                $application,
-               FrameworkConfiguration::getInstance()->readConfig("entry_method")
+               FrameworkConfiguration::getInstance()->readConfig('entry_method')
        ));
 }
 
 // Call the entry point method
 try {
        $eval = sprintf("%s::getInstance()->%s();",
-               FrameworkConfiguration::getInstance()->readConfig("app_helper_class"),
-               FrameworkConfiguration::getInstance()->readConfig("entry_method")
+               FrameworkConfiguration::getInstance()->readConfig('app_helper_class'),
+               FrameworkConfiguration::getInstance()->readConfig('entry_method')
        );
        eval($eval);
 } catch (FrameworkException  $e) {
index 0e26385..407b588 100644 (file)
@@ -61,10 +61,14 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
        private $masterTemplate = "shipsimu_main";
 
        /**
+        * An instance of a controller
+        */
+       private $controllerInstance = null;
+
+       /**
         * An instance of this class
         */
        private static $thisInstance = null;
-
        /**
         * Protected constructor
         *
@@ -184,24 +188,35 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
                $responseInstance = HttpResponse::createHttpResponse($this);
 
                // Get command parameter
-               $commandPara = $this->getConfigInstance()->readConfig("command_parameter");
+               $commandPara = $this->getConfigInstance()->readConfig('command_parameter');
 
                // Get the parameter from the request
                $commandName = $requestInstance->getRequestElement($commandPara);
 
                // If it is null then get default command
                if (is_null($commandName)) {
-                       $commandName = $this->getConfigInstance()->readConfig("default_command");
+                       $commandName = $this->getConfigInstance()->readConfig('default_command');
                }
 
                // Get a resolver
                $resolverInstance = WebControllerResolver::createWebControllerResolver($commandName, $this);
 
                // Get a new controller instance as well
-               $controllerInstance = $resolverInstance->resolveCommandController();
+               $this->controllerInstance = $resolverInstance->resolveCommandController();
 
                // Handle the request
-               $controllerInstance->handleRequest($requestInstance, $responseInstance);
+               $this->controllerInstance->handleRequest($requestInstance, $responseInstance);
+       }
+
+       /**
+        * Handle the indexed array of fatal messages and puts them out in an
+        * acceptable fasion
+        *
+        * @param       $messageList    An array of fatal messages
+        * @return      void
+        */
+       public function handleFatalMessages (array $messageList) {
+               die("<pre>".print_r($messageList, true)."</pre>");
        }
 }
 
index 3719970..ffc577c 100644 (file)
@@ -35,7 +35,7 @@
 
 // Get an instance of the helper
 $eval = sprintf("\$app = %s::getInstance();",
-       FrameworkConfiguration::getInstance()->readConfig("app_helper_class")
+       FrameworkConfiguration::getInstance()->readConfig('app_helper_class')
 );
 eval($eval);
 
index 0dffa20..35ecc29 100644 (file)
@@ -32,7 +32,7 @@ if (!isset($application)) {
 foreach ($lowerClasses as $class) {
        // Try to load the application classes
        try {
-               ClassLoader::getInstance()->loadClasses(sprintf("%s/%s/%s", FrameworkConfiguration::getInstance()->readConfig("application_path"), $application, $class));
+               ClassLoader::getInstance()->loadClasses(sprintf("%s/%s/%s", FrameworkConfiguration::getInstance()->readConfig('application_path'), $application, $class));
        } catch (PathIsNoDirectoryException $e) {
                ApplicationEntryPoint::app_die(sprintf("[Main:%s] Kann Applikationsklassen im Pfad <strong>%s</strong> nicht laden. Grund: <strong>%s</strong>",
                        $application,
index 0d4ff10..24d21b6 100644 (file)
@@ -184,16 +184,6 @@ class Merchant extends BaseFrameworkSystem {
                // Return price
                return $price;
        }
-
-       /**
-        * Stub!
-        */
-       public function saveObjectToDatabase () {
-               $this->getDebugInstance()->output(sprintf("[%s:] Stub <strong>%s</strong> erreicht.",
-                       $this->__toString(),
-                       __FUNCTION__
-               ));
-       }
 }
 
 // [EOF]
index cd2f045..96ce70d 100644 (file)
@@ -440,16 +440,6 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract {
                // Return total price
                return $totalPrice;
        }
-
-       /**
-        * Stub!
-        */
-       public function saveObjectToDatabase () {
-               $this->getDebugInstance()->output(sprintf("[%s:] Stub <strong>%s</strong> erreicht.",
-                       $this->__toString(),
-                       __FUNCTION__
-               ));
-       }
 }
 
 // [EOF]
index dec3a32..0ae0a1e 100644 (file)
@@ -646,23 +646,6 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner
                // Set the merchant in the contract (for getting prices)
                $contractInstance->setMerchantInstance($merchantInstance);
        }
-
-       /**
-        * Stub!
-        */
-       public function saveObjectToDatabase () {
-               $this->getDebugInstance()->output(sprintf("[%s:] Stub <strong>%s</strong> erreicht.",
-                       $this->__toString(),
-                       __FUNCTION__
-               ));
-       }
-
-       /**
-        * Limits this object with an ObjectLimits instance
-        */
-       public function limitObject (ObjectLimits $limitInstance) {
-               ApplicationEntryPoint::app_die("".__METHOD__." reached! Stub!");
-       }
 }
 
 // [EOF]
index 160b7bf..7d46833 100644 (file)
@@ -39,23 +39,6 @@ class Berth extends BaseConstruction {
                // Generate unique ID number
                $this->createUniqueID();
        }
-
-       /**
-        * Stub!
-        */
-       public function saveObjectToDatabase () {
-               $this->getDebugInstance()->output(sprintf("[%s:] Stub <strong>%s</strong> erreicht.",
-                       $this->__toString(),
-                       __FUNCTION__
-               ));
-       }
-
-       /**
-        * Limits this object with an ObjectLimits instance
-        */
-       public function limitObject (ObjectLimits $limitInstance) {
-               ApplicationEntryPoint::app_die("".__METHOD__." reached! Stub!");
-       }
 }
 
 // [EOF]
index 5209b56..b69692a 100644 (file)
@@ -36,23 +36,6 @@ class DryDock extends BaseConstruction {
                // Generate unique ID number
                $this->createUniqueID();
        }
-
-       /**
-        * Stub!
-        */
-       public function saveObjectToDatabase () {
-               $this->getDebugInstance()->output(sprintf("[%s:] Stub <strong>%s</strong> erreicht.",
-                       $this->__toString(),
-                       __FUNCTION__
-               ));
-       }
-
-       /**
-        * Limits this object with an ObjectLimits instance
-        */
-       public function limitObject (ObjectLimits $limitInstance) {
-               ApplicationEntryPoint::app_die("".__METHOD__." reached! Stub!");
-       }
 }
 
 // [EOF]
index 3bdc297..8922c42 100644 (file)
@@ -110,23 +110,6 @@ class Harbor extends BaseConstruction {
                // Werft generieren und in die Werftliste aufnehmen
                $this->shipyardList->append(Shipyard::createShipyard($this, $shipyardName));
        }
-
-       /**
-        * Stub!
-        */
-       public function saveObjectToDatabase () {
-               $this->getDebugInstance()->output(sprintf("[%s:] Stub <strong>%s</strong> erreicht.",
-                       $this->__toString(),
-                       __FUNCTION__
-               ));
-       }
-
-       /**
-        * Limits this object with an ObjectLimits instance
-        */
-       public function limitObject (ObjectLimits $limitInstance) {
-               ApplicationEntryPoint::app_die("".__METHOD__." reached! Stub!");
-       }
 }
 
 // [EOF]
index ad0a631..d8fa8a0 100644 (file)
@@ -36,23 +36,6 @@ class Terminal extends BaseConstruction {
                // Generate unique ID number
                $this->createUniqueID();
        }
-
-       /**
-        * Stub!
-        */
-       public function saveObjectToDatabase () {
-               $this->getDebugInstance()->output(sprintf("[%s:] Stub <strong>%s</strong> erreicht.",
-                       $this->__toString(),
-                       __FUNCTION__
-               ));
-       }
-
-       /**
-        * Limits this object with an ObjectLimits instance
-        */
-       public function limitObject (ObjectLimits $limitInstance) {
-               ApplicationEntryPoint::app_die("".__METHOD__." reached! Stub!");
-       }
 }
 
 // [EOF]
index 61d2500..7df6e91 100644 (file)
@@ -166,11 +166,6 @@ class Shipyard extends BaseConstruction {
 
        // Add new personell
        public function addNewPersonell ($personell) {
-               if (is_null($this->staffList)) {
-                       // Opps, not initialized!
-                       ApplicationEntryPoint::app_die("New personell: <pre>".print_r($this, true)."</pre>");
-               }
-
                // Add to list
                $this->staffList->append($personell);
        }
@@ -231,23 +226,6 @@ class Shipyard extends BaseConstruction {
                // Return result
                return $result;
        }
-
-       /**
-        * Stub!
-        */
-       public function saveObjectToDatabase () {
-               $this->getDebugInstance()->output(sprintf("[%s:] Stub <strong>%s</strong> erreicht.",
-                       $this->__toString(),
-                       __FUNCTION__
-               ));
-       }
-
-       /**
-        * Limits this object with an ObjectLimits instance
-        */
-       public function limitObject (ObjectLimits $limitInstance) {
-               ApplicationEntryPoint::app_die("".__METHOD__." reached! Stub!");
-       }
 }
 
 // [EOF]
index 77e2ba9..b8f5377 100644 (file)
@@ -67,23 +67,6 @@ class Motor extends BaseDrive implements TradeableItem, ConstructableShipPart {
        public function isTradeable () {
                return true;
        }
-
-       /**
-        * Stub!
-        */
-       public function saveObjectToDatabase () {
-               $this->getDebugInstance()->output(sprintf("[%s:] Stub <strong>%s</strong> erreicht.",
-                       $this->__toString(),
-                       __FUNCTION__
-               ));
-       }
-
-       /**
-        * Limits this object with an ObjectLimits instance
-        */
-       public function limitObject (ObjectLimits $limitInstance) {
-               ApplicationEntryPoint::app_die("".__METHOD__." reached! Stub!");
-       }
 }
 
 // [EOF]
index 1329eac..78ae998 100644 (file)
@@ -56,23 +56,6 @@ class MaschineRoom extends BaseShipPart {
                // Instanz zurueckgeben
                return $roomInstance;
        }
-
-       /**
-        * Stub!
-        */
-       public function saveObjectToDatabase () {
-               $this->getDebugInstance()->output(sprintf("[%s:] Stub <strong>%s</strong> erreicht.",
-                       $this->__toString(),
-                       __FUNCTION__
-               ));
-       }
-
-       /**
-        * Limits this object with an ObjectLimits instance
-        */
-       public function limitObject (ObjectLimits $limitInstance) {
-               ApplicationEntryPoint::app_die("".__METHOD__." reached! Stub!");
-       }
 }
 
 // [EOF]
index 3340a68..4e0dd19 100644 (file)
@@ -123,20 +123,17 @@ class PassengerShip extends BaseShip implements ConstructableShip, LimitableObje
        }
 
        /**
-        * Stub!
+        * Reduces the volume of a processed object.
+        *
+        * @param               $limitInstance          An instance to ObjectLimits which holds
+        *                              attribute names that we want to include in the processing
+        *                              phase. Other attributes except $uniqueID and $realClass will
+        *                              be ignored and keept out.
+        * @return      void
         */
-       public function saveObjectToDatabase () {
-               $this->getDebugInstance()->output(sprintf("[%s:] Stub <strong>%s</strong> erreicht.",
-                       $this->__toString(),
-                       __FUNCTION__
-               ));
-       }
-
-       /**
-        * Limits this object with an ObjectLimits instance
-        */
-       public function limitObject (ObjectLimits $limitInstance) {
-               ApplicationEntryPoint::app_die("".__METHOD__." reached! Stub!");
+       function limitObject (ObjectLimits $limitInstance) {
+               // Work in progress
+               $this->partialStub("Unfinished method called.");
        }
 }
 
index ede1c4e..6a9bb6b 100644 (file)
@@ -35,23 +35,6 @@ class BaseCabin extends BaseCabinStructure {
        public final function isCabin () {
                return ($this->isClass("BaseCabin"));
        }
-
-       /**
-        * Stub!
-        */
-       public function saveObjectToDatabase () {
-               $this->getDebugInstance()->output(sprintf("[%s:] Stub <strong>%s</strong> erreicht.",
-                       $this->__toString(),
-                       __FUNCTION__
-               ));
-       }
-
-       /**
-        * Limits this object with an ObjectLimits instance
-        */
-       public function limitObject (ObjectLimits $limitInstance) {
-               ApplicationEntryPoint::app_die("".__METHOD__." reached! Stub!");
-       }
 }
 
 // [EOF]
index 292d8ae..3675784 100644 (file)
@@ -32,16 +32,6 @@ class BaseDeck extends BaseDeckStructure {
                // Set description
                $this->setObjectDescription("Allgemeines Deck");
        }
-
-       /**
-        * Stub!
-        */
-       public function saveObjectToDatabase () {
-               $this->getDebugInstance()->output(sprintf("[%s:] Stub <strong>%s</strong> erreicht.",
-                       $this->__toString(),
-                       __FUNCTION__
-               ));
-       }
 }
 
 // [EOF]
index bbd873b..b0841d2 100644 (file)
@@ -62,23 +62,6 @@ class Bridge extends BaseUpperStructure implements TradeableItem, ConstructableS
        public function isTradeable () {
                return true;
        }
-
-       /**
-        * Stub!
-        */
-       public function saveObjectToDatabase () {
-               $this->getDebugInstance()->output(sprintf("[%s:] Stub <strong>%s</strong> erreicht.",
-                       $this->__toString(),
-                       __FUNCTION__
-               ));
-       }
-
-       /**
-        * Limits this object with an ObjectLimits instance
-        */
-       public function limitObject (ObjectLimits $limitInstance) {
-               ApplicationEntryPoint::app_die("".__METHOD__." reached! Stub!");
-       }
 }
 
 // [EOF]
index 7086fda..468848d 100644 (file)
@@ -31,26 +31,26 @@ if ((empty($app)) || (is_null($app))) {
        // Something went wrong!
        ApplicationEntryPoint::app_die(sprintf("[Main:] The application <strong>%s</strong> could not be launched because the helper class <strong>%s</strong> is not loaded.",
                $application,
-               FrameworkConfiguration::getInstance()->readConfig("app_helper_class")
+               FrameworkConfiguration::getInstance()->readConfig('app_helper_class')
        ));
 } elseif (!is_object($app)) {
        // No object!
        ApplicationEntryPoint::app_die(sprintf("[Main:] The application <strong>%s</strong> could not be launched because &#39;app&#39; is not an object.",
                $application
        ));
-} elseif (!method_exists($app, FrameworkConfiguration::getInstance()->readConfig("entry_method"))) {
+} elseif (!method_exists($app, FrameworkConfiguration::getInstance()->readConfig('entry_method'))) {
        // Method not found!
        ApplicationEntryPoint::app_die(sprintf("[Main:] The application <strong>%s</strong> could not be launched because the method <strong>%s</strong> is missing.",
                $application,
-               FrameworkConfiguration::getInstance()->readConfig("entry_method")
+               FrameworkConfiguration::getInstance()->readConfig('entry_method')
        ));
 }
 
 // Call the entry point method
 try {
        $eval = sprintf("%s::getInstance()->%s();",
-               FrameworkConfiguration::getInstance()->readConfig("app_helper_class"),
-               FrameworkConfiguration::getInstance()->readConfig("entry_method")
+               FrameworkConfiguration::getInstance()->readConfig('app_helper_class'),
+               FrameworkConfiguration::getInstance()->readConfig('entry_method')
        );
        eval($eval);
 } catch (FrameworkException  $e) {
index 43a5ec6..01fd09f 100644 (file)
@@ -37,7 +37,7 @@ class InvalidTemplateVariableNameException extends FrameworkException {
                        $this->getLine(),
                        basename($classArray[1]),
                        $classArray[2],
-                       $classArray[3]->readConfig("tpl_valid_var")
+                       $classArray[3]->readConfig('tpl_valid_var')
                );
 
                // Call parent constructor
index 5bb3dac..d1d7267 100644 (file)
@@ -84,6 +84,15 @@ interface ManageableApplication extends FrameworkInterface {
         * @return      void
         */
        function entryPoint ();
+
+       /**
+        * Handle the indexed array of fatal messages and puts them out in an
+        * acceptable fasion
+        *
+        * @param       $messageList    An array of fatal messages
+        * @return      void
+        */
+       function handleFatalMessages (array $messageList);
 }
 
 // [EOF]
index 75b851f..1ccb1c2 100644 (file)
@@ -288,16 +288,16 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        // Initialize debug instance
                        if (is_null($this->getDebugInstance())) {
                                // Set the debug output system if it is not debug class ;)
-                               $this->setDebugInstance(DebugMiddleware::createDebugMiddleware($this->getConfigInstance()->readConfig("debug_engine")));
+                               $this->setDebugInstance(DebugMiddleware::createDebugMiddleware($this->getConfigInstance()->readConfig('debug_engine')));
                        }
 
                        // Initialize web instance
                        if (is_null($this->getWebOutputInstance())) {
                                // Generate the eval() command
                                $eval = sprintf("\$this->setWebOutputInstance(%s::create%s(\"%s\"));",
-                                       $this->getConfigInstance()->readConfig("web_engine"),
-                                       $this->getConfigInstance()->readConfig("web_engine"),
-                                       $this->getConfigInstance()->readConfig("web_content_type")
+                                       $this->getConfigInstance()->readConfig('web_engine'),
+                                       $this->getConfigInstance()->readConfig('web_engine'),
+                                       $this->getConfigInstance()->readConfig('web_content_type')
                                );
 
                                // Debug message
@@ -315,7 +315,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                                // Set the compressor channel
                                $this->setCompressorChannel(CompressorChannel::createCompressorChannel(sprintf("%s%s",
                                        PATH,
-                                       $this->getConfigInstance()->readConfig("compressor_base_path")
+                                       $this->getConfigInstance()->readConfig('compressor_base_path')
                                )));
                        }
 
@@ -839,9 +839,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                // Generate FQFN for all application templates
                $fqfn = sprintf("%s%s/%s/%s",
                        PATH,
-                       $this->getConfigInstance()->readConfig("application_path"),
+                       $this->getConfigInstance()->readConfig('application_path'),
                        strtolower($appInstance->getAppShortName()),
-                       $this->getConfigInstance()->readConfig("tpl_base_path")
+                       $this->getConfigInstance()->readConfig('tpl_base_path')
                );
 
                // Are both instances set?
@@ -860,8 +860,8 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
        \$appInstance->getLanguageInstance(),
        \$appInstance->getFileIoInstance()
 );",
-                       $this->getConfigInstance()->readConfig("tpl_engine"),
-                       $this->getConfigInstance()->readConfig("tpl_engine"),
+                       $this->getConfigInstance()->readConfig('tpl_engine'),
+                       $this->getConfigInstance()->readConfig('tpl_engine'),
                        $fqfn
                );
 
@@ -896,10 +896,12 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        public final function debugInstance () {
                // Generate the output
-               $content = "<pre>".trim(print_r($this, true))."</pre>";
+               $content = sprintf("<pre>%s</pre>",
+                       trim(print_r($this, true))
+               );
 
                // Output it
-               ApplicationEntryPoint::app_die("<strong>Debug output:</strong>".$content);
+               ApplicationEntryPoint::app_die(sprintf("<strong>%s debug output:</strong>%s", $this->__toString(), $content));
        }
 
        /**
index 7030bd1..a0f9560 100644 (file)
@@ -99,9 +99,9 @@ class WebHomeCommand extends BaseCommand implements Commandable {
                $templateInstance->loadCodeTemplate($masterTemplate);
 
                // Set title
-               $title = ucfirst($requestInstance->getRequestElement($this->getConfigInstance()->readConfig("command_parameter")));
+               $title = ucfirst($requestInstance->getRequestElement($this->getConfigInstance()->readConfig('command_parameter')));
                if (empty($title)) $title = "Home";
-               $templateInstance->assignVariable("title", $title);
+               $templateInstance->assignVariable('title', $title);
 
                // ... and all variables. This should be merged together in a pattern
                // to make things easier. A cache mechanism should be added between
index 01ba9cd..8ed4a44 100644 (file)
@@ -103,9 +103,9 @@ class WebRegisterCommand extends BaseCommand implements Commandable {
                $templateInstance->loadCodeTemplate($masterTemplate);
 
                // Set title
-               $title = ucfirst($requestInstance->getRequestElement($this->getConfigInstance()->readConfig("command_parameter")));
+               $title = ucfirst($requestInstance->getRequestElement($this->getConfigInstance()->readConfig('command_parameter')));
                if (empty($title)) $title = "Register";
-               $templateInstance->assignVariable("title", $title);
+               $templateInstance->assignVariable('title', $title);
 
                // ... and all variables. This should be merged together in a pattern
                // to make things easier. A cache mechanism should be added between
index bbb1d9c..9ffcf78 100644 (file)
@@ -75,14 +75,15 @@ class WebDoFormController extends BaseController implements Controller {
                // Execute *very* generic pre filters
                $this->executePreFilters($requestInstance, $responseInstance);
 
-               // This request was valid! :-D
-               $requestInstance->requestIsValid();
+               // Is the request still valid? Post filters shall only be executed of
+               // the request is valid
+               if ($requestInstance->isRequestValid()) {
+                       // Execute the command
+                       $commandInstance->execute($requestInstance, $responseInstance);
 
-               // Execute the command
-               $commandInstance->execute($requestInstance, $responseInstance);
-
-               // Execute *very* generic ppost filters
-               $this->executePostFilters($requestInstance, $responseInstance);
+                       // Execute *very* generic ppost filters
+                       $this->executePostFilters($requestInstance, $responseInstance);
+               }
 
                // Flush the buffer out
                $responseInstance->flushBuffer();
index 3da66f9..032f3ce 100644 (file)
@@ -52,7 +52,7 @@ class NewsFactory extends BaseFactory {
                $factoryInstance = new NewsFactory();
 
                // Get the element name from configuration
-               $element = FrameworkConfiguration::getInstance()->readConfig("app_selector_get");
+               $element = FrameworkConfiguration::getInstance()->readConfig('app_selector_get');
 
                // Analyze the request, first get the Uni* application name (short one from URL)
                $appName = $requestInstance->getRequestElement($element);
index 0c761d8..fc14638 100644 (file)
@@ -118,9 +118,9 @@ class WebFormHelper extends BaseHelper {
                        // Add HTML code
                        $formContent = sprintf("<form name=\"%s\" class=\"forms\" action=\"%s\" method=\"%s\" target=\"%s\"",
                                $formName,
-                               $this->getConfigInstance()->readConfig("form_action"),
-                               $this->getConfigInstance()->readConfig("form_method"),
-                               $this->getConfigInstance()->readConfig("form_target")
+                               $this->getConfigInstance()->readConfig('form_action'),
+                               $this->getConfigInstance()->readConfig('form_method'),
+                               $this->getConfigInstance()->readConfig('form_target')
                        );
 
                        // Is the form id set?
@@ -139,7 +139,7 @@ class WebFormHelper extends BaseHelper {
                        $this->formName = $formName;
                } else {
                        // Add the hidden field required to identify safely this form
-                       $this->addInputHiddenField("form", $this->formName);
+                       $this->addInputHiddenField('form', $this->formName);
 
                        // Is a group open?
                        if ($this->groupOpened === true) {
@@ -519,7 +519,7 @@ class WebFormHelper extends BaseHelper {
         * @return      $required       Wether the email address is required
         */
        public function ifRegisterRequiresEmailVerification () {
-               $required = ($this->getConfigInstance()->readConfig("register_requires_email") == "Y");
+               $required = ($this->getConfigInstance()->readConfig('register_requires_email') == "Y");
                return $required;
        }
 
@@ -529,7 +529,7 @@ class WebFormHelper extends BaseHelper {
         * @return      $required       Wether profile shall be asked
         */
        public function ifRegisterIncludesProfile () {
-               $required = ($this->getConfigInstance()->readConfig("register_includes_profile") == "Y");
+               $required = ($this->getConfigInstance()->readConfig('register_includes_profile') == "Y");
                return $required;
        }
 
@@ -539,7 +539,7 @@ class WebFormHelper extends BaseHelper {
         * @return      $required       Wether personal data shall be asked
         */
        public function ifRegisterIncludesPersonaData () {
-               $required = ($this->getConfigInstance()->readConfig("register_personal_data") == "Y");
+               $required = ($this->getConfigInstance()->readConfig('register_personal_data') == "Y");
                return $required;
        }
 
index 47a7c0b..6a830b4 100644 (file)
@@ -101,7 +101,7 @@ class LanguageSystem extends BaseFrameworkSystem implements ManageableLanguage {
                $langInstance->initLanguageStrings();
 
                // Set language code from default config
-               $langInstance->setLanguageCode(FrameworkConfiguration::getInstance()->readConfig("default_lang"));
+               $langInstance->setLanguageCode(FrameworkConfiguration::getInstance()->readConfig('default_lang'));
 
                // Remember this instance
                self::$thisInstance = $langInstance;
@@ -161,6 +161,28 @@ class LanguageSystem extends BaseFrameworkSystem implements ManageableLanguage {
        public final function getLanguageCode () {
                return $this->langCode;
        }
+
+       /**
+        * Get the plain message from the cache variable for the given message id
+        *
+        * @param       $messageId              The message id we shall find in the cache variable
+        * @return      $messageText    The plain message text
+        */
+       public function getMessage ($messageId) {
+               // Default is missing message text
+               $messageText = sprintf("!%s!",
+                       $messageId
+               );
+
+               // Try to look it up in the cache variable
+               if ($this->langStrings->offsetExists($messageId)) {
+                       // Return the message string
+                       $messageText = $this->langStrings->offsetGet($messageId);
+               }
+
+               // Return the text
+               return $messageText;
+       }
 }
 
 // [EOF]
index 5d2b1c1..c421ec4 100644 (file)
@@ -81,7 +81,7 @@ class ConsoleOutput extends BaseFrameworkSystem implements OutputStreamer {
         */
        public final static function getInstance() {
                if (is_null(self::$consoleInstance)) {
-                       $contentType = FrameworkConfiguration::getInstance()->readConfig("web_content_type");
+                       $contentType = FrameworkConfiguration::getInstance()->readConfig('web_content_type');
                        self::$consoleInstance = ConsoleOutput::createConsoleOutput($contentType);
                }
                return self::$consoleInstance;
index 2c1950a..aa337db 100644 (file)
@@ -28,9 +28,11 @@ class HttpRequest extends BaseFrameworkSystem implements Requestable {
        private $requestData = array();
 
        /**
-        * Wether this request is valid and can be further processed
+        * Wether this request is valid and can be further processed. The default is
+        * valid so make sure your intercepting filters sets this attribute to false
+        * when they need to intercept the data flow.
         */
-       private $requestIsValid = false;
+       private $requestIsValid = true;
 
        /**
         * Protected constructor
@@ -169,6 +171,15 @@ class HttpRequest extends BaseFrameworkSystem implements Requestable {
        public final function requestIsValid ($isValid = true) {
                $this->requestIsValid = (bool) $isValid;
        }
+
+       /**
+        * Returns wether this request is valid
+        *
+        * @return      $requestIsValid         Wether this request is valid
+        */
+       public final function isRequestValid () {
+               return $this->requestIsValid;
+       }
 }
 
 // [EOF]
index edfcbe3..d1bc85e 100644 (file)
@@ -94,10 +94,10 @@ class WebCommandResolver extends BaseResolver implements CommandResolver {
                // Test if the required parameter is set
                try {
                        // This goes fine so let's resolv the command
-                       $commandName = $requestInstance->getRequestElement($this->getConfigInstance()->readConfig("command_parameter"));
+                       $commandName = $requestInstance->getRequestElement($this->getConfigInstance()->readConfig('command_parameter'));
 
                        // Is the command empty? Then fall back to default command
-                       if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig("default_command");
+                       if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_command');
 
                        // Check if the command is valid
                        if (!$this->isCommandValid($commandName)) {
@@ -136,7 +136,7 @@ class WebCommandResolver extends BaseResolver implements CommandResolver {
                $commandInstance = null;
 
                // Is the command empty? Then fall back to default command
-               if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig("default_command");
+               if (empty($commandName)) $commandName = $this->getConfigInstance()->readConfig('default_command');
 
                // Check if the command is valid
                if (!$this->isCommandValid($commandName)) {
@@ -161,7 +161,7 @@ class WebCommandResolver extends BaseResolver implements CommandResolver {
         */
        private function loadCommand ($commandName) {
                // Cache default command
-               $defaultCommand = $this->getConfigInstance()->readConfig("default_command");
+               $defaultCommand = $this->getConfigInstance()->readConfig('default_command');
 
                // Init command instance
                $commandInstance = null;
index 788a03c..fe03162 100644 (file)
@@ -141,7 +141,7 @@ class WebControllerResolver extends BaseResolver implements ControllerResolver {
                 //
 
                // Cache default command
-               $defaultCommand = $this->getConfigInstance()->readConfig("default_command");
+               $defaultCommand = $this->getConfigInstance()->readConfig('default_command');
 
                // Init controller instance
                $controllerInstance = null;
@@ -155,7 +155,7 @@ class WebControllerResolver extends BaseResolver implements ControllerResolver {
                        $class = sprintf("Web%sController",
                                $this->convertToClassName($commandName)
                        );
-               } elseif ($this->getConfigInstance()->readConfig("home_with_news") == "Y") {
+               } elseif ($this->getConfigInstance()->readConfig('home_with_news') == "Y") {
                        // Yes, display news in home then set default controller with news
                        $class = "WebDefaultNewsController";
                } else {
index 064b3c8..39185e9 100644 (file)
@@ -112,6 +112,15 @@ class HttpResponse extends BaseFrameworkSystem implements Responseable {
        }
 
        /**
+        * Reset the header array
+        *
+        * @return      void
+        */
+       public final function resetResponseHeaders () {
+               $this->responseHeaders = array();
+       }
+
+       /**
         * "Writes" data to the response body
         *
         * @param       $output         Output we shall sent in the HTTP response
@@ -122,6 +131,16 @@ class HttpResponse extends BaseFrameworkSystem implements Responseable {
        }
 
        /**
+        * Sets the response body to something new
+        *
+        * @param       $output         Output we shall sent in the HTTP response
+        * @return      void
+        */
+       public function setReponseBody ($output) {
+               $this->responseBody = $output;
+       }
+
+       /**
         * Flushs the cached HTTP response to the outer world
         *
         * @param       $foce   Wether we shall force the output or abort if headers are
@@ -136,7 +155,7 @@ class HttpResponse extends BaseFrameworkSystem implements Responseable {
                        throw new ResponseHeadersAlreadySentException($this, self::EXCEPTION_HEADERS_ALREADY_SENT);
                } elseif (!headers_sent()) {
                        // Send headers out
-                       header("HTTP/1.0 {$this->responseStatus}");
+                       header("HTTP/1.1 {$this->responseStatus}");
 
                        // Used later
                        $now = gmdate('D, d M Y H:i:s') . ' GMT';
@@ -155,10 +174,21 @@ class HttpResponse extends BaseFrameworkSystem implements Responseable {
                        }
                }
 
-               // Flush the output to the world
-               $this->getWebOutputInstance()->output($this->responseBody);
-               $this->reponseBody = "";
-               $this->responseHeaders = array();
+               // Are there some error messages?
+               if (count($this->fatalMessages) == 0) {
+                       // Flush the output to the world
+                       $this->getWebOutputInstance()->output($this->responseBody);
+               } else {
+                       // Display all error messages
+                       $this->getApplicationInstance()->handleFatalMessages($this->fatalMessages);
+
+                       // Send the error messages out to the world
+                       $this->getWebOutputInstance()->output($this->responseBody);
+               }
+
+               // Clear response header and body
+               $this->setReponseBody("");
+               $this->resetResponseHeaders();
        }
 
        /**
index 64902cb..79fa507 100644 (file)
@@ -180,11 +180,11 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate
                $tplInstance->setFileIoInstance($ioInstance);
 
                // Set template extensions
-               $tplInstance->setRawTemplateExtension($cfgInstance->readConfig("raw_template_extension"));
-               $tplInstance->setCodeTemplateExtension($cfgInstance->readConfig("code_template_extension"));
+               $tplInstance->setRawTemplateExtension($cfgInstance->readConfig('raw_template_extension'));
+               $tplInstance->setCodeTemplateExtension($cfgInstance->readConfig('code_template_extension'));
 
                // Absolute output path for compiled templates
-               $tplInstance->setCompileOutputPath(PATH . $cfgInstance->readConfig("compile_output_path"));
+               $tplInstance->setCompileOutputPath(PATH . $cfgInstance->readConfig('compile_output_path'));
 
                // Return the prepared instance
                return $tplInstance;
@@ -518,7 +518,7 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate
                $ext = $this->getRawTemplateExtension();
 
                // If we shall load a code-template we need to switch the file extension
-               if ($this->getTemplateType() == $this->getConfigInstance()->readConfig("code_template_type")) {
+               if ($this->getTemplateType() == $this->getConfigInstance()->readConfig('code_template_type')) {
                        // Switch over to the code-template extension
                        $ext = $this->getCodeTemplateExtension();
                }
@@ -905,7 +905,7 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate
         */
        public final function loadWebTemplate ($template) {
                // Set template type
-               $this->setTemplateType($this->getConfigInstance()->readConfig("web_template_type"));
+               $this->setTemplateType($this->getConfigInstance()->readConfig('web_template_type'));
 
                // Load the special template
                $this->loadTemplate($template);
@@ -920,7 +920,7 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate
         */
        public final function loadEmailTemplate ($template) {
                // Set template type
-               $this->setTemplateType($this->getConfigInstance()->readConfig("email_template_type"));
+               $this->setTemplateType($this->getConfigInstance()->readConfig('email_template_type'));
 
                // Load the special template
                $this->loadTemplate($template);
@@ -935,7 +935,7 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate
         */
        public final function loadCodeTemplate ($template) {
                // Set template type
-               $this->setTemplateType($this->getConfigInstance()->readConfig("code_template_type"));
+               $this->setTemplateType($this->getConfigInstance()->readConfig('code_template_type'));
 
                // Load the special template
                $this->loadTemplate($template);
@@ -948,7 +948,7 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate
         */
        public final function compileVariables () {
                // Initialize the $content array
-               $validVar = $this->getConfigInstance()->readConfig("tpl_valid_var");
+               $validVar = $this->getConfigInstance()->readConfig('tpl_valid_var');
                $dummy = array();
 
                // Iterate through all variables
@@ -1047,9 +1047,9 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate
         */
        public final function compileTemplate () {
                // We will only work with template type "code" from configuration
-               if ($this->getTemplateType() != $this->getConfigInstance()->readConfig("code_template_type")) {
+               if ($this->getTemplateType() != $this->getConfigInstance()->readConfig('code_template_type')) {
                        // Abort here
-                       throw new UnexpectedTemplateTypeException(array($this, $this->getTemplateType(), $this->getConfigInstance()->readConfig("code_template_type")), self::EXCEPTION_TEMPLATE_TYPE_IS_UNEXPECTED);
+                       throw new UnexpectedTemplateTypeException(array($this, $this->getTemplateType(), $this->getConfigInstance()->readConfig('code_template_type')), self::EXCEPTION_TEMPLATE_TYPE_IS_UNEXPECTED);
                } // END - if
 
                // Get the raw data.
index fd04ac1..1b33041 100644 (file)
@@ -55,7 +55,7 @@ class CompressorChannel extends BaseMiddleware {
                        // Read all directories but no sub directories
                        while ($dir = $dirPointer->readDirectoryExcept(array("..", ".", ".htaccess"))) {
                                // Is this a class file?
-                               if ((substr($dir, 0, 6) == "class_") && (substr($dir, -4, 4) == FrameworkConfiguration::getInstance()->readConfig("php_extension"))) {
+                               if ((substr($dir, 0, 6) == "class_") && (substr($dir, -4, 4) == FrameworkConfiguration::getInstance()->readConfig('php_extension'))) {
                                        // Get the compressor's name. That's why you must name
                                        // your files like your classes and also that's why you
                                        // must keep on class in one file.
index 7366496..edbe3cb 100644 (file)
@@ -101,8 +101,8 @@ class ClassLoader {
                $this->dirList = new ArrayObject();
 
                // Set suffix and prefix from configuration
-               $this->suffix = $cfgInstance->readConfig("class_suffix");
-               $this->prefix = $cfgInstance->readConfig("class_prefix");
+               $this->suffix = $cfgInstance->readConfig('class_suffix');
+               $this->prefix = $cfgInstance->readConfig('class_prefix');
 
                // Estimate length of prefix and suffix for substr() function (cache)
                $this->sufLen = strlen($this->suffix);
@@ -289,9 +289,9 @@ class ClassLoader {
 }
 
 // Initial load of core classes and the FrameworkDirectoryPointer class
-require_once(sprintf("%sinc/classes/interfaces/class_FrameworkInterface%s", PATH, FrameworkConfiguration::getInstance()->readConfig("php_extension")));
-require_once(sprintf("%sinc/classes/main/class_BaseFrameworkSystem%s", PATH, FrameworkConfiguration::getInstance()->readConfig("php_extension")));
-require_once(sprintf("%sinc/classes/main/io/class_FrameworkDirectoryPointer%s", PATH, FrameworkConfiguration::getInstance()->readConfig("php_extension")));
+require_once(sprintf("%sinc/classes/interfaces/class_FrameworkInterface%s", PATH, FrameworkConfiguration::getInstance()->readConfig('php_extension')));
+require_once(sprintf("%sinc/classes/main/class_BaseFrameworkSystem%s", PATH, FrameworkConfiguration::getInstance()->readConfig('php_extension')));
+require_once(sprintf("%sinc/classes/main/io/class_FrameworkDirectoryPointer%s", PATH, FrameworkConfiguration::getInstance()->readConfig('php_extension')));
 
 // Initialize the class loader
 $loader = new ClassLoader(FrameworkConfiguration::getInstance());
index 0267bfa..e608de1 100644 (file)
@@ -50,7 +50,7 @@ $application = preg_replace('/([^a-z_-])+/i', "", $application);
 
 // Try to load these includes in the given order
 $configAppIncludes = array(
-       sprintf("class_%s", FrameworkConfiguration::getInstance()->readConfig("app_helper_class")), // The ApplicationHelper class
+       sprintf("class_%s", FrameworkConfiguration::getInstance()->readConfig('app_helper_class')), // The ApplicationHelper class
        "config",               // The application's own configuration
        "init",                 // The application initializer
        "loader",               // The application's class loader