Merge pull request #2695 from guillaumelecerf/fix_cache_gc_with_cachedir_devnull
Fix Cache::gc() when COMPOSER_CACHE_DIR=/dev/nullpull/2705/head
commit
93da24b45a
|
@ -143,6 +143,8 @@ class Cache
|
||||||
}
|
}
|
||||||
|
|
||||||
public function gc($ttl, $maxSize)
|
public function gc($ttl, $maxSize)
|
||||||
|
{
|
||||||
|
if ($this->enabled)
|
||||||
{
|
{
|
||||||
$expire = new \DateTime();
|
$expire = new \DateTime();
|
||||||
$expire->modify('-'.$ttl.' seconds');
|
$expire->modify('-'.$ttl.' seconds');
|
||||||
|
@ -168,6 +170,9 @@ class Cache
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public function sha1($file)
|
public function sha1($file)
|
||||||
{
|
{
|
||||||
$file = preg_replace('{[^'.$this->whitelist.']}i', '-', $file);
|
$file = preg_replace('{[^'.$this->whitelist.']}i', '-', $file);
|
||||||
|
|
Loading…
Reference in New Issue