Cleanup a few unused variables
authorSam Reed <reedy@users.mediawiki.org>
Sun, 1 Jan 2012 23:35:08 +0000 (23:35 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sun, 1 Jan 2012 23:35:08 +0000 (23:35 +0000)
Mainly indexes in foreach loops

includes/EditPage.php
includes/filerepo/backend/FSFileBackend.php
includes/filerepo/backend/FileBackend.php
includes/filerepo/backend/FileBackendMultiWrite.php
includes/filerepo/backend/lockmanager/LSLockManager.php
includes/specials/SpecialDeletedContributions.php

index cd6c6ca..c895048 100644 (file)
@@ -1818,7 +1818,6 @@ class EditPage {
                        }
 
                        if ( $this->section != '' && $this->section != 'new' ) {
-                               $matches = array();
                                if ( !$this->summary && !$this->preview && !$this->diff ) {
                                        $sectionTitle = self::extractSectionTitle( $this->textbox1 );
                                        if ( $sectionTitle !== false ) {
index eccc1cf..d6da45e 100644 (file)
@@ -26,7 +26,7 @@ class FSFileBackend extends FileBackend {
        function __construct( array $config ) {
                parent::__construct( $config );
                $this->containerPaths = (array)$config['containerPaths'];
-               foreach ( $this->containerPaths as $container => &$path ) {
+               foreach ( $this->containerPaths as &$path ) {
                        if ( substr( $path, -1 ) === '/' ) {
                                $path = substr( $path, 0, -1 ); // remove trailing slash
                        }
index c3c8141..053662b 100644 (file)
@@ -813,7 +813,7 @@ abstract class FileBackend extends FileBackendBase {
                if ( empty( $opts['nonLocking'] ) ) {
                        // Build up a list of files to lock...
                        $filesLockEx = $filesLockSh = array();
-                       foreach ( $performOps as $index => $fileOp ) {
+                       foreach ( $performOps as $fileOp ) {
                                $filesLockSh = array_merge( $filesLockSh, $fileOp->storagePathsRead() );
                                $filesLockEx = array_merge( $filesLockEx, $fileOp->storagePathsChanged() );
                        }
index 58225fd..114424c 100644 (file)
@@ -83,7 +83,7 @@ class FileBackendMultiWrite extends FileBackendBase {
                                // Set "files to lock" from the first batch so we don't try to set all
                                // locks two or three times over (depending on the number of backends).
                                // A lock on one storage path is a lock on all the backends.
-                               foreach ( $performOps as $index => $fileOp ) {
+                               foreach ( $performOps as $fileOp ) {
                                        $filesLockSh = array_merge( $filesLockSh, $fileOp->storagePathsRead() );
                                        $filesLockEx = array_merge( $filesLockEx, $fileOp->storagePathsChanged() );
                                }
@@ -297,7 +297,7 @@ class FileBackendMultiWrite extends FileBackendBase {
         * @see FileBackendBase::getFileList()
         */
        function getFileList( array $params ) {
-               foreach ( $this->backends as $index => $backend ) {
+               foreach ( $this->backends as $backend ) {
                        # Get results from the first backend
                        $realParams = $this->substOpPaths( $params, $backend );
                        return $backend->getFileList( $realParams );
index 5ae51b1..45ccaae 100644 (file)
@@ -207,7 +207,7 @@ class LSLockManager extends LockManager {
                $votesLeft = count( $this->srvsByBucket[$bucket] ); // remaining peers
                $quorum = floor( $votesLeft/2 + 1 ); // simple majority
                // Get votes for each peer, in order, until we have enough...
-               foreach ( $this->srvsByBucket[$bucket] as $index => $lockSrv ) {
+               foreach ( $this->srvsByBucket[$bucket] as $lockSrv ) {
                        // Attempt to acquire the lock on this peer
                        if ( !$this->doLockingRequest( $lockSrv, $paths, $type ) ) {
                                return 'cantacquire'; // vetoed; resource locked
@@ -284,7 +284,7 @@ class LSLockManager extends LockManager {
         */
        function __destruct() {
                $this->releaseLocks();
-               foreach ( $this->conns as $lockSrv => $conn ) {
+               foreach ( $this->conns as $conn ) {
                        fclose( $conn );
                }
        }
index 5e30efc..8208844 100644 (file)
@@ -293,8 +293,6 @@ class DeletedContributionsPage extends SpecialPage {
                        $out->addHTML( $this->getForm( '' ) );
                        return;
                }
-               $nt = $userObj->getUserPage();
-               $id = $userObj->getID();
 
                $target = $userObj->getName();
                $out->addSubtitle( $this->getSubTitle( $userObj ) );