X-Git-Url: https://git.cyclocoop.org/%28%28?a=blobdiff_plain;f=includes%2FForkController.php;h=cc16964e1fdd36a24d9f030692c49f393ce5c6f0;hb=b3f258c360a35ef0697cf7a5d8bdc3c0ef99c48d;hp=27257534988a652afba3c97c62d33017a483bfa6;hpb=46b25eb3a3bb751f827b13b039b1809631826b42;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();