X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FForkController.php;h=cc16964e1fdd36a24d9f030692c49f393ce5c6f0;hb=a818c667e50ec45397766f1f044ecf39e9f7a072;hp=da4cd17dd7b54c6de2aafb0f68101443df595c4f;hpb=208851e5ec89677f73ad236c24b2f44d3e154168;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/ForkController.php b/includes/ForkController.php index da4cd17dd7..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()->destroy(); + MediaWikiServices::resetChildProcessServices(); FileBackendGroup::destroySingleton(); LockManagerGroup::destroySingletons(); JobQueueGroup::destroySingletons();