mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
- optimize Smarty::templateExists()
This commit is contained in:
@@ -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
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user