More reversion of r77297, 2 of 2 commits to keep it readable in CR (hopefully)
authorSam Reed <reedy@users.mediawiki.org>
Thu, 25 Nov 2010 22:24:28 +0000 (22:24 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Thu, 25 Nov 2010 22:24:28 +0000 (22:24 +0000)
14 files changed:
includes/SkinTemplate.php
includes/Title.php
includes/parser/Parser.php
includes/parser/Preprocessor_DOM.php
includes/specials/SpecialComparePages.php
includes/specials/SpecialSearch.php
includes/specials/SpecialUserlogin.php
includes/upload/UploadBase.php
maintenance/dumpTextPass.php
maintenance/orphans.php
maintenance/populateCategory.php
maintenance/reassignEdits.php
maintenance/tests/phpunit/includes/UploadFromUrlTest.php
maintenance/tests/phpunit/includes/api/ApiUploadTest.php

index bd794c7..1a713fd 100644 (file)
@@ -358,7 +358,6 @@ class SkinTemplate extends Skin {
 
                        if( $wgPageShowWatchingUsers ) {
                                $dbr = wfGetDB( DB_SLAVE );
-                               $watchlist = $dbr->tableName( 'watchlist' );
                                $res = $dbr->select( 'watchlist',
                                        array( 'COUNT(*) AS n' ),
                                        array( 'wl_title' => $dbr->strencode( $this->mTitle->getDBkey() ), 'wl_namespace' => $this->mTitle->getNamespace() ),
index 5b90cfe..13ea7d9 100644 (file)
@@ -3302,7 +3302,6 @@ class Title {
                # Truncate for whole multibyte characters. +5 bytes for ellipsis
                $comment = $wgContLang->truncate( $comment, 250 );
 
-               $newid = $nt->getArticleID();
                $oldid = $this->getArticleID();
                $latest = $this->getLatestRevId();
 
index 336bdea..ae5e891 100644 (file)
@@ -789,7 +789,6 @@ class Parser {
                wfProfileIn( __METHOD__ );
                
                $lines = StringUtils::explode( "\n", $text );
-               $text = null;
                $out = '';
                $td_history = array(); # Is currently a td tag open?
                $last_tag_history = array(); # Save history of last lag activated (td, th or caption)
index 991f28c..2b635f7 100644 (file)
@@ -511,9 +511,7 @@ class Preprocessor_DOM implements Preprocessor {
                                // another heading. Infinite loops are avoided because the next iteration MUST
                                // hit the heading open case above, which unconditionally increments the
                                // input pointer.
-                       }
-
-                       elseif ( $found == 'open' ) {
+                       } elseif ( $found == 'open' ) {
                                # count opening brace characters
                                $count = strspn( $text, $curChar, $i );
 
@@ -536,9 +534,7 @@ class Preprocessor_DOM implements Preprocessor {
                                        $accum .= htmlspecialchars( str_repeat( $curChar, $count ) );
                                }
                                $i += $count;
-                       }
-
-                       elseif ( $found == 'close' ) {
+                       } elseif ( $found == 'close' ) {
                                $piece = $stack->top;
                                # lets check if there are enough characters for closing brace
                                $maxCount = $piece->count;
@@ -961,7 +957,9 @@ class PPFrame_DOM implements PPFrame {
                                $iteratorStack[$level] = false;
                        }
 
-                       if ( $contextNode instanceof PPNode_DOM ) $contextNode = $contextNode->node;
+                       if ( $contextNode instanceof PPNode_DOM ) {
+                               $contextNode = $contextNode->node;
+                       }
 
                        $newIterator = false;
 
index 8f7d024..4650fc9 100644 (file)
@@ -97,7 +97,6 @@ class SpecialComparePages extends SpecialPage {
                $this->form();
 
                if( $this->opts->getValue( 'rev1' ) && $this->opts->getValue( 'rev2' ) ) {
-                       $title = Title::newFromText( $this->opts->getValue( 'page2' ) );
                        $de = new DifferenceEngine( null,
                                $this->opts->getValue( 'rev1' ),
                                $this->opts->getValue( 'rev2' ),
index b922c6f..2a0c9ef 100644 (file)
@@ -342,9 +342,9 @@ class SpecialSearch {
                global $wgOut;
                // Figure out the active search profile header
                $nsAllSet = array_keys( SearchEngine::searchableNamespaces() );
-               if( $this->searchAdvanced )
+               if( $this->searchAdvanced ) {
                        $this->active = 'advanced';
-               else {
+               else {
                        $profiles = $this->getSearchProfiles();
                        
                        foreach( $profiles as $key => $data ) {
@@ -416,7 +416,6 @@ class SpecialSearch {
                if( !is_null($infoLine) ) {
                        $out .= "\n<!-- {$infoLine} -->\n";
                }
-               $off = $this->offset + 1;
                $out .= "<ul class='mw-search-results'>\n";
                while( $result = $matches->next() ) {
                        $out .= $this->showHit( $result, $terms );
@@ -623,7 +622,6 @@ class SpecialSearch {
 
                $out = "<div id='mw-search-interwiki'><div id='mw-search-interwiki-caption'>".
                        wfMsg('search-interwiki-caption')."</div>\n";
-               $off = $this->offset + 1;
                $out .= "<ul class='mw-search-iwresults'>\n";
 
                // work out custom project captions
index 254f27b..6c3929a 100644 (file)
@@ -176,7 +176,6 @@ class LoginForm {
                        $wgOut->addWikiMsg( 'accmailtext', $u->getName(), $u->getEmail() );
                        $wgOut->returnToMain( false );
                }
-               $u = 0;
        }
 
        /**
@@ -620,7 +619,7 @@ class LoginForm {
                }
 
                wfDebug( __METHOD__ . ": creating account\n" );
-               $user = $this->initUser( $user, true );
+               $this->initUser( $user, true );
                return self::SUCCESS;
        }
 
index e6334ff..5c970d8 100644 (file)
@@ -340,7 +340,7 @@ abstract class UploadBase {
        protected function verifyFile() {
                # get the title, even though we are doing nothing with it, because
                # we need to populate mFinalExtension 
-               $nt = $this->getTitle();
+               $this->getTitle();
                
                $this->mFileProps = File::getPropsFromPath( $this->mTempPath, $this->mFinalExtension );
                $this->checkMacBinary();
index c95d1ff..3a06cce 100644 (file)
@@ -263,7 +263,6 @@ class TextPassDumper extends BackupDumper {
                while ( true ) {
                        try {
                                $text = $this->getTextDb( $id );
-                               $ex = new MWException( "Graceful storage failure" );
                        } catch ( DBQueryError $ex ) {
                                $text = false;
                        }
index 4a9a650..7294080 100644 (file)
@@ -165,7 +165,6 @@ class Orphans extends Maintenance {
                $dbw = wfGetDB( DB_MASTER );
                $page     = $dbw->tableName( 'page' );
                $revision = $dbw->tableName( 'revision' );
-               $text     = $dbw->tableName( 'text' );
        
                if ( $fix ) {
                        $dbw->lockTables( $dbw, 'text', __METHOD__ );
index 30cea73..3b3101a 100644 (file)
@@ -66,7 +66,6 @@ TEXT;
        
                $maxlag = intval( $maxlag );
                $throttle = intval( $throttle );
-               $force = (bool)$force;
                if ( $begin !== '' ) {
                        $where = 'cl_to > ' . $dbw->addQuotes( $begin );
                } else {
index e59c654..721605c 100644 (file)
@@ -108,7 +108,7 @@ class ReassignEdits extends Maintenance {
                                # Update recent changes if required
                                if ( $rc ) {
                                        $this->output( "Updating recent changes..." );
-                                       $res = $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 32678d6..6c4a410 100644 (file)
@@ -133,7 +133,6 @@ class UploadFromUrlTest extends ApiTestSetup {
                $this->assertTrue( $exception, "Got exception" );
 
                self::$user->addGroup( 'sysop' );
-               $exception = false;
                $data = $this->doApiRequest( array(
                        'action' => 'upload',
                        'url' => 'http://bits.wikimedia.org/skins-1.5/common/images/poweredby_mediawiki_88x31.png',
index 9635c47..f213dcc 100644 (file)
@@ -303,7 +303,6 @@ class ApiUploadTest extends ApiTestCase {
                global $wgUser;
                $wgUser = self::$users['uploader']->user;
 
-               $extension = 'png';
                $mimeType = 'image/png';
 
                $filePath = tempnam( wfTempDir(), "" );
@@ -617,7 +616,7 @@ class ApiUploadTest extends ApiTestCase {
                $hash = File::sha1Base36( $filePath );
                $dupes = RepoGroup::singleton()->findBySha1( $hash );
                $success = true;
-               foreach ( $dupes as $key => $dupe ) {
+               foreach ( $dupes as $dupe ) {
                        $success &= $this->deleteFileByTitle( $dupe->getTitle() );
                }
                return $success;