Set application instance first (to prevent a NPE in BaseRegistry)
authorRoland Häder <roland@mxchange.org>
Tue, 22 Mar 2011 21:12:32 +0000 (21:12 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 22 Mar 2011 21:12:32 +0000 (21:12 +0000)
application/install/class_ApplicationHelper.php

index 49939771c650ae3b868106a470668706f39d589c..58c7e032442b69b82d89b7a32581b0fd4a172cd8 100644 (file)
@@ -84,7 +84,7 @@ class ApplicationHelper extends BaseApplication implements ManageableApplication
                // Is the instance there?
                if (is_null(self::$thisInstance)) {
                        self::$thisInstance = new ApplicationHelper();
-               }
+               } // END - if
 
                // Return the instance
                return self::$thisInstance;
@@ -172,6 +172,9 @@ class ApplicationHelper extends BaseApplication implements ManageableApplication
         * @return      void
         */
        public final function entryPoint () {
+               // Set this application in registry
+               Registry::getRegistry()->addInstance('app', $this);
+
                // Create a new request object
                $requestInstance = ObjectFactory::createObjectByName('HttpRequest');
 
@@ -179,8 +182,8 @@ class ApplicationHelper extends BaseApplication implements ManageableApplication
                $this->setRequestInstance($requestInstance);
 
                // Default response is HTTP (HTML page) and type is "Web"
-               $response = "http";
-               $responseType = "web";
+               $response = 'http';
+               $responseType = 'web';
 
                // Do we have another response?
                if ($requestInstance->isRequestElementSet('request')) {