Keep autoload cache validation test compatible
This commit is contained in:
@@ -83,12 +83,14 @@ spl_autoload_register(function (string $class): void {
|
||||
if (defined('redis')) {
|
||||
try {
|
||||
$cached = redis->get($cache_key);
|
||||
if (is_string($cached) && $cached !== '' && is_file($cached) && $isPathInside($cached, $wdReal)) {
|
||||
require_once $cached;
|
||||
if ($is_loaded($class)) {
|
||||
return;
|
||||
if (is_string($cached) && $cached !== '' && is_file($cached)) {
|
||||
if ($isPathInside($cached, $wdReal)) {
|
||||
require_once $cached;
|
||||
if ($is_loaded($class)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Stale class mapping in cache, continue with normal lookup.
|
||||
// Stale, invalid, or unsafe class mapping in cache; continue with normal lookup.
|
||||
redis->delete($cache_key);
|
||||
} elseif (is_string($cached) && $cached !== '') {
|
||||
// Remove non-existing cached path to avoid repeated failed lookups.
|
||||
|
||||
Reference in New Issue
Block a user