Avoid warnings in case cache dir is explicitly directed to /dev/null, fixes #5468
parent
ebae5dfd95
commit
fd6455218e
|
@ -44,6 +44,11 @@ class Cache
|
||||||
$this->whitelist = $whitelist;
|
$this->whitelist = $whitelist;
|
||||||
$this->filesystem = $filesystem ?: new Filesystem();
|
$this->filesystem = $filesystem ?: new Filesystem();
|
||||||
|
|
||||||
|
if (preg_match('{(^|[\\\\/])(\$null|NUL|/dev/null)([\\\\/]|$)}', $cacheDir)) {
|
||||||
|
$this->enabled = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(!is_dir($this->root) && !Silencer::call('mkdir', $this->root, 0777, true))
|
(!is_dir($this->root) && !Silencer::call('mkdir', $this->root, 0777, true))
|
||||||
|| !is_writable($this->root)
|
|| !is_writable($this->root)
|
||||||
|
|
Loading…
Reference in New Issue