From: Alexandre Emsenhuber Date: Wed, 25 Jun 2014 20:39:58 +0000 (+0200) Subject: Also check if 'debug_backtrace' is disabled in Maintenance::shouldExecute() X-Git-Tag: 1.31.0-rc.0~15243^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dcompta/operations/modifier.php?a=commitdiff_plain;h=577908d0ffb0005fa42d13af1107bccb582a75b5;p=lhc%2Fweb%2Fwiklou.git Also check if 'debug_backtrace' is disabled in Maintenance::shouldExecute() And execute the script if $wgCommandLineMode is true. Otherwise scripts never get executed. Change-Id: I609d859b616905ab44a060a861be500609e5a9f0 --- diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index e316d9e237..ffb07eb82e 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -136,6 +136,13 @@ abstract class Maintenance { * @return bool */ public static function shouldExecute() { + global $wgCommandLineMode; + + if ( !function_exists( 'debug_backtrace' ) ) { + // If someone has a better idea... + return $wgCommandLineMode; + } + $bt = debug_backtrace(); $count = count( $bt ); if ( $count < 2 ) {