r79262 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79261‎ | r79262 | r79263 >
Date:16:40, 30 December 2010
Author:reedy
Status:resolved (Comments)
Tags:
Comment:
Swap extract for explicit variable definitions
Modified paths:
  • /trunk/extensions/Renameuser/RenameUserJob.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Renameuser/RenameUserJob.php
@@ -21,7 +21,20 @@
2222 */
2323 public function run() {
2424 $dbw = wfGetDB( DB_MASTER );
25 - extract( $this->params );
 25+
 26+ $table = $this->params['table'];
 27+ $column = $this->params['column'];
 28+ $oldname = $this->params['oldname'];
 29+ $userID = isset( $this->params['userID'] ) ? $this->params['userID'] : null;
 30+ $uidColumn = isset( $this->params['uidColumn'] ) ? $this->params['uidColumn'] : null;
 31+ $timestampColumn = isset( $this->params['timestampColumn'] ) ? $this->params['timestampColumn'] : null;
 32+ $minTimestamp = $this->params['minTimestamp'];
 33+ $maxTimestamp = $this->params['maxTimestamp'];
 34+ $uniqueKey = isset( $this->params['keyId'] ) ? $this->params['keyId'] : null;
 35+ $keyId = $this->params['keyId'];
 36+ $newname = $this->params['newname'];
 37+ $count = $this->params['count'];
 38+
2639 # Conditions like "*_user_text = 'x'
2740 $conds = array( $column => $oldname );
2841 # If user ID given, add that to condition to avoid rename collisions.

Follow-up revisions

RevisionCommit summaryAuthorDate
r79274Fix spaces to tab from r79262reedy17:32, 30 December 2010
r80502Followup r79262, isset() around keyId, and switch uniqueKey to using it's own...reedy17:56, 18 January 2011

Comments

#Comment by Jack Phoenix (talk | contribs)   17:20, 30 December 2010
+	    $table = $this->params['table'];

There's a tab, followed by four spaces instead of another tab.

#Comment by Nikerabbit (talk | contribs)   08:02, 18 January 2011

PHP Notice: Undefined index: keyId in /www/w/extensions/Renameuser/RenameUserJob.php on line 34

#Comment by Reedy (talk | contribs)   17:40, 18 January 2011

I'm slightly confused about this one then.

$keyId = $this->params['keyId'];

Which would've only done the exact the same as the extract() would've done...

Status & tagging log