dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix $magicWords for the Sanskrit language
[lhc/web/wiklou.git]
/
includes
/
ForkController.php
diff --git
a/includes/ForkController.php
b/includes/ForkController.php
index
c1765e2
..
cc16964
100644
(file)
--- a/
includes/ForkController.php
+++ b/
includes/ForkController.php
@@
-19,6
+19,7
@@
*
* @file
*/
*
* @file
*/
+use MediaWiki\MediaWikiServices;
/**
* Class for managing forking command line scripts.
/**
* Class for managing forking command line scripts.
@@
-30,11
+31,11
@@
* @ingroup Maintenance
*/
class ForkController {
* @ingroup Maintenance
*/
class ForkController {
- protected $children =
array()
, $childNumber = 0;
+ protected $children =
[]
, $childNumber = 0;
protected $termReceived = false;
protected $flags = 0, $procsToStart = 0;
protected $termReceived = false;
protected $flags = 0, $procsToStart = 0;
- protected static $restartableSignals =
array(
+ protected static $restartableSignals =
[
SIGFPE,
SIGILL,
SIGSEGV,
SIGFPE,
SIGILL,
SIGSEGV,
@@
-44,7
+45,7
@@
class ForkController {
SIGPIPE,
SIGXCPU,
SIGXFSZ,
SIGPIPE,
SIGXCPU,
SIGXFSZ,
-
)
;
+
]
;
/**
* Pass this flag to __construct() to cause the class to automatically restart
/**
* Pass this flag to __construct() to cause the class to automatically restart
@@
-53,7
+54,7
@@
class ForkController {
const RESTART_ON_ERROR = 1;
public function __construct( $numProcs, $flags = 0 ) {
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;
throw new MWException( "ForkController cannot be used from the web." );
}
$this->procsToStart = $numProcs;
@@
-73,7
+74,7
@@
class ForkController {
*/
public function start() {
// Trap SIGTERM
*/
public function start() {
// Trap SIGTERM
- pcntl_signal( SIGTERM,
array( $this, 'handleTermSignal' )
, false );
+ pcntl_signal( SIGTERM,
[ $this, 'handleTermSignal' ]
, false );
do {
// Start child processes
do {
// Start child processes
@@
-150,10
+151,12
@@
class ForkController {
protected function prepareEnvironment() {
global $wgMemc;
// Don't share DB, storage, or memcached connections
protected function prepareEnvironment() {
global $wgMemc;
// Don't share DB, storage, or memcached connections
-
wfGetLBFactory()->destroyInstance
();
+
MediaWikiServices::resetChildProcessServices
();
FileBackendGroup::destroySingleton();
LockManagerGroup::destroySingletons();
FileBackendGroup::destroySingleton();
LockManagerGroup::destroySingletons();
+ JobQueueGroup::destroySingletons();
ObjectCache::clear();
ObjectCache::clear();
+ RedisConnectionPool::destroySingletons();
$wgMemc = null;
}
$wgMemc = null;
}