]> git.mxchange.org Git - hub.git/blobdiff - application/hub/class_ApplicationHelper.php
Filter for node initialization added, more preparation for intercepting filter pattern
[hub.git] / application / hub / class_ApplicationHelper.php
index 96d955ace9315cd7489548917999b0968d215dce..0d75b689ebb2ca75a7a0d45d878994b9fe24d4af 100644 (file)
@@ -196,44 +196,15 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
                // 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