From 9d0865aaf8e0657c8a2a05545d0985a3a3ba5476 Mon Sep 17 00:00:00 2001 From: uwetews Date: Thu, 24 Dec 2015 02:26:31 +0100 Subject: [PATCH] - new feature Caching does now observe the template_dir setting and will create separate cache files if required --- libs/sysplugins/smarty_cacheresource_custom.php | 2 +- libs/sysplugins/smarty_cacheresource_keyvaluestore.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/sysplugins/smarty_cacheresource_custom.php b/libs/sysplugins/smarty_cacheresource_custom.php index 493570c6..2a26be83 100644 --- a/libs/sysplugins/smarty_cacheresource_custom.php +++ b/libs/sysplugins/smarty_cacheresource_custom.php @@ -84,7 +84,7 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource { $_cache_id = isset($cached->cache_id) ? preg_replace('![^\w\|]+!', '_', $cached->cache_id) : null; $_compile_id = isset($cached->compile_id) ? preg_replace('![^\w]+!', '_', $cached->compile_id) : null; - $path = $cached->source->filepath . $_template->smarty->_joined_template_dir. $_cache_id . $_compile_id; + $path = $cached->source->uid . $_cache_id . $_compile_id; $cached->filepath = sha1($path); if ($_template->smarty->cache_locking) { $cached->lock_id = sha1('lock.' . $path); diff --git a/libs/sysplugins/smarty_cacheresource_keyvaluestore.php b/libs/sysplugins/smarty_cacheresource_keyvaluestore.php index 1f73a2ef..c447f6f1 100644 --- a/libs/sysplugins/smarty_cacheresource_keyvaluestore.php +++ b/libs/sysplugins/smarty_cacheresource_keyvaluestore.php @@ -54,7 +54,7 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource */ public function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template) { - $cached->filepath = sha1($_template->source->uid . $_template->smarty->_joined_template_dir) . '#' . $this->sanitize($cached->source->resource) . '#' . + $cached->filepath = sha1($_template->source->uid) . '#' . $this->sanitize($cached->source->resource) . '#' . $this->sanitize($cached->cache_id) . '#' . $this->sanitize($cached->compile_id); $this->populateTimestamp($cached);