- bugfix/improvement in 3.1.22-dev cache locking did not work as expected

This commit is contained in:
Uwe Tews
2015-05-06 23:10:39 +02:00
parent 57df382ff2
commit af08353e93
6 changed files with 56 additions and 31 deletions
@@ -61,7 +61,7 @@ class Smarty_Internal_CacheResource_File extends Smarty_CacheResource
$cached->lock_id = $_lock_dir . sha1($_cache_id . $_compile_id . $_template->source->uid) . '.lock';
}
$cached->filepath = $_cache_dir . $_cache_id . $_compile_id . $_filepath . '.' . basename($_source_file_path) . '.php';
$cached->exists = is_file($cached->filepath);
$cached->timestamp = $cached->exists = is_file($cached->filepath);
if ($cached->exists) {
$cached->timestamp = filemtime($cached->filepath);
}
@@ -113,7 +113,7 @@ class Smarty_Internal_CacheResource_File extends Smarty_CacheResource
$obj = new Smarty_Internal_Write_File();
if ($obj->writeFile($_template->cached->filepath, $content, $_template->smarty) === true) {
$cached = $_template->cached;
$cached->timestamp = $cached->exists = is_file( $cached->filepath);
$cached->timestamp = $cached->exists = is_file($cached->filepath);
if ($cached->exists) {
$cached->timestamp = filemtime($cached->filepath);
return true;