dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6ecf9c6
)
Make it easier to override the DB used for a Pager subclass
author
Aaron Schulz
<aschulz@wikimedia.org>
Tue, 16 Jul 2013 18:15:09 +0000
(11:15 -0700)
committer
Aaron Schulz
<aschulz@wikimedia.org>
Tue, 16 Jul 2013 18:16:47 +0000
(11:16 -0700)
Change-Id: I7341ae499e7a5a97061a130b5a4927bada283330
includes/Pager.php
patch
|
blob
|
history
diff --git
a/includes/Pager.php
b/includes/Pager.php
index
89930e2
..
3ada0e2
100644
(file)
--- a/
includes/Pager.php
+++ b/
includes/Pager.php
@@
-150,7
+150,8
@@
abstract class IndexPager extends ContextSource implements Pager {
}
$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