mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
Update for file uid changes of 3.1.30
This commit is contained in:
@@ -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}'");
|
||||
}
|
||||
|
Reference in New Issue
Block a user