Merge "Remove unused `.success-box` class"
[lhc/web/wiklou.git] / includes / ForkController.php
index 2725753..af06a88 100644 (file)
@@ -19,6 +19,7 @@
  *
  * @file
  */
+use MediaWiki\MediaWikiServices;
 
 /**
  * Class for managing forking command line scripts.
@@ -53,7 +54,7 @@ class ForkController {
        const RESTART_ON_ERROR = 1;
 
        public function __construct( $numProcs, $flags = 0 ) {
-               if ( PHP_SAPI != 'cli' ) {
+               if ( !wfIsCLI() ) {
                        throw new MWException( "ForkController cannot be used from the web." );
                }
                $this->procsToStart = $numProcs;
@@ -122,6 +123,7 @@ class ForkController {
                                pcntl_signal_dispatch();
                        } else {
                                declare( ticks = 1 ) {
+                                       // @phan-suppress-next-line PhanPluginDuplicateExpressionAssignment
                                        $status = $status;
                                }
                        }
@@ -150,9 +152,8 @@ class ForkController {
        protected function prepareEnvironment() {
                global $wgMemc;
                // Don't share DB, storage, or memcached connections
-               wfGetLBFactory()->destroyInstance();
+               MediaWikiServices::resetChildProcessServices();
                FileBackendGroup::destroySingleton();
-               LockManagerGroup::destroySingletons();
                JobQueueGroup::destroySingletons();
                ObjectCache::clear();
                RedisConnectionPool::destroySingletons();