diff --git a/initialise/MirahezeFunctions.php b/initialise/MirahezeFunctions.php index d83e515e9f..152479504b 100644 --- a/initialise/MirahezeFunctions.php +++ b/initialise/MirahezeFunctions.php @@ -5,7 +5,7 @@ use MediaWiki\MediaWikiServices; use Miraheze\CreateWiki\Services\RemoteWikiFactory; use Miraheze\ManageWiki\Helpers\ManageWikiSettings; -use Wikimedia\Rdbms\DBConnRef; +use Wikimedia\Rdbms\IDatabase; use Wikimedia\Rdbms\IReadableDatabase; class MirahezeFunctions { @@ -950,13 +950,11 @@ public function loadExtensions() { /** * @param string $databaseName - * @return DBConnRef + * @return IReadableDatabase */ - private static function getDatabaseConnection( string $databaseName ): DBConnRef { - return MediaWikiServices::getInstance() - ->getDBLoadBalancerFactory() - ->getMainLB( $databaseName ) - ->getMaintenanceConnectionRef( DB_REPLICA, [], $databaseName ); + private static function getDatabaseConnection( string $databaseName ): IReadableDatabase { + return MediaWikiServices::getInstance()->getConnectionProvider() + ->getReplicaDatabase( $databaseName ); } /** @@ -1162,7 +1160,7 @@ public static function onManageWikiCoreAddFormFields( $ceMW, $context, $dbName, /** * @param IContextSource $context * @param string $dbName - * @param DBConnRef $dbw + * @param IDatabase $dbw * @param array $formData * @param RemoteWikiFactory &$remoteWiki */