*
* @file
*/
+use MediaWiki\MediaWikiServices;
/**
* Class for managing forking command line scripts.
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;
protected function prepareEnvironment() {
global $wgMemc;
// Don't share DB, storage, or memcached connections
- wfGetLBFactory()->destroyInstance();
+ MediaWikiServices::resetChildProcessServices();
FileBackendGroup::destroySingleton();
LockManagerGroup::destroySingletons();
JobQueueGroup::destroySingletons();