* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
- * @author Chad Horohoe <chad@anyonecanedit.org>
* @file
* @ingroup Maintenance
*/
// Wasn't included from the file scope, halt execution (probably wanted the class)
// 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' ) {
+if ( !Maintenance::shouldExecute() && $maintClass != CommandLineInc::class ) {
return;
}
// Custom setup for Maintenance entry point
if ( !defined( 'MW_SETUP_CALLBACK' ) ) {
function wfMaintenanceSetup() {
- // @codingStandardsIgnoreLine MediaWiki.NamingConventions.ValidGlobalName.wgPrefix
+ // phpcs:ignore MediaWiki.NamingConventions.ValidGlobalName.wgPrefix
global $maintenance, $wgLocalisationCacheConf, $wgCacheDirectory;
if ( $maintenance->getDbType() === Maintenance::DB_NONE ) {
if ( $wgLocalisationCacheConf['storeClass'] === false
&& ( $wgLocalisationCacheConf['store'] == 'db'
|| ( $wgLocalisationCacheConf['store'] == 'detect' && !$wgCacheDirectory ) )
) {
- $wgLocalisationCacheConf['storeClass'] = 'LCStoreNull';
+ $wgLocalisationCacheConf['storeClass'] = LCStoreNull::class;
}
}
$maintenance->setAgentAndTriggers();
// Do the work
-$maintenance->execute();
+$success = $maintenance->execute();
// Potentially debug globals
$maintenance->globals();
$lbFactory->commitMasterChanges( 'doMaintenance' );
$lbFactory->shutdown( $lbFactory::SHUTDOWN_NO_CHRONPROT );
}
+
+// Exit with an error status if execute() returned false
+if ( $success === false ) {
+ exit( 1 );
+}