Page MenuHomePhabricator

Replace wfGetDB() by injecting new Db-Service in Client's populateInterwiki. maintenance script
Closed, ResolvedPublic

Description

Note that wfGetDB() uses \Wikimedia\Rdbms\LoadBalancer::getMaintenanceConnectionRef internally. Check if that connection ref is really necessary for this use case.

Also note from the documentation of wfGetDB():

* Note 3: When replacing calls to this with calls to methods on an injected
* LoadBalancer, LoadBalancer::getConnectionRef is more commonly needed than
* LoadBalancer::getMaintenanceConnectionRef, which is needed for more advanced
* administrative tasks. See the IMaintainableDatabase and IDatabase interfaces
* for details.

Acceptance Criteria:

  • wfGetDB() is no longer used in populateInterwiki.php maintenance script
  • wfGetDB() is no longer used in tests for this script (if there are any)

Event Timeline

Change 703595 had a related patch set uploaded (by Ladsgroup; author: Ladsgroup):

[mediawiki/extensions/Wikibase@master] client: Avoid using wfGetDB in populateInterwiki

https://gerrit.wikimedia.org/r/703595

Change 703595 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] client: Avoid using wfGetDB in populateInterwiki

https://gerrit.wikimedia.org/r/703595