From 6c9dc8e6fb3be17bb135a1e1963d3aaa9a465b4b Mon Sep 17 00:00:00 2001 From: Gael Robin Date: Tue, 21 Nov 2023 06:36:59 +0100 Subject: [PATCH] Close #5918: PHP Fatal error debugging --- views/cache/advanced-cache.php | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/views/cache/advanced-cache.php b/views/cache/advanced-cache.php index 7880fa34d4..f4bb41f284 100644 --- a/views/cache/advanced-cache.php +++ b/views/cache/advanced-cache.php @@ -48,6 +48,14 @@ function ( $class ) use ( $rocket_path ) { // phpcs:ignore Universal.NamingConve $rocket_path . 'inc/classes/logger/class-stream-handler.php', ], 'WP_Rocket\\Traits\\Memoize' => [ $rocket_path . 'inc/classes/traits/trait-memoize.php' ], + 'WP_Rocket\\Dependencies\\Psr\\Log' => [ + $rocket_path . 'inc/Dependencies/Psr/Log/' . str_replace( '\\', '/', $class ) . '.php', + $rocket_path . 'vendor/psr/log/src/' . str_replace('\\', '/', $class) . '.php', + ], + 'WP_Rocket\\Dependencies\\Monolog' => [ + $rocket_path . 'inc/Dependencies/Monolog/' . str_replace( '\\', '/', $class ) . '.php', + $rocket_path . 'vendor/monolog/monolog/src/' . str_replace( '\\', '/', $class ) . '.php', + ], ]; if ( isset( $rocket_classes[ $class ] ) ) { @@ -60,20 +68,6 @@ function ( $class ) use ( $rocket_path ) { // phpcs:ignore Universal.NamingConve break; } } - } elseif ( strpos( $class, 'WP_Rocket\\Dependencies\\Monolog\\' ) === 0 ) { - $class = str_replace( 'WP_Rocket\\Dependencies\\Monolog\\', '', $class ); - - $file = $rocket_path . 'inc/Dependencies/Monolog/' . str_replace( '\\', '/', $class ) . '.php'; - if ( ! file_exists( $file ) ) { - $file = $rocket_path . 'vendor/monolog/monolog/src/' . str_replace( '\\', '/', $class ) . '.php'; - } - } elseif ( strpos( $class, 'WP_Rocket\\Dependencies\\Psr\\Log\\' ) === 0 ) { - $class = str_replace( 'WP_Rocket\\Dependencies\\Psr\\Log\\', '', $class ); - - $file = $rocket_path . 'inc/Dependencies/Psr/Log/' . str_replace( '\\', '/', $class ) . '.php'; - if ( ! file_exists( $file ) ) { - $file = $rocket_path . 'vendor/psr/log/' . str_replace( '\\', '/', $class ) . '.php'; - } } else { return; }