Skip to content

Commit 60327bc

Browse files
committed
Fix mtime ttl strategy for file cache.
Fixes #79
1 parent 3cd621b commit 60327bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/File.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ protected function getTtl(string $cacheFile)
8282
? (int)file_get_contents("$cacheFile.ttl")
8383
: PHP_INT_MAX;
8484
case 'mtime':
85-
return $this->getTtl($cacheFile) > 0 ? filemtime($cacheFile) + $this->ttl : PHP_INT_MAX;
85+
return $this->ttl > 0 ? filemtime($cacheFile) + $this->ttl : PHP_INT_MAX;
8686
}
8787

8888
throw new \InvalidArgumentException("Invalid TTL strategy '{$this->ttlStrategy}'");

0 commit comments

Comments
 (0)