- bugfix custom cache resource did not observe compile_id and cache_id when $cache_locking == true

This commit is contained in:
Uwe Tews
2015-05-10 12:00:19 +02:00
parent edf49ca3cf
commit 5ce5d4df49

View File

@@ -272,12 +272,11 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource
$id = $cached->lock_id;
$name = $cached->source->name . '.lock';
$mtime = $this->fetchTimestamp($id, $name, null, null);
$mtime = $this->fetchTimestamp($id, $name, $cached->cache_id, $cached->compile_id);
if ($mtime === null) {
$this->fetch($id, $name, null, null, $content, $mtime);
$this->fetch($id, $name, $cached->cache_id, $cached->compile_id, $content, $mtime);
}
$stat = $mtime && ($t = time()) - $mtime < $smarty->locking_timeout;
return $stat ? $mtime : $stat;
return $mtime && ($t = time()) - $mtime < $smarty->locking_timeout;
}
/**