Remove some unused variables and globals
This commit is contained in:
parent
ea0946c3bf
commit
50b04942e4
13 changed files with 17 additions and 22 deletions
|
|
@ -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';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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'];
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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" );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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' ) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue