StringUtils: Clarify that isValidRegex is for PCRE regexps
[lhc/web/wiklou.git] / maintenance / runJobs.php
index 9f5f1af..9354e4f 100644 (file)
  * @ingroup Maintenance
  */
 
+if ( !defined( 'MEDIAWIKI' ) ) {
+       // So extensions (and other code) can check whether they're running in job mode.
+       // This is not defined if this script is included from installer/updater or phpunit.
+       define( 'MEDIAWIKI_JOB_RUNNER', true );
+}
+
 require_once __DIR__ . '/Maintenance.php';
 
 use MediaWiki\Logger\LoggerFactory;
 
-// So extensions (and other code) can check whether they're running in job mode
-define( 'MEDIAWIKI_JOB_RUNNER', true );
-
 /**
  * Maintenance script that runs pending jobs.
  *
@@ -100,7 +103,7 @@ class RunJobs extends Maintenance {
                                $response['reached'] === 'memory-limit'
                        ) {
                                // If job queue is empty, output it
-                               if ( $response['jobs'] === [] ) {
+                               if ( !$outputJSON && $response['jobs'] === [] ) {
                                        $this->output( "Job queue is empty.\n" );
                                }
                                break;