From ce2920a0d55933387f3cebea67ba19489ddd50a6 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Sat, 21 Sep 2024 20:20:01 +0200 Subject: [PATCH] Replace deprecated wfGetDB Emits deprecation warnings since 1.42 (30795cda4f59) Not replacing with IConnectionProvider for compatibility (needs 1.40) Change-Id: I253e0c373a2e0d45bbd25b1b6b816ac9d63c9077 --- includes/AJAXPoll.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/AJAXPoll.php b/includes/AJAXPoll.php index ab9ad80..8e5d0a9 100644 --- a/includes/AJAXPoll.php +++ b/includes/AJAXPoll.php @@ -52,7 +52,7 @@ class AJAXPoll { $input = trim( strip_tags( $input ) ); $lines = explode( "\n", trim( $input ) ); - $dbw = wfGetDB( DB_PRIMARY ); + $dbw = MediaWikiServices::getInstance()->getDBLoadBalancer()->getConnection( DB_PRIMARY ); /** * Register poll in the database @@ -135,7 +135,7 @@ class AJAXPoll { } private static function buildStats() { - $dbr = wfGetDB( DB_REPLICA ); + $dbr = MediaWikiServices::getInstance()->getDBLoadBalancer()->getConnection( DB_REPLICA ); $tab = $dbr->selectRow( 'ajaxpoll_vote', @@ -198,7 +198,7 @@ During the last 48 hours, {$tab2->votes} votes have been given."; return self::buildHTML( $id, $user, $readonly, '' ); } - $dbw = wfGetDB( DB_PRIMARY ); + $dbw = MediaWikiServices::getInstance()->getDBLoadBalancer()->getConnection( DB_PRIMARY ); if ( $answer != 0 ) { $answer = ++$answer; @@ -303,7 +303,7 @@ During the last 48 hours, {$tab2->votes} votes have been given."; private static function buildHTML( $id, $user, $readonly, $lines = '', $extra_from_ajax = '' ) { global $wgTitle, $wgLang; - $dbr = wfGetDB( DB_REPLICA ); + $dbr = MediaWikiServices::getInstance()->getDBLoadBalancer()->getConnection( DB_REPLICA ); $row = $dbr->selectRow( 'ajaxpoll_info',