diff options
author | diosmosis <benaka@piwik.pro> | 2015-10-29 12:58:50 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-10-29 12:58:50 +0300 |
commit | b4fb9d3fbbcb680cebf090f184db8862086e882c (patch) | |
tree | f39117dd6ca6de940d3dfb043ca11b951285e8a5 /core/FrontController.php | |
parent | d1c8d8cc249d52992ca5a3df4a28bf7fefd03e96 (diff) |
Do not use static local variable in FrontController so tests can initialize the object in test methods.
Diffstat (limited to 'core/FrontController.php')
-rw-r--r-- | core/FrontController.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/core/FrontController.php b/core/FrontController.php index 4b47d9024b..e276ed53e7 100644 --- a/core/FrontController.php +++ b/core/FrontController.php @@ -66,6 +66,11 @@ class FrontController extends Singleton public static $enableDispatch = true; /** + * @var bool + */ + private $initialized = false; + + /** * Executes the requested plugin controller method. * * @throws Exception|\Piwik\PluginDeactivatedException in case the plugin doesn't exist, the action doesn't exist, @@ -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'); |