From: Sam Reed Date: Sun, 28 Nov 2010 16:13:13 +0000 (+0000) Subject: Remove some unused variables and globals X-Git-Tag: 1.31.0-rc.0~33704 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/modifier.php?a=commitdiff_plain;h=50b04942e482c4bc6466e598f4cdc331939ee8e9;p=lhc%2Fweb%2Fwiklou.git Remove some unused variables and globals --- diff --git a/includes/StreamFile.php b/includes/StreamFile.php index ae4ca4ea84..5f460ee35c 100644 --- a/includes/StreamFile.php +++ b/includes/StreamFile.php @@ -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'; } diff --git a/includes/db/DatabaseMysql.php b/includes/db/DatabaseMysql.php index c4f0f472f8..07fcdd7311 100644 --- a/includes/db/DatabaseMysql.php +++ b/includes/db/DatabaseMysql.php @@ -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, diff --git a/includes/db/LBFactory_Multi.php b/includes/db/LBFactory_Multi.php index 78e58c70e1..3089bd7ced 100644 --- a/includes/db/LBFactory_Multi.php +++ b/includes/db/LBFactory_Multi.php @@ -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 { diff --git a/includes/parser/LinkHolderArray.php b/includes/parser/LinkHolderArray.php index d9ec72be83..01f29e010c 100644 --- a/includes/parser/LinkHolderArray.php +++ b/includes/parser/LinkHolderArray.php @@ -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']; diff --git a/includes/resourceloader/ResourceLoaderContext.php b/includes/resourceloader/ResourceLoaderContext.php index 56cd90ab53..cbd04a6dd3 100644 --- a/includes/resourceloader/ResourceLoaderContext.php +++ b/includes/resourceloader/ResourceLoaderContext.php @@ -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; diff --git a/includes/specials/SpecialBooksources.php b/includes/specials/SpecialBooksources.php index 6205a51a3f..67fb54048e 100644 --- a/includes/specials/SpecialBooksources.php +++ b/includes/specials/SpecialBooksources.php @@ -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) { diff --git a/includes/specials/SpecialPrefixindex.php b/includes/specials/SpecialPrefixindex.php index 20e67969ac..1cdf6c5b3a 100644 --- a/includes/specials/SpecialPrefixindex.php +++ b/includes/specials/SpecialPrefixindex.php @@ -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 diff --git a/includes/specials/SpecialUploadStash.php b/includes/specials/SpecialUploadStash.php index 5ae691683d..89866097b2 100644 --- a/includes/specials/SpecialUploadStash.php +++ b/includes/specials/SpecialUploadStash.php @@ -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. diff --git a/maintenance/reassignEdits.php b/maintenance/reassignEdits.php index 721605c81b..b2f1fe5c48 100644 --- a/maintenance/reassignEdits.php +++ b/maintenance/reassignEdits.php @@ -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" ); } } diff --git a/maintenance/tests/parser/parserTest.inc b/maintenance/tests/parser/parserTest.inc index 03aaa48051..3ce0f5a64d 100644 --- a/maintenance/tests/parser/parserTest.inc +++ b/maintenance/tests/parser/parserTest.inc @@ -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; diff --git a/maintenance/tests/phpunit/includes/search/SearchUpdateTest.php b/maintenance/tests/phpunit/includes/search/SearchUpdateTest.php index 00b503e0b8..108b280270 100644 --- a/maintenance/tests/phpunit/includes/search/SearchUpdateTest.php +++ b/maintenance/tests/phpunit/includes/search/SearchUpdateTest.php @@ -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; } diff --git a/maintenance/tests/phpunit/suites/UploadFromUrlTestSuite.php b/maintenance/tests/phpunit/suites/UploadFromUrlTestSuite.php index a0f2b3180f..b3063a1a26 100644 --- a/maintenance/tests/phpunit/suites/UploadFromUrlTestSuite.php +++ b/maintenance/tests/phpunit/suites/UploadFromUrlTestSuite.php @@ -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; diff --git a/maintenance/updateDoubleWidthSearch.php b/maintenance/updateDoubleWidthSearch.php index 0efc6a153e..5053d587cc 100644 --- a/maintenance/updateDoubleWidthSearch.php +++ b/maintenance/updateDoubleWidthSearch.php @@ -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' ) {