Update for file uid changes of 3.1.30

This commit is contained in:
uwetews
2015-12-24 01:52:30 +01:00
parent 1723095862
commit 007de1fefa

View File

@@ -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}'");
}