X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/bilan.php?a=blobdiff_plain;f=includes%2Fexception%2FMWExceptionHandler.php;h=205ec777731883be3d01bef2bba0fc5ebad24c23;hb=55c51f36a4869614d870dac5d870638ec58a95ff;hp=9b591918d41634f4f0e80649b2bb79961ecf0215;hpb=9ac5caffb48b32d2ba4b9be03a5682d657186c7f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/exception/MWExceptionHandler.php b/includes/exception/MWExceptionHandler.php index 9b591918d4..205ec77773 100644 --- a/includes/exception/MWExceptionHandler.php +++ b/includes/exception/MWExceptionHandler.php @@ -121,7 +121,7 @@ class MWExceptionHandler { self::handleException( $e ); // Make sure we don't claim success on exit for CLI scripts (T177414) - if ( PHP_SAPI === 'cli' ) { + if ( wfIsCLI() ) { register_shutdown_function( function () { exit( 255 ); @@ -279,7 +279,7 @@ class MWExceptionHandler { // HHVM: Class undefined: foo // PHP5: Class 'foo' not found if ( preg_match( "/Class (undefined: \w+|'\w+' not found)/", $msg ) ) { - // @codingStandardsIgnoreStart Generic.Files.LineLength.TooLong + // phpcs:disable Generic.Files.LineLength $msg = <<mediawiki.org for help on installing the required components. TXT; - // @codingStandardsIgnoreEnd + // phpcs:enable } // We can't just create an exception and log it as it is likely that @@ -300,7 +300,7 @@ TXT; $logger = LoggerFactory::getInstance( 'fatal' ); $logger->error( $msg, [ 'fatal_exception' => [ - 'class' => 'ErrorException', + 'class' => ErrorException::class, 'message' => "PHP Fatal Error: {$message}", 'code' => $level, 'file' => $file,