Remove some unused variables and globals
authorSam Reed <reedy@users.mediawiki.org>
Sun, 28 Nov 2010 16:13:13 +0000 (16:13 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sun, 28 Nov 2010 16:13:13 +0000 (16:13 +0000)
13 files changed:
includes/StreamFile.php
includes/db/DatabaseMysql.php
includes/db/LBFactory_Multi.php
includes/parser/LinkHolderArray.php
includes/resourceloader/ResourceLoaderContext.php
includes/specials/SpecialBooksources.php
includes/specials/SpecialPrefixindex.php
includes/specials/SpecialUploadStash.php
maintenance/reassignEdits.php
maintenance/tests/parser/parserTest.inc
maintenance/tests/phpunit/includes/search/SearchUpdateTest.php
maintenance/tests/phpunit/suites/UploadFromUrlTestSuite.php
maintenance/updateDoubleWidthSearch.php

index ae4ca4e..5f460ee 100644 (file)
@@ -96,7 +96,7 @@ function wfGetType( $filename, $safe = true ) {
        if ( $safe ) {
                global $wgFileBlacklist, $wgCheckFileExtensions, $wgStrictFileExtensions, 
                        $wgFileExtensions, $wgVerifyMimeType, $wgMimeTypeBlacklist;
-               list( $partName, $extList ) = UploadBase::splitExtensions( $filename );
+               list( , $extList ) = UploadBase::splitExtensions( $filename );
                if ( UploadBase::checkFileExtensionList( $extList, $wgFileBlacklist ) ) {
                        return 'unknown/unknown';
                }
index c4f0f47..07fcdd7 100644 (file)
@@ -52,8 +52,6 @@ class DatabaseMysql extends DatabaseBase {
                $this->mPassword = $password;
                $this->mDBname = $dbName;
 
-               $success = false;
-
                wfProfileIn("dbconnect-$server");
 
                # The kernel's default SYN retransmission period is far too slow for us,
index 78e58c7..3089bd7 100644 (file)
@@ -87,7 +87,7 @@ class LBFactory_Multi extends LBFactory {
                if ( $this->lastWiki === $wiki ) {
                        return $this->lastSection;
                }
-               list( $dbName, $prefix ) = $this->getDBNameAndPrefix( $wiki );
+               list( $dbName, ) = $this->getDBNameAndPrefix( $wiki );
                if ( isset( $this->sectionsByDB[$dbName] ) ) {
                        $section = $this->sectionsByDB[$dbName];
                } else {
index d9ec72b..01f29e0 100644 (file)
@@ -158,7 +158,7 @@ class LinkHolderArray {
                $query = false;
                $current = null;
                foreach ( $this->internals as $ns => $entries ) {
-                       foreach ( $entries as $index => $entry ) {
+                       foreach ( $entries as $entry ) {
                                $title = $entry['title'];
                                $pdbk = $entry['pdbk'];
 
index 56cd90a..cbd04a6 100644 (file)
@@ -43,7 +43,7 @@ class ResourceLoaderContext {
        /* Methods */
 
        public function __construct( ResourceLoader $resourceLoader, WebRequest $request ) {
-               global $wgLang, $wgDefaultSkin, $wgResourceLoaderDebug;
+               global $wgDefaultSkin, $wgResourceLoaderDebug;
 
                $this->resourceLoader = $resourceLoader;
                $this->request = $request;
index 6205a51..67fb540 100644 (file)
@@ -69,7 +69,6 @@ class SpecialBookSources extends SpecialPage {
        public static function isValidISBN( $isbn ) {
                $isbn = self::cleanIsbn( $isbn );
                $sum = 0;
-               $check = -1;
                if( strlen( $isbn ) == 13 ) {
                        for( $i = 0; $i < 12; $i++ ) {
                                if($i % 2 == 0) {
index 20e6796..1cdf6c5 100644 (file)
@@ -128,7 +128,7 @@ class SpecialPrefixindex extends SpecialAllpages {
                        $namespace = NS_MAIN;
                } else {
                        list( $namespace, $prefixKey, $prefix ) = $prefixList;
-                       list( /* $fromNs */, $fromKey, $from ) = $fromList;
+                       list( , $fromKey, ) = $fromList;
 
                        ### FIXME: should complain if $fromNs != $namespace
 
index 5ae6916..8986609 100644 (file)
@@ -57,9 +57,6 @@ class SpecialUploadStash extends UnlistedSpecialPage {
                // prevent callers from doing standard HTML output -- we'll take it from here
                $wgOut->disable();
 
-               $code = 500;
-               $message = 'Unknown error';
-
                if ( !isset( $subPage ) || $subPage === '' ) {
                        // the user probably visited the page just to see what would happen, so explain it a bit.
                        $code = '400';
@@ -126,7 +123,7 @@ class SpecialUploadStash extends UnlistedSpecialPage {
                                throw $e;
                        }
 
-                       list( $dummy, $width, $origKey ) = $matches;
+                       list( , $width, $origKey ) = $matches;
 
                        // do not trap exceptions, if key is in bad format, or file not found,
                        // let exceptions propagate to caller.
index 721605c..b2f1fe5 100644 (file)
@@ -101,14 +101,17 @@ class ReassignEdits extends Maintenance {
                        if ( $total ) {
                                # Reassign edits
                                $this->output( "\nReassigning current edits..." );
-                               $res = $dbw->update( 'revision', $this->userSpecification( $to, 'rev_user', 'rev_user_text' ), $this->userConditions( $from, 'rev_user', 'rev_user_text' ), __METHOD__ );
+                               $dbw->update( 'revision', $this->userSpecification( $to, 'rev_user', 'rev_user_text' ),
+                                     $this->userConditions( $from, 'rev_user', 'rev_user_text' ), __METHOD__ );
                                $this->output( "done.\nReassigning deleted edits..." );
-                               $res = $dbw->update( 'archive', $this->userSpecification( $to, 'ar_user', 'ar_user_text' ), $this->userConditions( $from, 'ar_user', 'ar_user_text' ), __METHOD__ );
+                               $dbw->update( 'archive', $this->userSpecification( $to, 'ar_user', 'ar_user_text' ),
+                              $this->userConditions( $from, 'ar_user', 'ar_user_text' ), __METHOD__ );
                                $this->output( "done.\n" );
                                # Update recent changes if required
                                if ( $rc ) {
                                        $this->output( "Updating recent changes..." );
-                                       $dbw->update( 'recentchanges', $this->userSpecification( $to, 'rc_user', 'rc_user_text' ), $this->userConditions( $from, 'rc_user', 'rc_user_text' ), __METHOD__ );
+                                       $dbw->update( 'recentchanges', $this->userSpecification( $to, 'rc_user', 'rc_user_text' ),
+                                  $this->userConditions( $from, 'rc_user', 'rc_user_text' ), __METHOD__ );
                                        $this->output( "done.\n" );
                                }
                        }
index 03aaa48..3ce0f5a 100644 (file)
@@ -120,9 +120,9 @@ class ParserTest {
        }
 
        static function setUp() {
-               global $wgParser,  $wgParserConf, $IP, $messageMemc, $wgMemc, $wgDeferredUpdateList,
+               global $wgParser,  $wgParserConf, $IP, $wgDeferredUpdateList,
                        $wgUser, $wgLang, $wgOut, $wgRequest, $wgStyleDirectory, $wgEnableParserCache,
-                       $wgMessageCache, $wgUseDatabaseMessages, $wgMsgCacheExpiry, $parserMemc,
+                       $wgMessageCache, $wgUseDatabaseMessages, $wgMsgCacheExpiry,
                        $wgNamespaceAliases, $wgNamespaceProtection, $wgLocalFileRepo,
                        $wgThumbnailScriptPath, $wgScriptPath,
                        $wgArticlePath, $wgStyleSheetPath, $wgScript, $wgStylePath;
index 00b503e..108b280 100644 (file)
@@ -28,7 +28,7 @@ class SearchUpdateTest extends PHPUnit_Framework_TestCase {
        }
 
        function updateText( $text ) {
-               list( $title, $resultText ) = $this->update( $text );
+               list( , $resultText ) = $this->update( $text );
                $resultText = trim( $resultText ); // abstract from some implementation details
                return $resultText;
        }
index a0f2b31..b3063a1 100644 (file)
@@ -14,9 +14,9 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite {
        }
 
        function setUp() {
-               global $wgParser,  $wgParserConf, $IP, $messageMemc, $wgMemc, $wgDeferredUpdateList,
+               global $wgParser, $wgParserConf, $IP, $wgDeferredUpdateList,
                                  $wgUser, $wgLang, $wgOut, $wgRequest, $wgStyleDirectory, $wgEnableParserCache,
-                                 $wgMessageCache, $wgUseDatabaseMessages, $wgMsgCacheExpiry, $parserMemc,
+                                 $wgMessageCache, $wgUseDatabaseMessages, $wgMsgCacheExpiry,
                                  $wgNamespaceAliases, $wgNamespaceProtection, $wgLocalFileRepo,
                                  $wgThumbnailScriptPath, $wgScriptPath,
                                  $wgArticlePath, $wgStyleSheetPath, $wgScript, $wgStylePath;
index 0efc6a1..5053d58 100644 (file)
@@ -39,9 +39,7 @@ class UpdateDoubleWidthSearch extends Maintenance {
        }
 
        public function execute() {
-               $quiet = $this->hasOption( 'q' );
                $maxLockTime = $this->getOption( 'l', 20 );
-               $lockTime = time();
 
                $dbw = wfGetDB( DB_MASTER );
                if ( $dbw->getType() !== 'mysql' ) {