Fix bug: invalid cache name then templates extends via array

This commit is contained in:
bzick
2015-01-06 21:35:42 +03:00
parent 2fbb6b44e4
commit ae592d22c7
8 changed files with 45 additions and 154 deletions

View File

@@ -938,7 +938,6 @@ class Fenom
return $tpl;
}
} elseif ($this->_options & self::FORCE_COMPILE) {
return $this->compile($template, $this->_options & self::DISABLE_CACHE & ~self::FORCE_COMPILE, $options);
} else {
return $this->_storage[$key] = $this->_load($template, $options);
@@ -1020,13 +1019,13 @@ class Fenom
$template = $this->getRawTemplate()->load($tpl);
} else {
$template = $this->getRawTemplate()->load($tpl[0], false);
unset($tpl[0]);
foreach ($tpl as $t) {
$template->extend($t);
for($i = 1; $i < count($tpl); $i++) {
$template->extend($tpl[ $i ]);
}
}
if ($store) {
$cache = $this->_getCacheName($tpl, $options);
dumpt($cache, $tpl);
$tpl_tmp = tempnam($this->_compile_dir, $cache);
$tpl_fp = fopen($tpl_tmp, "w");
if (!$tpl_fp) {