1
0
Fork 0

Avoid warnings in case cache dir is explicitly directed to /dev/null, fixes #5468

pull/5380/merge
Jordi Boggiano 2016-06-25 15:49:52 +01:00
parent ebae5dfd95
commit fd6455218e
1 changed files with 5 additions and 0 deletions

View File

@ -44,6 +44,11 @@ class Cache
$this->whitelist = $whitelist;
$this->filesystem = $filesystem ?: new Filesystem();
if (preg_match('{(^|[\\\\/])(\$null|NUL|/dev/null)([\\\\/]|$)}', $cacheDir)) {
$this->enabled = false;
return;
}
if (
(!is_dir($this->root) && !Silencer::call('mkdir', $this->root, 0777, true))
|| !is_writable($this->root)