mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Interwiki
synced 2024-11-23 14:06:55 +00:00
Migrate to IReadableDatabase::newSelectQueryBuilder
Bug: T312425 Change-Id: I94a69b7c8500a840279528b3cafc452d1b0129f4
This commit is contained in:
parent
2098f23506
commit
eccd91d14e
|
@ -74,12 +74,12 @@ class Hooks implements UserGetAllRightsHook {
|
|||
|
||||
$dbrCentralDB = $connectionProvider->getReplicaDatabase( $wgInterwikiCentralDB ?? false );
|
||||
|
||||
$res = $dbrCentralDB->selectRow(
|
||||
'interwiki',
|
||||
'*',
|
||||
[ 'iw_prefix' => $prefix ],
|
||||
__METHOD__
|
||||
);
|
||||
$res = $dbrCentralDB->newSelectQueryBuilder()
|
||||
->select( '*' )
|
||||
->from( 'interwiki' )
|
||||
->where( [ 'iw_prefix' => $prefix ] )
|
||||
->caller( __METHOD__ )
|
||||
->fetchRow();
|
||||
if ( !$res ) {
|
||||
return true;
|
||||
}
|
||||
|
@ -91,12 +91,12 @@ class Hooks implements UserGetAllRightsHook {
|
|||
// Global interlanguage link? Whoo!
|
||||
$dbrCentralLangDB = $connectionProvider->getReplicaDatabase( $wgInterwikiCentralInterlanguageDB ?? false );
|
||||
|
||||
$res = $dbrCentralLangDB->selectRow(
|
||||
'interwiki',
|
||||
'*',
|
||||
[ 'iw_prefix' => $prefix ],
|
||||
__METHOD__
|
||||
);
|
||||
$res = $dbrCentralLangDB->newSelectQueryBuilder()
|
||||
->select( '*' )
|
||||
->from( 'interwiki' )
|
||||
->where( [ 'iw_prefix' => $prefix ] )
|
||||
->caller( __METHOD__ )
|
||||
->fetchRow();
|
||||
if ( !$res ) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -189,7 +189,12 @@ class SpecialInterwiki extends SpecialPage {
|
|||
|
||||
if ( $action === 'edit' ) {
|
||||
$dbr = MediaWikiServices::getInstance()->getConnectionProvider()->getReplicaDatabase();
|
||||
$row = $dbr->selectRow( 'interwiki', '*', [ 'iw_prefix' => $prefix ], __METHOD__ );
|
||||
$row = $dbr->newSelectQueryBuilder()
|
||||
->select( '*' )
|
||||
->from( 'interwiki' )
|
||||
->where( [ 'iw_prefix' => $prefix ] )
|
||||
->caller( __METHOD__ )
|
||||
->fetchRow();
|
||||
|
||||
$formDescriptor['prefix']['disabled'] = true;
|
||||
$formDescriptor['prefix']['default'] = $prefix;
|
||||
|
@ -379,7 +384,11 @@ class SpecialInterwiki extends SpecialPage {
|
|||
// Fetch list from global table
|
||||
$dbrCentralDB = $connectionProvider->getReplicaDatabase( $interwikiCentralDB );
|
||||
|
||||
$res = $dbrCentralDB->select( 'interwiki', '*', [], __METHOD__ );
|
||||
$res = $dbrCentralDB->newSelectQueryBuilder()
|
||||
->select( '*' )
|
||||
->from( 'interwiki' )
|
||||
->caller( __METHOD__ )
|
||||
->fetchResultSet();
|
||||
$retval = [];
|
||||
foreach ( $res as $row ) {
|
||||
$row = (array)$row;
|
||||
|
@ -400,7 +409,11 @@ class SpecialInterwiki extends SpecialPage {
|
|||
// Fetch list from global table
|
||||
$dbrCentralLangDB = $connectionProvider->getReplicaDatabase( $interwikiCentralInterlanguageDB );
|
||||
|
||||
$res = $dbrCentralLangDB->select( 'interwiki', '*', [], __METHOD__ );
|
||||
$res = $dbrCentralLangDB->newSelectQueryBuilder()
|
||||
->select( '*' )
|
||||
->from( 'interwiki' )
|
||||
->caller( __METHOD__ )
|
||||
->fetchResultSet();
|
||||
$retval2 = [];
|
||||
foreach ( $res as $row ) {
|
||||
$row = (array)$row;
|
||||
|
|
Loading…
Reference in a new issue