From 007de1fefacd2be8caa015887071bcf384ae75a7 Mon Sep 17 00:00:00 2001 From: uwetews Date: Thu, 24 Dec 2015 01:52:30 +0100 Subject: [PATCH] Update for file uid changes of 3.1.30 --- tests/PHPUnit_Smarty.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/PHPUnit_Smarty.php b/tests/PHPUnit_Smarty.php index ff4d16dd..aff2ab6e 100644 --- a/tests/PHPUnit_Smarty.php +++ b/tests/PHPUnit_Smarty.php @@ -351,9 +351,9 @@ KEY `expire` (`expire`) case 'file': case 'filetest': if ($tpl instanceof Smarty) { - return sha1($this->normalizePath($this->smarty->getTemplateDir(0) . $name)); + return sha1($this->normalizePath($this->smarty->getTemplateDir(0) . $name) . $this->smarty->_joined_template_dir); } - return sha1($tpl->source->filepath); + return sha1($tpl->source->filepath . $this->smarty->_joined_template_dir); case 'mysqltest': case 'mysql': return sha1($type . ':' . $name); @@ -529,9 +529,19 @@ KEY `expire` (`expire`) case 'pdo': case 'foobar': $sp = $this->buildSourcePath($tpl, $name, $type, $dir); + $uid = $this->buildUid($tpl, $sp, $name, $type); $_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!', '_', $compile_id) : null; $_cache_id = isset($cache_id) ? preg_replace('![^\w\|]+!', '_', $cache_id) : null; - return sha1($sp . $_cache_id . $_compile_id); + return sha1($uid . $_cache_id . $_compile_id); + case 'memcachetest': + case 'acp': + $sp = $this->buildSourcePath($tpl, $name, $type, $dir); + $uid = $this->buildUid($tpl, $sp, $name, $type); + $_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!', '_', $compile_id) : null; + $_cache_id = isset($cache_id) ? preg_replace('![^\w\|]+!', '_', $cache_id) : null; + return sha1($uid) . '#' . preg_replace('#[^\w\|]+#S', '_', $tpl->template_resource) . '#' . + $_cache_id . '#' . $_compile_id; + default: throw new Exception("Unhandled cache resource type '{$cacheType}'"); }