diff options
author | Mario Vavti <mario@mariovavti.com> | 2015-12-06 20:12:05 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2015-12-06 20:12:05 +0100 |
commit | c23ce16cafb826c8bb4fe7aaf2a5525b29052b23 (patch) | |
tree | 2230b03cfa6b74f3898b57bee647bc6276fd5a53 /library/Smarty/libs/sysplugins/smarty_internal_resource_php.php | |
parent | 78a70fed2f7cf9a53e6e4fab516b00cece12fbf0 (diff) | |
download | volse-hubzilla-c23ce16cafb826c8bb4fe7aaf2a5525b29052b23.tar.gz volse-hubzilla-c23ce16cafb826c8bb4fe7aaf2a5525b29052b23.tar.bz2 volse-hubzilla-c23ce16cafb826c8bb4fe7aaf2a5525b29052b23.zip |
update smarty library - seems to bring some performance improvement
Diffstat (limited to 'library/Smarty/libs/sysplugins/smarty_internal_resource_php.php')
-rw-r--r-- | library/Smarty/libs/sysplugins/smarty_internal_resource_php.php | 59 |
1 files changed, 20 insertions, 39 deletions
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_resource_php.php b/library/Smarty/libs/sysplugins/smarty_internal_resource_php.php index 7463c2960..c836d1b26 100644 --- a/library/Smarty/libs/sysplugins/smarty_internal_resource_php.php +++ b/library/Smarty/libs/sysplugins/smarty_internal_resource_php.php @@ -9,9 +9,15 @@ * @author Uwe Tews * @author Rodney Rehm */ -class Smarty_Internal_Resource_PHP extends Smarty_Resource_Uncompiled +class Smarty_Internal_Resource_Php extends Smarty_Internal_Resource_File { /** + * Flag that it's an uncompiled resource + * + * @var bool + */ + public $uncompiled = true; + /** * container for short_open_tag directive's value before executing PHP templates * * @var string @@ -28,44 +34,6 @@ class Smarty_Internal_Resource_PHP extends Smarty_Resource_Uncompiled } /** - * populate Source Object with meta data from Resource - * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object - * - * @return void - */ - public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null) - { - $source->filepath = $this->buildFilepath($source, $_template); - - if ($source->filepath !== false) { - if (is_object($source->smarty->security_policy)) { - $source->smarty->security_policy->isTrustedResourceDir($source->filepath); - } - - $source->uid = sha1($source->filepath); - if ($source->smarty->compile_check) { - $source->timestamp = @filemtime($source->filepath); - $source->exists = !!$source->timestamp; - } - } - } - - /** - * populate Source Object with timestamp and exists from Resource - * - * @param Smarty_Template_Source $source source object - * - * @return void - */ - public function populateTimestamp(Smarty_Template_Source $source) - { - $source->timestamp = @filemtime($source->filepath); - $source->exists = !!$source->timestamp; - } - - /** * Load template's source from file into current template object * * @param Smarty_Template_Source $source source object @@ -116,4 +84,17 @@ class Smarty_Internal_Resource_PHP extends Smarty_Resource_Uncompiled include($source->filepath); ini_set('short_open_tag', $this->short_open_tag); } + + /** + * populate compiled object with compiled filepath + * + * @param Smarty_Template_Compiled $compiled compiled object + * @param Smarty_Internal_Template $_template template object (is ignored) + */ + public function populateCompiledFilepath(Smarty_Template_Compiled $compiled, Smarty_Internal_Template $_template) + { + $compiled->filepath = false; + $compiled->timestamp = false; + $compiled->exists = false; + } } |