summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialRecentchanges.php
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-05-01 15:32:59 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-05-01 15:32:59 -0400
commit6dc1997577fab2c366781fd7048144935afa0012 (patch)
tree8918d28c7ab4342f0738985e37af1dfc42d0e93a /includes/specials/SpecialRecentchanges.php
parent150f94f051128f367bc89f6b7e5f57eb2a69fc62 (diff)
parentfa89acd685cb09cdbe1c64cbb721ec64975bbbc1 (diff)
Merge commit 'fa89acd'
# Conflicts: # .gitignore # extensions/ArchInterWiki.sql
Diffstat (limited to 'includes/specials/SpecialRecentchanges.php')
-rw-r--r--includes/specials/SpecialRecentchanges.php23
1 files changed, 19 insertions, 4 deletions
diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php
index 64b0ecae..0f201d52 100644
--- a/includes/specials/SpecialRecentchanges.php
+++ b/includes/specials/SpecialRecentchanges.php
@@ -57,6 +57,10 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
return;
}
+ $this->addHelpLink(
+ '//meta.wikimedia.org/wiki/Special:MyLanguage/Help:Recent_changes',
+ true
+ );
parent::execute( $subpage );
}
@@ -233,14 +237,21 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
return false;
}
- // rc_new is not an ENUM, but adding a redundant rc_new IN (0,1) gives mysql enough
- // knowledge to use an index merge if it wants (it may use some other index though).
+ // array_merge() is used intentionally here so that hooks can, should
+ // they so desire, override the ORDER BY / LIMIT condition(s); prior to
+ // MediaWiki 1.26 this used to use the plus operator instead, which meant
+ // that extensions weren't able to change these conditions
+ $query_options = array_merge( array(
+ 'ORDER BY' => 'rc_timestamp DESC',
+ 'LIMIT' => $opts['limit'] ), $query_options );
$rows = $dbr->select(
$tables,
$fields,
+ // rc_new is not an ENUM, but adding a redundant rc_new IN (0,1) gives mysql enough
+ // knowledge to use an index merge if it wants (it may use some other index though).
$conds + array( 'rc_new' => array( 0, 1 ) ),
__METHOD__,
- array( 'ORDER BY' => 'rc_timestamp DESC', 'LIMIT' => $opts['limit'] ) + $query_options,
+ $query_options,
$join_conds
);
@@ -263,6 +274,10 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
);
}
+ protected function getDB() {
+ return wfGetDB( DB_SLAVE, 'recentchanges' );
+ }
+
public function outputFeedLinks() {
$this->addFeedLinks( $this->getFeedQuery() );
}
@@ -272,7 +287,7 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
*
* @return array
*/
- private function getFeedQuery() {
+ protected function getFeedQuery() {
$query = array_filter( $this->getOptions()->getAllValues(), function ( $value ) {
// API handles empty parameters in a different way
return $value !== '';