Merge "Prevent PHPDBG from issuing notices in unit tests"
[lhc/web/wiklou.git] / includes / jobqueue / JobQueueGroup.php
index de5f410..9f78404 100644 (file)
@@ -120,6 +120,8 @@ class JobQueueGroup {
         * @return void
         */
        public function push( $jobs ) {
+               global $wgJobTypesExcludedFromDefaultQueue;
+
                $jobs = is_array( $jobs ) ? $jobs : [ $jobs ];
                if ( !count( $jobs ) ) {
                        return;
@@ -149,7 +151,7 @@ class JobQueueGroup {
                        'true',
                        15
                );
-               if ( array_intersect( array_keys( $jobsByType ), $this->getDefaultQueueTypes() ) ) {
+               if ( array_diff( array_keys( $jobsByType ), $wgJobTypesExcludedFromDefaultQueue ) ) {
                        $cache->set(
                                $cache->makeGlobalKey( 'jobqueue', $this->wiki, 'hasjobs', self::TYPE_DEFAULT ),
                                'true',
@@ -168,7 +170,7 @@ class JobQueueGroup {
         * @since 1.26
         */
        public function lazyPush( $jobs ) {
-               if ( PHP_SAPI === 'cli' ) {
+               if ( PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg' ) {
                        $this->push( $jobs );
                        return;
                }