- $this->controllerInstance = $resolverInstance->resolveController();
-
- // Handle the request
- $this->controllerInstance->handleRequest($requestInstance, $responseInstance);
- // ----------------------------- Init phase ---------------------------
-
- // The default node-mode is from our configuration
- $nodeMode = $this->getConfigInstance()->readConfig('node_mode');
- die("Until here!\n");
-
- // 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');
- } else {
- // Set it for easier re-usage
- $requestInstance->setRequestElement('mode', $nodeMode);
- }
-
- // Now convert the node-mode in a class name
- $className = 'Hub' . $this->convertToClassName($nodeMode) . 'Node';
-
- // And try to instance it
- try {
- // Get an instance
- $nodeInstance = ObjectFactory::createObjectByName($className, array($requestInstance));
-
- // Set the app instance
- $nodeInstance->setApplicationInstance($this);
-
- // Initialize all filters
- $nodeInstance->initializeFilters();
- } catch (ClassNotFoundException $e) {
- // This exception means, the node mode is invalid.
- // @TODO Can we rewrite this to app_die() ?
- die('Node mode ' . $nodeMode . ' is invalid.' . "\n");
- }
-
- // ----------------------- Output teaser lines ------------------------
- // Output some introducing lines to the console. This should be later
- // be switched off if this is a productive release because it would be
- // only visible to the logfile.
- $nodeInstance->outputConsoleTeaser();
-
- // ----------------------- Bootstrapping phase ------------------------
- // Try to bootstrap the node and pass the request instance to it for
- // extra arguments which mostly override config entries or enable special
- // features within the hub (none is ready at this development stage)
- $this->debugOutput('BOOTSTRAP: Beginning with bootstrap...');
- $nodeInstance->doBootstrapping();
- $this->debugOutput('BOOTSTRAP: Bootstrap finished.');