mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-07 20:04:27 +02:00
- bugfix use template fullpath at §smarty->cache->clear(...), $smarty->clear_cache(....)
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
08/02/2010
|
08/02/2010
|
||||||
|
- bugfix use template fullpath at <20>smarty->cache->clear(...), $smarty->clear_cache(....)
|
||||||
- bugfix of cache filename on extended templates when force_compile=true
|
- bugfix of cache filename on extended templates when force_compile=true
|
||||||
|
|
||||||
07/02/2010
|
07/02/2010
|
||||||
|
@@ -130,6 +130,14 @@ class Smarty_Internal_CacheResource_File {
|
|||||||
$_cache_id_parts = explode('|', $_cache_id);
|
$_cache_id_parts = explode('|', $_cache_id);
|
||||||
$_cache_id_parts_count = count($_cache_id_parts);
|
$_cache_id_parts_count = count($_cache_id_parts);
|
||||||
}
|
}
|
||||||
|
if (isset($resource_name)) {
|
||||||
|
$tpl = $this->smarty->createTemplate($resource_name);
|
||||||
|
if ($tpl->isExisting()) {
|
||||||
|
$_resourcename_parts = basename(str_replace('^','/',$tpl->getCachedFilepath()));
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
$_count = 0;
|
$_count = 0;
|
||||||
$_cacheDirs = new RecursiveDirectoryIterator($_dir);
|
$_cacheDirs = new RecursiveDirectoryIterator($_dir);
|
||||||
$_cache = new RecursiveIteratorIterator($_cacheDirs, RecursiveIteratorIterator::CHILD_FIRST);
|
$_cache = new RecursiveIteratorIterator($_cacheDirs, RecursiveIteratorIterator::CHILD_FIRST);
|
||||||
@@ -146,14 +154,9 @@ class Smarty_Internal_CacheResource_File {
|
|||||||
$_parts_count = count($_parts);
|
$_parts_count = count($_parts);
|
||||||
// check name
|
// check name
|
||||||
if (isset($resource_name)) {
|
if (isset($resource_name)) {
|
||||||
$_filename_parts = explode('.', $_parts[$_parts_count-1]);
|
if ($_parts[$_parts_count-1] != $_resourcename_parts) {
|
||||||
$_resourcename_parts = explode('.', $resource_name . '.php');
|
|
||||||
if (count($_filename_parts)-1 != count($_resourcename_parts)) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for ($i = 0; $i < count($_resourcename_parts); $i++) {
|
|
||||||
if ($_filename_parts[$i + 1] != $_resourcename_parts[$i]) continue 2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// check compile id
|
// check compile id
|
||||||
if (isset($_compile_id) && $_parts[$_parts_count-2 - $_compile_id_offset] != $_compile_id) {
|
if (isset($_compile_id) && $_parts[$_parts_count-2 - $_compile_id_offset] != $_compile_id) {
|
||||||
|
Reference in New Issue
Block a user