diff --git a/php/src/cache/CacheFile.php b/php/src/cache/CacheFile.php index 15821d5..9fa95b2 100644 --- a/php/src/cache/CacheFile.php +++ b/php/src/cache/CacheFile.php @@ -178,13 +178,14 @@ class CacheFile extends SharedFile { } protected function afterAction() { + # égalité non stricte pour start et duration $modified = false; if ($this->start != $this->ostart) $modified = true; $duration = $this->duration; $oduration = $this->oduration; if ($duration === null || $oduration === null) $modified = true; elseif ($duration->getDest() != $oduration->getDest()) $modified = true; - # égalité stricte uniquement pour $data et $datafiles + # égalité stricte pour $data if ($this->data !== $this->odata) $modified = true; if ($modified && !$this->readonly) { $this->lockWrite(); @@ -288,20 +289,20 @@ class CacheFile extends SharedFile { return $this; } - function get($data=null, bool $noCache=false) { - return $this->action(function () use ($data, $noCache) { - return $this->refreshData($data, $noCache); + function get($key=null, bool $noCache=false) { + return $this->action(function () use ($key, $noCache) { + return $this->refreshData($key, $noCache); }); } - function all($data=null, bool $noCache=false): ?iterable { - $data = $this->get($data, $noCache); + function all($key=null, bool $noCache=false): ?iterable { + $data = $this->get($key, $noCache); if ($data !== null && !is_iterable($data)) $data = [$data]; return $data; } - function delete($data=null): void { - $source = $this->sources[$data] ?? null; + function delete($key=null): void { + $source = $this->sources[$key] ?? null; if ($source !== null) $source->delete(); }