diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-12-20 09:00:55 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-12-20 09:00:55 +0100 |
commit | a2190ac74dd4d7080b12bab90e552d7aa81209ef (patch) | |
tree | 8b31f38de9882d18df54cf8d9e0de74167a094eb /includes/specials/SpecialRecentchanges.php | |
parent | 15e69f7b20b6596b9148030acce5b59993b95a45 (diff) | |
parent | 257401d8b2cf661adf36c84b0e3fd1cf85e33c22 (diff) |
Merge branch 'mw-1.26'
Diffstat (limited to 'includes/specials/SpecialRecentchanges.php')
-rw-r--r-- | includes/specials/SpecialRecentchanges.php | 23 |
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 !== ''; |