r84430 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84429‎ | r84430 | r84431 >
Date:22:35, 20 March 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Followup r84392

Be a bit more explicit about the code, add a bit of readability into foreach too
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryBase.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryBase.php
@@ -251,11 +251,19 @@
252252 * @return ResultWrapper
253253 */
254254 protected function select( $method, $extraQuery = array() ) {
 255+ $tables = $this->tables;
 256+ $fields = $this->fields;
 257+ $where = $this->where;
 258+ $options = $this->options;
 259+ $join_conds = $this->join_conds;
 260+
255261 // Merge $this->tables with $extraQuery['tables'], $this->fields with $extraQuery['fields'], etc.
256262 foreach ( array( 'tables', 'fields', 'where', 'options', 'join_conds' ) as $var ) {
257 - $$var = array_merge( $this->{$var}, isset( $extraQuery[$var] ) ? (array)$extraQuery[$var] : array() );
 263+ if ( isset( $extraQuery[$var] ) ) {
 264+ $$var = array_merge( $$var, (array)$extraQuery[$var] );
 265+ }
258266 }
259 -
 267+
260268 // getDB has its own profileDBIn/Out calls
261269 $db = $this->getDB();
262270

Follow-up revisions

RevisionCommit summaryAuthorDate
r84431As I've removed most of Roans reason to use php magic variables, completely r...reedy22:46, 20 March 2011
r85434MFT: r83885, r83891, r83897, r83902, r83903, r83934, r83965, r83979, r83988, ...demon13:38, 5 April 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r84392Per r83812 CR, solve the categorymembers paging problem by doing separate que...catrope16:25, 20 March 2011

Comments

#Comment by Catrope (talk | contribs)   16:19, 23 March 2011

I'm not deploying revisions that just make stuff more readable :)

Status & tagging log