From cc5f1eb34df753600801f4619948daffc5c0df2c Mon Sep 17 00:00:00 2001 From: fabriceparallel Date: Sun, 12 Mar 2017 18:42:12 +0200 Subject: [PATCH] Php5.3 autoload errors (#929) * make ErrorHandler extends LogLevel to avoid autoloading issue when error is triggered on compile * Revert "make ErrorHandler extends LogLevel to avoid autoloading issue when error is triggered on compile" This reverts commit 8140f6026f59a2be9f80e562cf6ad6d441241593. * call class_exists with force autoload set to true, to force the autoload of LogLevel on registration of the handlers --- src/Monolog/ErrorHandler.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Monolog/ErrorHandler.php b/src/Monolog/ErrorHandler.php index 0152298d..7bfcd833 100644 --- a/src/Monolog/ErrorHandler.php +++ b/src/Monolog/ErrorHandler.php @@ -58,6 +58,9 @@ class ErrorHandler */ public static function register(LoggerInterface $logger, $errorLevelMap = array(), $exceptionLevel = null, $fatalLevel = null) { + //Forces the autoloader to run for LogLevel. Fixes an autoload issue at compile-time on PHP5.3. See https://github.com/Seldaek/monolog/pull/929 + class_exists('\\Psr\\Log\\LogLevel', true); + $handler = new static($logger); if ($errorLevelMap !== false) { $handler->registerErrorHandler($errorLevelMap);