r78721 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78720‎ | r78721 | r78722 >
Date:19:45, 21 December 2010
Author:reedy
Status:ok
Tags:
Comment:
Add a getQueryInfo, leaving getSQL, keeping back compat
Modified paths:
  • /branches/querypage-work2/extensions/ApprovedRevs/SpecialApprovedRevs.php (modified) (history)

Diff [purge]

Index: branches/querypage-work2/extensions/ApprovedRevs/SpecialApprovedRevs.php
@@ -135,10 +135,58 @@
136136 }
137137 }
138138
 139+ function getQueryInfo() {
 140+ if ( $this->mMode == 'notlatest' ) {
 141+ return array(
 142+ 'tables' => array( 'ar' => 'approved_revs', 'p' => 'page' ),
 143+ 'fields' => array(
 144+ 'p.page_id AS id',
 145+ 'ar.rev_id AS rev_id',
 146+ 'p.page_latest AS latest_id',
 147+ ),
 148+ 'join_conds' => array(
 149+ 'page AS p' => array(
 150+ 'JOIN', 'ar.page_id=p.page_id'
 151+ )
 152+ ),
 153+ 'conds' => array( 'p.page_latest != ar.rev_id')
 154+ );
 155+ } elseif ( $this->mMode == 'unapproved' ) {
 156+ return array(
 157+ 'tables' => array( 'ar' => 'approve_revs', 'p' => 'page' ),
 158+ 'fields' => array( 'p.page_id AS id' ),
 159+ 'join_conds' => array(
 160+ 'page AS p' => array(
 161+ 'RIGHT OUTER JOIN', 'ar.page_id=p.page_id'
 162+ )
 163+ ),
 164+ 'conds' => array( "ar.page_id IS NULL" )
 165+ );
 166+ } else { // all approved pages
 167+ return array(
 168+ 'tables' => array( 'ar' => 'approved_revs', 'p' => 'page' ),
 169+ 'fields' => array(
 170+ 'p.page_id AS id',
 171+ 'ar.rev_id AS rev_id',
 172+ 'p.page_latest AS latest_id',
 173+ ),
 174+ 'join_conds' => array(
 175+ 'page AS p' => array(
 176+ 'JOIN', 'ar.page_id=p.page_id'
 177+ )
 178+ ),
 179+ );
 180+ }
 181+ }
 182+
139183 function getOrder() {
140184 return ' ORDER BY p.page_namespace, p.page_title ASC';
141185 }
142186
 187+ function getOrderFields() {
 188+ return array( 'p.page_namespace', 'p.page_title' );
 189+ }
 190+
143191 function formatResult( $skin, $result ) {
144192 $title = Title::newFromId( $result->id );
145193 $pageLink = $skin->makeLinkObj( $title );

Follow-up revisions

RevisionCommit summaryAuthorDate
r78739Followup r78721: remove stray tabscatrope20:47, 21 December 2010

Status & tagging log