]> git.mxchange.org Git - hub.git/blobdiff - application/hub/class_ApplicationHelper.php
Double-quotes rewritten to single-quotes
[hub.git] / application / hub / class_ApplicationHelper.php
index 665b5489cfba505f2d449a83a6d144f865aea455..6f29c8d9219ef148e2d048b1106fcc50464313ef 100644 (file)
@@ -22,7 +22,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0
- * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
+ * @copyright  Copyright(c) 2007 - 2009 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
  *
  * This program is free software: you can redistribute it and/or modify
@@ -153,7 +153,28 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
         * @return      void
         */
        public final function entryPoint () {
-               trigger_error(__METHOD__.": Cleared!");
+               // --------------------- Init phase ---------------------
+               // The default node-mode is from our configuration
+               $nodeMode = $this->getConfigInstance()->readConfig('node_mode');
+
+               // Prepare a ConsoleRequest class to catch all parameters
+               $requestInstance = ObjectFactory::createObjectByName('ConsoleRequest');
+
+               // Is the node 'mode' parameter set?
+               if ($requestInstance->isRequestElementSet('mode')) {
+                       // Then use this which overrides the config entry temporarily
+                       $nodeMode = $requestInstance->getRequestElement('mode');
+               } // END - if
+
+               // Now convert the node-mode in a class name
+               $className = 'Hub' . $this->convertToClassName($nodeMode) . 'Node';
+
+               // And try to instance it
+               $nodeInstance = ObjectFactory::createObjectByName($className);
+
+               // --------------------- Bootstrapping phase ---------------------
+               // Try to bootstrap the node and pass the request instance to it
+               $nodeInstance->doBootstrapping($requestInstance);
        }
 
        /**
@@ -176,7 +197,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
         * @return      $masterTemplateName             Name of the master template
         */
        public function buildMasterTemplateName () {
-               return "hub_main";
+               return "node_main";
        }
 }