From: Bryan Davis Date: Mon, 11 Apr 2016 19:11:03 +0000 (-0600) Subject: Fix RebuildLocalisationCache bug from MediaWikiServices X-Git-Tag: 1.31.0-rc.0~7325^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=ee8b8f1d3773113a10b0ed34e12f638c54d4ee1e;p=lhc%2Fweb%2Fwiklou.git Fix RebuildLocalisationCache bug from MediaWikiServices Revert changes to rebuildLocalisationCache.php introduced in Ie98bf5a. The forked children do not need separate service connections and the reset process fails due to MW_SERVICE_BOOTSTRAP_COMPLETE being defined. Bug: T132370 Change-Id: I0d7ddcd66e7c6945fabd91fea29a48805bf14793 --- diff --git a/maintenance/rebuildLocalisationCache.php b/maintenance/rebuildLocalisationCache.php index 82b362b817..b9c797d107 100644 --- a/maintenance/rebuildLocalisationCache.php +++ b/maintenance/rebuildLocalisationCache.php @@ -29,8 +29,6 @@ * @ingroup Maintenance */ -use MediaWiki\MediaWikiServices; - require_once __DIR__ . '/Maintenance.php'; /** @@ -113,8 +111,9 @@ class RebuildLocalisationCache extends Maintenance { $pid = ( $threads > 1 ) ? pcntl_fork() : -1; if ( $pid === 0 ) { - // Reset services, so we don't re-use connections. - MediaWikiServices::resetChildProcessServices(); + // Child, reseed because there is no bug in PHP: + // http://bugs.php.net/bug.php?id=42465 + mt_srand( getmypid() ); $this->doRebuild( $codes, $lc, $force ); exit( 0 );