diff --git a/change_log.txt b/change_log.txt index b58479f3..7ef8cb41 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,8 @@ -===== Smarty 3.1 ===== +===== Smarty 3.1 trunk ===== +17.09.2011 +- bugfix reverted resource caching as it could not detect template_dir changes + +===== Smarty 3.1.0 ===== 15/09/2011 - optimization of {foreach}; call internal _count() method only when "total" or "last" {foreach} properties are used diff --git a/libs/sysplugins/smarty_internal_utility.php b/libs/sysplugins/smarty_internal_utility.php index d52f6056..c1b968c0 100644 --- a/libs/sysplugins/smarty_internal_utility.php +++ b/libs/sysplugins/smarty_internal_utility.php @@ -234,9 +234,6 @@ class Smarty_Internal_Utility { } } } - // clear compiled cache - Smarty_Resource::$sources = array(); - Smarty_Resource::$compileds = array(); return $_count; } diff --git a/libs/sysplugins/smarty_resource.php b/libs/sysplugins/smarty_resource.php index 42cef6c7..09fd1dee 100644 --- a/libs/sysplugins/smarty_resource.php +++ b/libs/sysplugins/smarty_resource.php @@ -16,16 +16,6 @@ * @subpackage TemplateResources */ abstract class Smarty_Resource { - /** - * cache for Smarty_Template_Source instances - * @var array - */ - public static $sources = array(); - /** - * cache for Smarty_Template_Compiled instances - * @var array - */ - public static $compileds = array(); /** * cache for Smarty_Resource instances * @var array @@ -319,11 +309,6 @@ abstract class Smarty_Resource { */ public static function load(Smarty $smarty, $resource_type) { - // try the instance cache - if (isset(self::$resources[$resource_type])) { - return self::$resources[$resource_type]; - } - // try registered resource if (isset($smarty->registered_resources[$resource_type])) { if ($smarty->registered_resources[$resource_type] instanceof Smarty_Resource) { @@ -393,12 +378,6 @@ abstract class Smarty_Resource { $template_resource = $_template->template_resource; } - // check runtime cache - $_cache_key = 'template|' . $template_resource; - if (isset(self::$sources[$_cache_key])) { - return self::$sources[$_cache_key]; - } - if (($pos = strpos($template_resource, ':')) === false) { // no resource given, use default $resource_type = $smarty->default_resource_type; @@ -418,8 +397,6 @@ abstract class Smarty_Resource { $source = new Smarty_Template_Source($resource, $smarty, $template_resource, $resource_type, $resource_name); $resource->populate($source, $_template); - // runtime cache - self::$sources[$_cache_key] = $source; return $source; } @@ -588,20 +565,11 @@ class Smarty_Template_Source { */ public function getCompiled(Smarty_Internal_Template $_template) { - // check runtime cache - $_cache_key = $_template->template_resource . '#' . $_template->compile_id; - if (isset(Smarty_Resource::$compileds[$_cache_key])) { - return Smarty_Resource::$compileds[$_cache_key]; - } - $compiled = new Smarty_Template_Compiled($this); $this->handler->populateCompiledFilepath($compiled, $_template); $compiled->timestamp = @filemtime($compiled->filepath); $compiled->exists = !!$compiled->timestamp; - // runtime cache - Smarty_Resource::$compileds[$_cache_key] = $compiled; - return $compiled; }