From: Chad Horohoe Date: Fri, 14 Jan 2011 02:13:30 +0000 (+0000) Subject: Followup r80205: scripts using commandLine.inc were failing the shouldExecute() check... X-Git-Tag: 1.31.0-rc.0~32554 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/?a=commitdiff_plain;h=16467d576f5c9861c64f41be6412e5672b012ab9;p=lhc%2Fweb%2Fwiklou.git 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? --- 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; }