]> git.mxchange.org Git - shipsimu.git/commitdiff
Set application instance first (to prevent a NPE in BaseRegistry)
authorRoland Häder <roland@mxchange.org>
Tue, 22 Mar 2011 21:15:22 +0000 (21:15 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 22 Mar 2011 21:15:22 +0000 (21:15 +0000)
application/selector/class_ApplicationHelper.php
application/ship-simu/class_ApplicationHelper.php

index e5e30e5102f25808c80823ea3a73409ea57c860e..621426a07b62cc60f4fddb4c048da208d87b5074 100644 (file)
@@ -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');
 
index 19c7c8ca3ed58225277e034dfcf490cbcc4f693b..9d40b3d915ee3e04433e0dbd30e956f2401b6a3a 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);
+
                // Analyze the environment for type of response/request
                $type = ConsoleTools::analyzeEnvironmentForType();
                $classType = ConsoleTools::analyzeEnvironmentForClassType();