r61671 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61670‎ | r61671 | r61672 >
Date:17:34, 29 January 2010
Author:reedy
Status:ok
Tags:
Comment:
Followup r61663 per Chads comment. Move $db declaration earlier, use $db->getType()

Remove now unused global
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryWatchlist.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryWatchlist.php
@@ -172,9 +172,10 @@
173173 if ( !is_null( $params['excludeuser'] ) )
174174 $this->addWhere( 'rc_user_text != ' . $this->getDB()->addQuotes( $params['excludeuser'] ) );
175175
176 - global $wgDBtype;
 176+ $db = $this->getDB();
 177+
177178 // This is an index optimization for mysql, as done in the Special:Watchlist page
178 - $this->addWhereIf( "rc_timestamp > ''", !isset ( $params['start'] ) && !isset ( $params['end'] ) && $wgDBtype == 'mysql' );
 179+ $this->addWhereIf( "rc_timestamp > ''", !isset ( $params['start'] ) && !isset ( $params['end'] ) && $db->getType() == 'mysql' );
179180
180181 $this->addOption( 'LIMIT', $params['limit'] + 1 );
181182
@@ -182,7 +183,6 @@
183184 $count = 0;
184185 $res = $this->select( __METHOD__ );
185186
186 - $db = $this->getDB();
187187 while ( $row = $db->fetchObject( $res ) ) {
188188 if ( ++ $count > $params['limit'] ) {
189189 // We've reached the one extra which shows that there are additional pages to be had. Stop here...

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r61663Duplicate "definition" of $wgUser in same method...reedy14:43, 29 January 2010

Status & tagging log