diff options
author | Amir Sarabadani <ladsgroup@gmail.com> | 2023-11-16 19:32:41 +0100 |
---|---|---|
committer | Amir Sarabadani <ladsgroup@gmail.com> | 2023-11-20 14:40:28 +0100 |
commit | 2e1cd74ad21a58aef4c2efa7e0eb5733d9244f3d (patch) | |
tree | 36053ad4ceb275bffea5d4354d6c92a2d6361b4e /includes/historyblob | |
parent | 973ea3761c9d827d33fcb8740461623e895b9450 (diff) | |
download | mediawikicore-2e1cd74ad21a58aef4c2efa7e0eb5733d9244f3d.tar.gz mediawikicore-2e1cd74ad21a58aef4c2efa7e0eb5733d9244f3d.zip |
Migrate off wfGetDB() in more places to ICP
This function is uber-deprecated, meaning even its replacement is
deprecated, We have already migrated in static functions and more.
In this batch, all calls have been migrated that there is already a call
to MediaWikiServices::getInstance() making the migration easier. Of
course in most cases, they should eventually turn into proper service
injection but this at least makes it clear what services should be
injected.
Also removing "category" group since we are removing all groups except a
handful from mw (see T263127 for more information).
Bug: T330641
Change-Id: I90cd35ee45a37eb6e6bf7a531cc8f75effbd0328
Diffstat (limited to 'includes/historyblob')
-rw-r--r-- | includes/historyblob/HistoryBlobCurStub.php | 4 | ||||
-rw-r--r-- | includes/historyblob/HistoryBlobStub.php | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/includes/historyblob/HistoryBlobCurStub.php b/includes/historyblob/HistoryBlobCurStub.php index a9baa769ba19..63a8e548a596 100644 --- a/includes/historyblob/HistoryBlobCurStub.php +++ b/includes/historyblob/HistoryBlobCurStub.php @@ -20,6 +20,8 @@ * @file */ +use MediaWiki\MediaWikiServices; + /** * To speed up conversion from 1.4 to 1.5 schema, text rows can refer to the * leftover cur table as the backend. This avoids expensively copying hundreds @@ -50,7 +52,7 @@ class HistoryBlobCurStub { * @return string|false */ public function getText() { - $dbr = wfGetDB( DB_REPLICA ); + $dbr = MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->getReplicaDatabase(); $row = $dbr->newSelectQueryBuilder() ->select( [ 'cur_text' ] ) ->from( 'cur' ) diff --git a/includes/historyblob/HistoryBlobStub.php b/includes/historyblob/HistoryBlobStub.php index dc6125fddb4a..0b7f23882ec4 100644 --- a/includes/historyblob/HistoryBlobStub.php +++ b/includes/historyblob/HistoryBlobStub.php @@ -97,7 +97,7 @@ class HistoryBlobStub { if ( isset( self::$blobCache[$this->mOldId] ) ) { $obj = self::$blobCache[$this->mOldId]; } else { - $dbr = wfGetDB( DB_REPLICA ); + $dbr = MediaWikiServices::getInstance()->getDBLoadBalancerFactory()->getReplicaDatabase(); $row = $dbr->newSelectQueryBuilder() ->select( [ 'old_flags', 'old_text' ] ) ->from( 'text' ) |