From b08e765125702b0a1d14ce16610c2fc82259c1ca Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 22 Mar 2011 21:15:22 +0000 Subject: [PATCH] Set application instance first (to prevent a NPE in BaseRegistry) --- application/selector/class_ApplicationHelper.php | 3 +++ application/ship-simu/class_ApplicationHelper.php | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/application/selector/class_ApplicationHelper.php b/application/selector/class_ApplicationHelper.php index e5e30e5..621426a 100644 --- a/application/selector/class_ApplicationHelper.php +++ b/application/selector/class_ApplicationHelper.php @@ -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'); diff --git a/application/ship-simu/class_ApplicationHelper.php b/application/ship-simu/class_ApplicationHelper.php index 19c7c8c..9d40b3d 100644 --- a/application/ship-simu/class_ApplicationHelper.php +++ b/application/ship-simu/class_ApplicationHelper.php @@ -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(); -- 2.39.5