mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
- optimize Smarty::templateExists()
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
- optimize rendering
|
- optimize rendering
|
||||||
- move caching to Smarty::_cache
|
- move caching to Smarty::_cache
|
||||||
- remove properties with redundant content
|
- remove properties with redundant content
|
||||||
|
- optimize Smarty::templateExists()
|
||||||
|
|
||||||
06.08.2015
|
06.08.2015
|
||||||
- avoid possible circular object references caused by parser/lexer objects
|
- 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)
|
public function templateExists($resource_name)
|
||||||
{
|
{
|
||||||
// create template object
|
// create source object
|
||||||
$save = $this->_cache['template_objects'];
|
$source = Smarty_Template_Source::load(null, $this, $resource_name);
|
||||||
$tpl = new $this->template_class($resource_name, $this);
|
return $source->exists;
|
||||||
// check if it does exists
|
|
||||||
$result = $tpl->source->exists;
|
|
||||||
$this->_cache['template_objects'] = $save;
|
|
||||||
|
|
||||||
return $result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user