From: Amir Sarabadani Date: Mon, 18 Jun 2018 16:34:48 +0000 (+0200) Subject: Move lbFactory defintion from construct to execute in populateChangeTagDef X-Git-Tag: 1.34.0-rc.0~5025 X-Git-Url: https://git.cyclocoop.org/%27%20.%20%24this-%3EgetSkin%28%29-%3EescapeSearchLink%28%29%20.%20%27?a=commitdiff_plain;h=cfa0717d4ac572549fbc00fba3f48a4cac7f4d3b;p=lhc%2Fweb%2Fwiklou.git Move lbFactory defintion from construct to execute in populateChangeTagDef It seems the class doesn't load needed classes in construct so we get Uncaught Error: Class 'MediaWiki\MediaWikiServices' not found Bug: T193871 Change-Id: I0d6a49232cbc256a34ab49e8a4e41f6cc942fe4b --- diff --git a/maintenance/populateChangeTagDef.php b/maintenance/populateChangeTagDef.php index c815d8dba4..3b32c004a7 100644 --- a/maintenance/populateChangeTagDef.php +++ b/maintenance/populateChangeTagDef.php @@ -24,7 +24,7 @@ require_once __DIR__ . '/Maintenance.php'; * @ingroup Maintenance */ class PopulateChangeTagDef extends Maintenance { - /** @var Wikimedia\Rdbms\LBFactory */ + /** @var Wikimedia\Rdbms\ILBFactory */ protected $lbFactory; public function __construct() { @@ -38,11 +38,11 @@ class PopulateChangeTagDef extends Maintenance { false, true ); - $this->lbFactory = MediaWiki\MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); } public function execute() { global $wgChangeTagsSchemaMigrationStage; + $this->lbFactory = MediaWiki\MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); $this->setBatchSize( $this->getOption( 'batch-size', $this->getBatchSize() ) ); $this->countDown( 5 );