Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'core/View.php')
-rw-r--r--core/View.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/core/View.php b/core/View.php
index e74eae6201..3c90b5f9a7 100644
--- a/core/View.php
+++ b/core/View.php
@@ -212,10 +212,15 @@ class View implements ViewInterface
return isset($this->templateVars[$name]);
}
+ /** @var Twig */
+ static $twigCached = null;
+
private function initializeTwig()
{
- $piwikTwig = new Twig();
- $this->twig = $piwikTwig->getTwigEnvironment();
+ if (empty(static::$twigCached)) {
+ static::$twigCached = new Twig();
+ }
+ $this->twig = static::$twigCached->getTwigEnvironment();
}
/**