From 16467d576f5c9861c64f41be6412e5672b012ab9 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Fri, 14 Jan 2011 02:13:30 +0000 Subject: [PATCH] Followup r80205: scripts using commandLine.inc were failing the shouldExecute() check due to extra require()s. Scripts using this entry point cannot be included standalone for uses as classes, they will always execute. But then again, if you're not subclassing Maintenance then why are you bothering to write a class in a command line script? --- maintenance/doMaintenance.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/maintenance/doMaintenance.php b/maintenance/doMaintenance.php index e930cc6bb0..0ed50bad75 100644 --- a/maintenance/doMaintenance.php +++ b/maintenance/doMaintenance.php @@ -32,7 +32,9 @@ if ( !defined( 'RUN_MAINTENANCE_IF_MAIN' ) ) { } // Wasn't included from the file scope, halt execution (probably wanted the class) -if( !Maintenance::shouldExecute() ) { +// If a class is using commandLine.inc (old school maintenance), they definitely +// cannot be included and will proceed with execution +if( !Maintenance::shouldExecute() && $maintClass != 'CommandLineInc' ) { return; } -- 2.20.1