From b4fb9d3fbbcb680cebf090f184db8862086e882c Mon Sep 17 00:00:00 2001 From: diosmosis Date: Thu, 29 Oct 2015 02:58:50 -0700 Subject: Do not use static local variable in FrontController so tests can initialize the object in test methods. --- core/FrontController.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'core') diff --git a/core/FrontController.php b/core/FrontController.php index 4b47d9024b..e276ed53e7 100644 --- a/core/FrontController.php +++ b/core/FrontController.php @@ -65,6 +65,11 @@ class FrontController extends Singleton */ public static $enableDispatch = true; + /** + * @var bool + */ + private $initialized = false; + /** * Executes the requested plugin controller method. * @@ -197,11 +202,11 @@ class FrontController extends Singleton */ public function init() { - static $initialized = false; - if ($initialized) { + if ($this->initialized) { return; } - $initialized = true; + + $this->initialized = true; $tmpPath = StaticContainer::get('path.tmp'); -- cgit v1.2.3