From cf4d519fe32271c07a9358a6ecd19c7761b9678c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=96=D1=83=D1=80=D0=BE=D0=B2=20=D0=9C=D0=B8=D1=85=D0=B0?= =?UTF-8?q?=D0=B8=D0=BB?= Date: Thu, 7 Jul 2016 15:38:20 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D1=83=20=D1=81=20=D0=BD?= =?UTF-8?q?=D0=B5=D0=BA=D0=BE=D1=80=D1=80=D0=B5=D0=BA=D1=82=D0=BD=D1=8B?= =?UTF-8?q?=D0=BC=20=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=D0=BC=20=D0=BA=D0=B5=D1=88=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Maximaster/Tools/Twig/BitrixLoader.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Maximaster/Tools/Twig/BitrixLoader.php b/src/Maximaster/Tools/Twig/BitrixLoader.php index 3a72b93..9f60c2b 100644 --- a/src/Maximaster/Tools/Twig/BitrixLoader.php +++ b/src/Maximaster/Tools/Twig/BitrixLoader.php @@ -24,7 +24,7 @@ class BitrixLoader extends \Twig_Loader_Filesystem implements \Twig_LoaderInterf */ public function getSource($name) { - return file_get_contents($this->getSourcePath($this->normalizeName($name))); + return file_get_contents($this->getSourcePath($name)); } /** {@inheritdoc} */ @@ -43,7 +43,7 @@ public function getCacheKey($name) */ public function isFresh($name, $time) { - return filemtime($this->getSource($name)) <= $time; + return filemtime($this->getSourcePath($name)) <= $time; } /** @@ -55,6 +55,8 @@ public function isFresh($name, $time) */ public function getSourcePath($name) { + $name = $this->normalizeName($name); + if (isset(static::$resolved[ $name ])) { return static::$resolved[ $name ]; }