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
* @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
// 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);
}
/**
// 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', "");
// 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()
);
--- /dev/null
+Deny from all
--- /dev/null
+<?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);
+}
+
+//
+?>
--- /dev/null
+<?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]
+?>
--- /dev/null
+<?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]
+?>
// 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))) {