mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
fixed unnecessary load of source in template_exists() and the
compile-check of smarty_core_read_cache_file()
This commit is contained in:
@@ -1108,7 +1108,7 @@ class Smarty
|
|||||||
*/
|
*/
|
||||||
function template_exists($tpl_file)
|
function template_exists($tpl_file)
|
||||||
{
|
{
|
||||||
$_params = array('resource_name' => $tpl_file);
|
$_params = array('resource_name' => $tpl_file, 'get_source'=>false);
|
||||||
return $this->_fetch_resource_info($_params);
|
return $this->_fetch_resource_info($_params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -68,8 +68,9 @@ function smarty_core_read_cache_file(&$params, &$smarty)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($smarty->compile_check) {
|
if ($smarty->compile_check) {
|
||||||
|
$_params = array('get_source' => false);
|
||||||
foreach (array_keys($smarty->_cache_info['template']) as $_template_dep) {
|
foreach (array_keys($smarty->_cache_info['template']) as $_template_dep) {
|
||||||
$_params = array('resource_name' => $_template_dep);
|
$_params['resource_name'] = $_template_dep;
|
||||||
$smarty->_fetch_resource_info($_params);
|
$smarty->_fetch_resource_info($_params);
|
||||||
if ($smarty->_cache_info['timestamp'] < $_params['resource_timestamp']) {
|
if ($smarty->_cache_info['timestamp'] < $_params['resource_timestamp']) {
|
||||||
// template file has changed, regenerate cache
|
// template file has changed, regenerate cache
|
||||||
@@ -78,7 +79,7 @@ function smarty_core_read_cache_file(&$params, &$smarty)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($smarty->_cache_info['config'])) {
|
if (isset($smarty->_cache_info['config'])) {
|
||||||
$_params = array('resource_base_path' => $smarty->config_dir);
|
$_params = array('resource_base_path' => $smarty->config_dir, 'get_source' => false);
|
||||||
foreach (array_keys($smarty->_cache_info['config']) as $_config_dep) {
|
foreach (array_keys($smarty->_cache_info['config']) as $_config_dep) {
|
||||||
$_params['resource_name'] = $_config_dep;
|
$_params['resource_name'] = $_config_dep;
|
||||||
$smarty->_fetch_resource_info($_params);
|
$smarty->_fetch_resource_info($_params);
|
||||||
|
Reference in New Issue
Block a user