From 5c2685f1eb336b07376efd515d2baa7a67c97b73 Mon Sep 17 00:00:00 2001 From: klkvsk Date: Tue, 9 Jul 2013 15:10:12 +0400 Subject: [PATCH] fix Fenom::_options not being merged in getTemplate(), but being merged in compile(), therefore_load() was looking up wrong filename when _options != 0 --- src/Fenom.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Fenom.php b/src/Fenom.php index 3d394af..c604648 100644 --- a/src/Fenom.php +++ b/src/Fenom.php @@ -612,17 +612,18 @@ class Fenom { * @return Fenom\Template */ public function getTemplate($template, $options = 0) { - $key = dechex($this->_options | $options)."@".$template; + $options |= $this->_options; + $key = dechex($options)."@".$template; if(isset($this->_storage[ $key ])) { /** @var Fenom\Template $tpl */ $tpl = $this->_storage[ $key ]; - if(($this->_options & self::AUTO_RELOAD) && !$tpl->isValid()) { + if(($options & self::AUTO_RELOAD) && !$tpl->isValid()) { return $this->_storage[ $key ] = $this->compile($template, true, $options); } else { return $tpl; } - } elseif($this->_options & self::FORCE_COMPILE === self::FORCE_COMPILE) { - return $this->compile($template, $this->_options & self::DISABLE_CACHE === self::DISABLE_CACHE, $options); + } elseif($options & self::FORCE_COMPILE === self::FORCE_COMPILE) { + return $this->compile($template, $options & self::DISABLE_CACHE === self::DISABLE_CACHE, $options); } else { return $this->_storage[ $key ] = $this->_load($template, $options); }