jenkins-bot has submitted this change and it was merged.
Change subject: Make it easier to override the DB used for a Pager subclass
......................................................................
Make it easier to override the DB used for a Pager subclass
Change-Id: I7341ae499e7a5a97061a130b5a4927bada283330
---
M includes/Pager.php
1 file changed, 2 insertions(+), 1 deletion(-)
Approvals:
Demon: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/Pager.php b/includes/Pager.php
index 89930e2..3ada0e2 100644
--- a/includes/Pager.php
+++ b/includes/Pager.php
@@ -150,7 +150,8 @@
}
$this->mIsBackwards = ( $this->mRequest->getVal( 'dir' ) ==
'prev' );
- $this->mDb = wfGetDB( DB_SLAVE );
+ # Let the subclass set the DB here; otherwise use a slave DB
for the current wiki
+ $this->mDb = $this->mDb ?: wfGetDB( DB_SLAVE );
$index = $this->getIndexField(); // column to sort on
$extraSort = $this->getExtraSortFields(); // extra columns to
sort on for query planning
--
To view, visit https://gerrit.wikimedia.org/r/73988
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7341ae499e7a5a97061a130b5a4927bada283330
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Demon <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits