]> git.mxchange.org Git - hub.git/commitdiff
Double-quotes rewritten to single-quotes
authorRoland Häder <roland@mxchange.org>
Tue, 24 Mar 2009 10:26:08 +0000 (10:26 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 24 Mar 2009 10:26:08 +0000 (10:26 +0000)
.gitattributes
application/hub/class_ApplicationHelper.php
application/hub/config.php
application/hub/data.php
application/hub/interfaces/nodes/.htaccess [new file with mode: 0644]
application/hub/interfaces/nodes/class_NodeHelper.php [new file with mode: 0644]
application/hub/main/nodes/class_ [new file with mode: 0644]
application/hub/main/nodes/regular/class_HubRegularNode.php [new file with mode: 0644]
application/hub/starter.php

index 022116b7f4ff704a9a9843df7e8c232e0f08ef65..70fd9a236d7d2174b454387ba430beb82ad50eb4 100644 (file)
@@ -10,14 +10,18 @@ application/hub/exceptions.php -text
 application/hub/exceptions/.htaccess -text
 application/hub/init.php -text
 application/hub/interfaces/.htaccess -text
+application/hub/interfaces/nodes/.htaccess -text
+application/hub/interfaces/nodes/class_NodeHelper.php -text
 application/hub/loader.php -text
 application/hub/main/.htaccess -text
 application/hub/main/nodes/.htaccess -text
 application/hub/main/nodes/boot/.htaccess -text
+application/hub/main/nodes/class_ -text
 application/hub/main/nodes/class_BaseHubNode.php -text
 application/hub/main/nodes/list/.htaccess -text
 application/hub/main/nodes/master/.htaccess -text
 application/hub/main/nodes/regular/.htaccess -text
+application/hub/main/nodes/regular/class_HubRegularNode.php -text
 application/hub/starter.php -text
 /clear-cache.sh -text
 db/.htaccess -text
index eb29ff7b16e6758c7e8f7312f0304c5ec6f11c2c..6f29c8d9219ef148e2d048b1106fcc50464313ef 100644 (file)
@@ -153,7 +153,8 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
         * @return      void
         */
        public final function entryPoint () {
-               // The default node mode is from config. This mode is being "transfered" into a class name
+               // --------------------- Init phase ---------------------
+               // The default node-mode is from our configuration
                $nodeMode = $this->getConfigInstance()->readConfig('node_mode');
 
                // Prepare a ConsoleRequest class to catch all parameters
@@ -170,6 +171,10 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
 
                // 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);
        }
 
        /**
index dfa7194737b51bf897c3d98552f4b71d8305c1ef..490f38f285e0099cb5cdbe252ad1a96f064185db 100644 (file)
@@ -36,11 +36,11 @@ $cfg->setConfigEntry('node_mode', "regular");
 // CFG: TEMPLATE-ENGINE
 $cfg->setConfigEntry('tpl_engine', "ConsoleOutput");
 
-// CFG: WEB-ENGINE
-$cfg->setConfigEntry('web_engine', "DebugConsoleOutput");
+// CFG: OUTPUT-CLASS
+$cfg->setConfigEntry('output_class', "DebugConsoleOutput");
 
-// CFG: DEBUG-ENGINE
-$cfg->setConfigEntry('debug_engine', "DebugErrorLogOutput");
+// CFG: DEBUG-CLASS
+$cfg->setConfigEntry('debug_class', "DebugErrorLogOutput");
 
 // CFG: WEB-CONTENT-TYPE
 $cfg->setConfigEntry('web_content_type', "");
index 932d4535665e84dd10d79475ccd472f84d4d057e..fba94cf90b80b354749c7d2fbae060087672af4c 100644 (file)
@@ -38,7 +38,7 @@ $cfg = FrameworkConfiguration::getInstance();
 
 // Get an instance of the helper
 $app = call_user_func_array(
-       array($cfg->readConfig('app_helper_class'), "getInstance"),
+       array($cfg->readConfig('app_helper_class'), 'getInstance'),
        array()
 );
 
diff --git a/application/hub/interfaces/nodes/.htaccess b/application/hub/interfaces/nodes/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/interfaces/nodes/class_NodeHelper.php b/application/hub/interfaces/nodes/class_NodeHelper.php
new file mode 100644 (file)
index 0000000..75b45ee
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+/**
+ * An interface for "node-helper" classes
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ * @todo               We need to find a better name for this interface
+ *
+ * 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface NodeHelper extends FrameworkInterface {
+       /**
+        * Method to "bootstrap" the node. This step does also apply provided
+        * command-line arguments stored in the request instance
+        *
+        * @param       $requestInstance        An instance of a Requestable class
+        * @return      void
+        */
+       function doBootstrapping (Requestable $requestInstance);
+}
+
+//
+?>
diff --git a/application/hub/main/nodes/class_ b/application/hub/main/nodes/class_
new file mode 100644 (file)
index 0000000..0951d01
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * A hub-node class for the '???' mode
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class Hub???Node extends BaseHubNode implements NodeHelper {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this hub-node class
+        *
+        * @return      $nodeInstance   An instance of this hub-node class
+        */
+       public final static function createHub???Node () {
+               // Get a new instance
+               $nodeInstance = new Hub???Node();
+
+               // Return the instance
+               return $nodeInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/nodes/regular/class_HubRegularNode.php b/application/hub/main/nodes/regular/class_HubRegularNode.php
new file mode 100644 (file)
index 0000000..39903a5
--- /dev/null
@@ -0,0 +1,62 @@
+<?php
+/**
+ * A hub-node class for the 'regular' mode
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class HubRegularNode extends BaseHubNode implements NodeHelper {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this hub-node class
+        *
+        * @return      $nodeInstance   An instance of this hub-node class
+        */
+       public final static function createHubRegularNode () {
+               // Get a new instance
+               $nodeInstance = new HubRegularNode();
+
+               // Return the instance
+               return $nodeInstance;
+       }
+
+       /**
+        * Method to "bootstrap" the node. This step does also apply provided
+        * command-line arguments stored in the request instance. The regular node
+        * should communicate with the bootstrap-nodes at this point.
+        *
+        * @param       $requestInstance        An instance of a Requestable class
+        * @return      void
+        */
+       public function doBootstrapping (Requestable $requestInstance) {
+               $this->partialStub();
+       }
+}
+
+// [EOF]
+?>
index 3a3038b7ee85155c8fa1faa5adb5eabdfdb943f9..4e4a2f770f17a634e5803222002842531fc6f26e 100644 (file)
 
 // Is there an application helper instance? We need the method main() for
 // maining the application
-$app = call_user_func_array(array(FrameworkConfiguration::getInstance()->readConfig('app_helper_class'), "getInstance"), array());
+$app = call_user_func_array(
+       array(
+               FrameworkConfiguration::getInstance()->readConfig('app_helper_class'), 'getInstance'
+       ), array()
+);
 
 // Some sanity checks
 if ((empty($app)) || (is_null($app))) {