From 577908d0ffb0005fa42d13af1107bccb582a75b5 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Wed, 25 Jun 2014 22:39:58 +0200 Subject: [PATCH] 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 --- maintenance/Maintenance.php | 7 +++++++ 1 file changed, 7 insertions(+) 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 ) { -- 2.20.1