Merge pull request #13126 from cakephp/issue-13085

Fix shutdown warnings in PHP7.2+
This commit is contained in:
Mark Story 2019-04-17 11:44:57 -04:00 committed by GitHub
commit c8a9c61f27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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+');