From: Nick Jenkins Date: Fri, 12 Jan 2007 10:03:51 +0000 (+0000) Subject: For the "includes/" directory: X-Git-Tag: 1.31.0-rc.0~54466 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=784e69d028c275d3ad919b77486d4c54f2f3ff9f;p=lhc%2Fweb%2Fwiklou.git For the "includes/" directory: * removing unused local vars * removing used global declarations * adding FIXMEs against extract() calls and lines that seem to be using uninitialized variables * adding some array() declarations. --- diff --git a/includes/Article.php b/includes/Article.php index c4c6b1ffad..6ca7dad239 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -407,8 +407,7 @@ class Article { * @return Database */ function &getDB() { - $ret =& wfGetDB( DB_MASTER ); - return $ret; + return wfGetDB( DB_MASTER ); } /** @@ -1674,7 +1673,7 @@ class Article { if( $protect ) $comment .= " [$updated]"; $nullRevision = Revision::newNullRevision( $dbw, $id, $comment, true ); - $nullRevId = $nullRevision->insertOn( $dbw ); + $nullRevision->insertOn( $dbw ); # Update restrictions table foreach( $limit as $action => $restrictions ) { @@ -2833,7 +2832,6 @@ class Article { if ( !wfReadOnly() ) { # Get templates from templatelinks - $result = array(); $id = $this->mTitle->getArticleID(); $tlTemplates = array(); diff --git a/includes/BagOStuff.php b/includes/BagOStuff.php index c720807d38..ab05ab2094 100644 --- a/includes/BagOStuff.php +++ b/includes/BagOStuff.php @@ -413,7 +413,6 @@ class MediaWikiBagOStuff extends SqlBagOStuff { return $dbw->lastError(); } function _maxdatetime() { - $dbw =& wfGetDB(DB_MASTER); if ( time() > 0x7fffffff ) { return $this->_fromunixtime( 1<<62 ); } else { diff --git a/includes/ChangesList.php b/includes/ChangesList.php index 58c01ed435..a8d3ba8a95 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -229,6 +229,7 @@ class OldChangesList extends ChangesList { wfProfileIn( $fname ); # 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? @@ -301,6 +302,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; @@ -506,6 +508,7 @@ class EnhancedChangesList extends ChangesList { $r .= '