Fix shutdown warnings in PHP7.2+

Check if the current file is valid before re-using it. This fixes
warnings emitted during process shutdown when DboSource is persisting
the method cache.

Fixes #13085
This commit is contained in:
mark_story 2019-04-16 21:23:58 -04:00
parent d954e96671
commit 4d0a209033

View file

@ -352,7 +352,11 @@ class FileEngine extends CacheEngine {
if (!$createKey && !$path->isFile()) {
return false;
}
if (empty($this->_File) || $this->_File->getBaseName() !== $key) {
if (
empty($this->_File) ||
$this->_File->getBaseName() !== $key ||
$this->_File->valid() === false
) {
$exists = file_exists($path->getPathname());
try {
$this->_File = $path->openFile('c+');