- optimize Smarty::templateExists()

This commit is contained in:
uwetews
2015-08-23 05:15:05 +02:00
parent fb83a888f3
commit 1ae11c26c0
2 changed files with 4 additions and 8 deletions

View File

@@ -10,6 +10,7 @@
- optimize rendering
- move caching to Smarty::_cache
- remove properties with redundant content
- optimize Smarty::templateExists()
06.08.2015
- avoid possible circular object references caused by parser/lexer objects

View File

@@ -737,14 +737,9 @@ class Smarty extends Smarty_Internal_TemplateBase
*/
public function templateExists($resource_name)
{
// create template object
$save = $this->_cache['template_objects'];
$tpl = new $this->template_class($resource_name, $this);
// check if it does exists
$result = $tpl->source->exists;
$this->_cache['template_objects'] = $save;
return $result;
// create source object
$source = Smarty_Template_Source::load(null, $this, $resource_name);
return $source->exists;
}
/**