- Directories created which should hold the classes for our different node types
(aka. node-mode)
- README extended how to launch the hub...
- Exception handler does now output a warning message if you did not throw an
exception which inherits our FrameworkException exception class
application/hub/interfaces/.htaccess -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/list/.htaccess -text
+application/hub/main/nodes/master/.htaccess -text
+application/hub/main/nodes/regular/.htaccess -text
application/hub/starter.php -text
/clear-cache.sh -text
db/.htaccess -text
* @return void
*/
public final function entryPoint () {
- trigger_error(__METHOD__.": Cleared!");
+ // The default node mode is from config. This mode is being "transfered" into a class name
+ $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);
}
/**
* @return $masterTemplateName Name of the master template
*/
public function buildMasterTemplateName () {
- return "hub_main";
+ return "node_main";
}
}
// Some hub-specific configuration like port hostname where we will listen, etc.
$cfg = FrameworkConfiguration::getInstance();
-// CFG: HUB-LISTEN-ADDR
-$cfg->setConfigEntry("hub_listen_addr", "0.0.0.0");
+// CFG: NODE-LISTEN-ADDR
+$cfg->setConfigEntry('node_listen_addr', "0.0.0.0");
-// CFG: HUB-LISTEN-PORT (zero = auto-choose)
-$cfg->setConfigEntry("hub_listen_port", 9060);
+// CFG: NODE-LISTEN-PORT
+$cfg->setConfigEntry('node_listen_port', 9060);
+
+// CFG: NODE-MODE (can be 'regular', 'list', 'master' or 'boot', default is 'regular')
+$cfg->setConfigEntry('node_mode', "regular");
// CFG: TEMPLATE-ENGINE
-$cfg->setConfigEntry("tpl_engine", "ConsoleOutput");
+$cfg->setConfigEntry('tpl_engine', "ConsoleOutput");
// CFG: WEB-ENGINE
-$cfg->setConfigEntry("web_engine", "DebugConsoleOutput");
+$cfg->setConfigEntry('web_engine', "DebugConsoleOutput");
// CFG: DEBUG-ENGINE
-$cfg->setConfigEntry("debug_engine", "DebugErrorLogOutput");
+$cfg->setConfigEntry('debug_engine', "DebugErrorLogOutput");
// CFG: WEB-CONTENT-TYPE
-$cfg->setConfigEntry("web_content_type", "");
+$cfg->setConfigEntry('web_content_type', "");
// [EOF]
?>
// Get 3 call levels
$backTrace = "";
for ($idx = 0; $idx < 3; $idx++) {
+ // Copy array for argument analysis and init variable
$traceArray = $trace[$idx];
+ $argsString = "";
// Convert arguments type into human-readable
- $args = $traceArray['args'];
- $argsString = "";
- foreach ($args as $arg) {
- $argsString .= ", ".gettype($arg);
- }
+ foreach ($traceArray['args'] as $arg) {
+ $argsString .= ", " . gettype($arg);
+ } // END - foreach
$argsString = substr($argsString, 2);
$backTrace .= sprintf("---------- Pos %d: ----------
basename($traceArray['file']),
$traceArray['line']
);
- }
+ } // END - for
// Construct the message
$message = sprintf("--------------------------------------------------------------------------------
);
// Output the message
- print $message;
+ print($message);
+ } else {
+ // Invalid exception instance detected! Do *only* throw exceptions that
+ // extends our own exception 'FrameworkException' to get such nice
+ // outputs like above.
+ print("exceptionInstance is invalid! Please inform the core developer team.\n");
}
}
--- /dev/null
+Deny from all
--- /dev/null
+Deny from all
--- /dev/null
+Deny from all
--- /dev/null
+Deny from all
--- /dev/null
+Deny from all
README
------
-This file needs some extending... ;)
+1.) How to launch the hub:
+--------------------------
+
+At the current stage of code base you need to launch the hub by entering the
+following command at at command prompt (Win32) or console (Linux etc.) in the
+root directory of this script:
+
+php index.php app=hub
+
+Another other (later added) parameters should be added after app=hub in the same
+way due to the "design" of the inc/includes.php script. We need to change that
+anyway.