mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
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:
parent
d954e96671
commit
4d0a209033
1 changed files with 5 additions and 1 deletions
|
@ -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+');
|
||||
|
|
Loading…
Reference in a new issue