]> git.mxchange.org Git - hub.git/commitdiff
Set application instance first (to prevent a NPE in BaseRegistry) and no 'this' in...
authorRoland Häder <roland@mxchange.org>
Tue, 22 Mar 2011 21:18:38 +0000 (21:18 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 22 Mar 2011 21:18:38 +0000 (21:18 +0000)
application/hub/class_ApplicationHelper.php
application/hub/main/producer/cruncher/work_units/class_CruncherTestUnitProducer.php

index b89ec49cb1fe959d8d457a29921fc9054e2e62ce..3241281311f883936fa77bf8b4080e1f9d758040 100644 (file)
@@ -149,6 +149,9 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
         * @return      void
         */
        public final function entryPoint () {
+               // Set this application in registry
+               Registry::getRegistry()->addInstance('app', $this);
+
                // Create a new request object
                $requestInstance = ObjectFactory::createObjectByName('ConsoleRequest');
 
@@ -198,12 +201,6 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
                // Get a controller instance as well
                $this->setControllerInstance($resolverInstance->resolveController());
 
-               // Get the registry
-               $registryInstance = Registry::getRegistry();
-
-               // Set this application
-               $registryInstance->addInstance('app', $this);
-
                // Launch the hub main routine here
                $this->getControllerInstance()->handleRequest($requestInstance, $responseInstance);
 
index cfb288e3c06fa2ff0be84fadc14a37951ab9691b..65ecef42f0ec669bbea640ee26fbd0c6d5037a5a 100644 (file)
@@ -42,7 +42,7 @@ class CruncherTestUnitProducer extends BaseProducer implements UnitProducer, Reg
                $producerInstance = new CruncherTestUnitProducer();
 
                // Initialize this producer
-               $this->initProducer();
+               $producerInstance->initProducer();
 
                // Return the prepared instance
                return $producerInstance;