// Get a controller instance as well
$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));
+ // Get the registry
+ $registryInstance = Registry::getRegistry();
- // Set the app instance
- $nodeInstance->setApplicationInstance($this);
+ // Set this application
+ $registryInstance->addInstance('app', $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");
- }
+ // Handle the request
+ $this->controllerInstance->handleRequest($requestInstance, $responseInstance);
+ die("STOP\n");
// ----------------------- Output teaser lines ------------------------
// Output some introducing lines to the console. This should be later