X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FForkController.php;h=2dde17be0803e073ea7a5e69c724d38cb4eac6dc;hb=2c1c8238707f0a5d5e09f4fb0b8a252fdfa6577f;hp=4a021ee1e5a65da4d150dd534930266c49a52282;hpb=466962bd4bf8c8b649eb168b3d8afe189c5b42bf;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/ForkController.php b/includes/ForkController.php index 4a021ee1e5..2dde17be08 100644 --- a/includes/ForkController.php +++ b/includes/ForkController.php @@ -19,6 +19,7 @@ * * @file */ +use MediaWiki\MediaWikiServices; /** * Class for managing forking command line scripts. @@ -30,11 +31,11 @@ * @ingroup Maintenance */ class ForkController { - protected $children = array(), $childNumber = 0; + protected $children = [], $childNumber = 0; protected $termReceived = false; protected $flags = 0, $procsToStart = 0; - protected static $restartableSignals = array( + protected static $restartableSignals = [ SIGFPE, SIGILL, SIGSEGV, @@ -44,7 +45,7 @@ class ForkController { SIGPIPE, SIGXCPU, SIGXFSZ, - ); + ]; /** * Pass this flag to __construct() to cause the class to automatically restart @@ -73,7 +74,7 @@ class ForkController { */ public function start() { // Trap SIGTERM - pcntl_signal( SIGTERM, array( $this, 'handleTermSignal' ), false ); + pcntl_signal( SIGTERM, [ $this, 'handleTermSignal' ], false ); do { // Start child processes @@ -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();