X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FForkController.php;h=cc16964e1fdd36a24d9f030692c49f393ce5c6f0;hb=8f4ae0d51c8b4c4f77753e157312a91176f5a719;hp=27257534988a652afba3c97c62d33017a483bfa6;hpb=f9d7d3b8561dab3ddfd8798a77a5b72e03ac8c2b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/ForkController.php b/includes/ForkController.php index 2725753498..cc16964e1f 100644 --- a/includes/ForkController.php +++ b/includes/ForkController.php @@ -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; @@ -150,7 +151,7 @@ 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();