Skip to content
This repository was archived by the owner on Oct 15, 2025. It is now read-only.

Commit 4d0a209

Browse files
committed
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
1 parent d954e96 commit 4d0a209

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/Cake/Cache/Engine/FileEngine.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,11 @@ protected function _setKey($key, $createKey = false) {
352352
if (!$createKey && !$path->isFile()) {
353353
return false;
354354
}
355-
if (empty($this->_File) || $this->_File->getBaseName() !== $key) {
355+
if (
356+
empty($this->_File) ||
357+
$this->_File->getBaseName() !== $key ||
358+
$this->_File->valid() === false
359+
) {
356360
$exists = file_exists($path->getPathname());
357361
try {
358362
$this->_File = $path->openFile('c+');

0 commit comments

Comments
 (0)