From: Brion Vibber Date: Wed, 10 Dec 2008 19:41:20 +0000 (+0000) Subject: Revert r44119 "Remove extract() comment" X-Git-Tag: 1.31.0-rc.0~44061 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=cff7bfe3e85b509d2ec23218948adecc74aaa356;p=lhc%2Fweb%2Fwiklou.git Revert r44119 "Remove extract() comment" extract() is pretty much the devil and shouldn't ever be used for safe, legible code because it makes it much more difficult to analyse the code -- you have to run around trying to track down the source of local variables and there's generally a lot of pain. Removing the FIXME comment isn't a substitute for fixing it. ;) --- diff --git a/includes/ChangesList.php b/includes/ChangesList.php index e3f6d6899f..537d6b77c4 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -339,6 +339,7 @@ class OldChangesList extends ChangesList { wfProfileIn( __METHOD__ ); # Extract DB fields into local scope + // FIXME: Would be good to replace this extract() call with something that explicitly initializes local variables. extract( $rc->mAttribs ); # Should patrol-related stuff be shown? @@ -432,6 +433,7 @@ class EnhancedChangesList extends ChangesList { $rc = RCCacheEntry::newFromParent( $baseRC ); # Extract fields from DB into the function scope (rc_xxxx variables) + // FIXME: Would be good to replace this extract() call with something that explicitly initializes local variables. extract( $rc->mAttribs ); $curIdEq = 'curid=' . $rc_cur_id; @@ -720,6 +722,7 @@ class EnhancedChangesList extends ChangesList { $r .= ''; foreach( $block as $rcObj ) { # Get rc_xxxx variables + // FIXME: Would be good to replace this extract() call with something that explicitly initializes local variables. extract( $rcObj->mAttribs ); #$r .= '
'.$this->spacerArrow(); @@ -839,6 +842,7 @@ class EnhancedChangesList extends ChangesList { protected function recentChangesBlockLine( $rcObj ) { global $wgContLang, $wgRCShowChangedSize; # Get rc_xxxx variables + // FIXME: Would be good to replace this extract() call with something that explicitly initializes local variables. extract( $rcObj->mAttribs ); $curIdEq = "curid={$rc_cur_id}";