From: Sam Reed Date: Sat, 24 Jul 2010 19:11:52 +0000 (+0000) Subject: Removal of unused globals X-Git-Tag: 1.31.0-rc.0~35971 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=04f68827d0e3e53ba2924ff7e9f67f6a7e485656;p=lhc%2Fweb%2Fwiklou.git Removal of unused globals Removal of one setting of a variable to '', then not using further --- diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index 5762331143..447a141207 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -85,7 +85,7 @@ class CategoryViewer { * @private */ function getHTML() { - global $wgOut, $wgCategoryMagicGallery, $wgCategoryPagingLimit, $wgContLang; + global $wgOut, $wgCategoryMagicGallery, $wgContLang; wfProfileIn( __METHOD__ ); $this->showGallery = $wgCategoryMagicGallery && !$wgOut->mNoGallery; diff --git a/includes/ChangesFeed.php b/includes/ChangesFeed.php index 4a5a2d16d2..5e0ebb163a 100644 --- a/includes/ChangesFeed.php +++ b/includes/ChangesFeed.php @@ -45,8 +45,7 @@ class ChangesFeed { * @return null or true */ public function execute( $feed, $rows, $lastmod, $opts ) { - global $messageMemc, $wgFeedCacheTimeout; - global $wgSitename, $wgLang, $wgRenderHashAppend; + global $wgLang, $wgRenderHashAppend; if ( !FeedUtils::checkFeedOutput( $this->format ) ) { return; diff --git a/includes/EditPage.php b/includes/EditPage.php index 2cc94d54b3..ab60acb8e2 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -765,7 +765,7 @@ class EditPage { * @return one of the constants describing the result */ function internalAttemptSave( &$result, $bot = false ) { - global $wgFilterCallback, $wgUser, $wgOut, $wgParser; + global $wgFilterCallback, $wgUser, $wgParser; global $wgMaxArticleSize; wfProfileIn( __METHOD__ ); @@ -1848,7 +1848,7 @@ INPUTS * @return string */ function getPreviewText() { - global $wgOut, $wgUser, $wgTitle, $wgParser, $wgLang, $wgContLang, $wgMessageCache; + global $wgOut, $wgUser, $wgParser, $wgMessageCache; wfProfileIn( __METHOD__ ); diff --git a/includes/Exception.php b/includes/Exception.php index ddcd739152..fe60fa32b5 100644 --- a/includes/Exception.php +++ b/includes/Exception.php @@ -197,7 +197,7 @@ class MWException extends Exception { * $wgOut to output the exception. */ function htmlHeader() { - global $wgLogo, $wgSitename, $wgOutputEncoding; + global $wgLogo, $wgOutputEncoding; if ( !headers_sent() ) { header( 'HTTP/1.0 500 Internal Server Error' ); diff --git a/includes/FileRevertForm.php b/includes/FileRevertForm.php index eb16693a02..29027345f5 100644 --- a/includes/FileRevertForm.php +++ b/includes/FileRevertForm.php @@ -88,7 +88,7 @@ class FileRevertForm { * Show the confirmation form */ protected function showForm() { - global $wgOut, $wgUser, $wgRequest, $wgLang, $wgContLang; + global $wgOut, $wgUser, $wgLang, $wgContLang; $timestamp = $this->getTimestamp(); $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getAction() ) ); diff --git a/includes/ForkController.php b/includes/ForkController.php index 7b8892285d..e5b44c2b50 100644 --- a/includes/ForkController.php +++ b/includes/ForkController.php @@ -126,8 +126,6 @@ class ForkController { * Fork a number of worker processes. */ protected function forkWorkers( $numProcs ) { - global $wgMemc, $wgCaches, $wgMainCacheType; - $this->prepareEnvironment(); // Create the child processes diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index ea3bf6e343..d0c3a42d17 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -704,7 +704,7 @@ function wfMsgWeirdKey( $key ) { * @return string */ function wfMsgGetKey( $key, $useDB, $langCode = false, $transform = true ) { - global $wgContLang, $wgMessageCache; + global $wgMessageCache; wfRunHooks('NormalizeMessageKey', array(&$key, &$useDB, &$langCode, &$transform)); @@ -2060,7 +2060,7 @@ function wfGetNamespaceNotice() { } function wfGetSiteNotice() { - global $wgUser, $wgSiteNotice; + global $wgUser; $fname = 'wfGetSiteNotice'; wfProfileIn( $fname ); $siteNotice = ''; diff --git a/includes/HTMLFileCache.php b/includes/HTMLFileCache.php index 1e1ba0d72d..8990fd9510 100644 --- a/includes/HTMLFileCache.php +++ b/includes/HTMLFileCache.php @@ -30,7 +30,7 @@ class HTMLFileCache { public function fileCacheName() { if( !$this->mFileCache ) { - global $wgCacheDirectory, $wgFileCacheDirectory, $wgRequest; + global $wgCacheDirectory, $wgFileCacheDirectory; if ( $wgFileCacheDirectory ) { $dir = $wgFileCacheDirectory; diff --git a/includes/Html.php b/includes/Html.php index e2bf59dd23..f3884899ef 100644 --- a/includes/Html.php +++ b/includes/Html.php @@ -595,7 +595,7 @@ class Html { $ret .= "\n"; } - global $wgHtml5, $wgHtml5Version, $wgWellFormedXml, $wgDocType, $wgDTD; + global $wgHtml5, $wgHtml5Version, $wgDocType, $wgDTD; global $wgXhtmlNamespaces, $wgXhtmlDefaultNamespace; if ( $wgHtml5 ) { $ret .= "\n"; diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 1e787397d0..c278070f33 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -143,7 +143,6 @@ class ImagePage extends Article { $wgOut->addHTML( $html ); if ( $showmeta ) { - global $wgStylePath, $wgStyleVersion; $expand = htmlspecialchars( Xml::escapeJsString( wfMsg( 'metadata-expand' ) ) ); $collapse = htmlspecialchars( Xml::escapeJsString( wfMsg( 'metadata-collapse' ) ) ); $wgOut->addHTML( Xml::element( 'h2', array( 'id' => 'metadata' ), wfMsg( 'metadata' ) ) . "\n" ); @@ -880,7 +879,7 @@ class ImageHistoryList { } public function imageHistoryLine( $iscur, $file ) { - global $wgUser, $wgLang, $wgContLang; + global $wgUser, $wgLang; $timestamp = wfTimestamp( TS_MW, $file->getTimestamp() ); $img = $iscur ? $file->getName() : $file->getArchiveName(); diff --git a/includes/LinkCache.php b/includes/LinkCache.php index 4b6f964414..dce345926b 100644 --- a/includes/LinkCache.php +++ b/includes/LinkCache.php @@ -132,7 +132,7 @@ class LinkCache { * @return Integer */ public function addLinkObj( $nt ) { - global $wgAntiLockFlags, $wgProfiler; + global $wgAntiLockFlags; wfProfileIn( __METHOD__ ); $key = $nt->getPrefixedDBkey(); diff --git a/includes/Linker.php b/includes/Linker.php index ebe0401df9..008b9b8668 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -583,7 +583,7 @@ class Linker { } function makeThumbLink2( Title $title, $file, $frameParams = array(), $handlerParams = array(), $time = false, $query = "" ) { - global $wgStylePath, $wgContLang; + global $wgStylePath; $exists = $file && $file->exists(); # Shortcuts diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index 599ef5cd9e..9a58362856 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -357,7 +357,7 @@ class LogEventsList { // @TODO: split up! private function logActionLinks( $row, $title, $paramArray, &$comment ) { - global $wgUser, $wgLang; + global $wgUser; if( ( $this->flags & self::NO_ACTION_LINK ) // we don't want to see the action || self::isDeleted( $row, LogPage::DELETED_ACTION ) ) // action is hidden { @@ -913,7 +913,6 @@ class LogPager extends ReverseChronologicalPager { } public function getQueryInfo() { - global $wgOut; $tables = array( 'logging', 'user' ); $this->mConds[] = 'user_id = log_user'; $index = array(); diff --git a/includes/MagicWord.php b/includes/MagicWord.php index d05bf19da2..dfc3e4f698 100644 --- a/includes/MagicWord.php +++ b/includes/MagicWord.php @@ -514,7 +514,6 @@ class MagicWordArray { * Add a magic word by name */ public function add( $name ) { - global $wgContLang; $this->names[] = $name; $this->hash = $this->baseRegex = $this->regex = null; } @@ -657,7 +656,6 @@ class MagicWordArray { * Both elements are false if there was no match. */ public function matchVariableStartToEnd( $text ) { - global $wgContLang; $regexes = $this->getVariableStartToEndRegex(); foreach ( $regexes as $regex ) { if ( $regex !== '' ) { diff --git a/includes/Metadata.php b/includes/Metadata.php index 3f95954709..f3b32e09f4 100644 --- a/includes/Metadata.php +++ b/includes/Metadata.php @@ -115,8 +115,6 @@ abstract class RdfMetaData { } protected function person($name, User $user ){ - global $wgContLang; - if( $user->isAnon() ){ $this->element( $name, wfMsgExt( 'anonymous', array( 'parsemag' ), 1 ) ); } else if( $real = $user->getRealName() ) { diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 7654025e0e..a9ea83b2d6 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2090,8 +2090,8 @@ class OutputPage { * @return String: The doctype, opening , and head element. */ public function headElement( Skin $sk, $includeStyle = true ) { - global $wgContLanguageCode, $wgOutputEncoding, $wgMimeType; - global $wgContLang, $wgUseTrackbacks, $wgStyleVersion, $wgHtml5; + global $wgOutputEncoding, $wgMimeType; + global $wgUseTrackbacks, $wgHtml5; global $wgUser, $wgRequest, $wgLang; if ( $sk->commonPrintStylesheet() ) { diff --git a/includes/Preferences.php b/includes/Preferences.php index d10a406e24..bd7511a9b3 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -35,8 +35,6 @@ class Preferences { if ( self::$defaultPreferences ) return self::$defaultPreferences; - global $wgRCMaxAge; - $defaultPreferences = array(); self::profilePreferences( $user, $defaultPreferences ); @@ -62,7 +60,6 @@ class Preferences { } ## Prod in defaults from the user - global $wgDefaultUserOptions; foreach ( $defaultPreferences as $name => &$info ) { $prefFromUser = self::getOptionFromUser( $name, $info, $user ); $field = HTMLForm::loadInputFromParameters( $info ); // For validation diff --git a/includes/ProfilerSimpleText.php b/includes/ProfilerSimpleText.php index caca94b1a3..db4b6053c2 100644 --- a/includes/ProfilerSimpleText.php +++ b/includes/ProfilerSimpleText.php @@ -22,8 +22,6 @@ class ProfilerSimpleText extends ProfilerSimple { static private $out; function getFunctionReport() { - global $wgRequest, $wgOut; - if($this->mTemplated) { uasort($this->mCollated,array('self','sort')); array_walk($this->mCollated,array('self','format')); diff --git a/includes/RawPage.php b/includes/RawPage.php index 8e515af316..1d1b9d0d23 100644 --- a/includes/RawPage.php +++ b/includes/RawPage.php @@ -109,7 +109,7 @@ class RawPage { } function view() { - global $wgOut, $wgScript, $wgRequest; + global $wgOut, $wgRequest; if( $wgRequest->isPathInfoBad() ) { # Internet Explorer will ignore the Content-Type header if it @@ -158,7 +158,7 @@ class RawPage { } function getRawText() { - global $wgUser, $wgOut, $wgRequest; + global $wgUser, $wgOut; if( $this->mGen ) { $sk = $wgUser->getSkin(); if( !StubObject::isRealObject( $wgOut ) ) diff --git a/includes/Skin.php b/includes/Skin.php index 001f67f569..a50d3f9de4 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -372,7 +372,7 @@ class Skin extends Linker { global $wgUseAjax, $wgAjaxWatch; global $wgVersion, $wgEnableAPI, $wgEnableWriteAPI; global $wgRestrictionTypes; - global $wgMWSuggestTemplate, $wgDBname, $wgEnableMWSuggest; + global $wgDBname, $wgEnableMWSuggest; global $wgSitename; $ns = $wgTitle->getNamespace(); @@ -597,8 +597,8 @@ CSS; * @private */ function setupUserCss( OutputPage $out ) { - global $wgRequest, $wgContLang, $wgUser; - global $wgAllowUserCss, $wgUseSiteCss, $wgSquidMaxage, $wgStylePath; + global $wgRequest, $wgUser; + global $wgAllowUserCss, $wgUseSiteCss, $wgSquidMaxage; wfProfileIn( __METHOD__ ); @@ -1088,7 +1088,7 @@ CSS; } function getUndeleteLink() { - global $wgUser, $wgContLang, $wgLang, $wgRequest; + global $wgUser, $wgLang, $wgRequest; $action = $wgRequest->getVal( 'action', 'view' ); @@ -1609,7 +1609,7 @@ CSS; * Show a drop-down box of special pages */ function specialPagesList() { - global $wgUser, $wgContLang, $wgServer, $wgRedirectScript; + global $wgContLang, $wgServer, $wgRedirectScript; $pages = array_merge( SpecialPage::getRegularPages(), SpecialPage::getRestrictedPages() ); foreach ( $pages as $name => $page ) { $pages[$name] = $page->getDescription(); diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index b1ea8f6b84..e14674bda9 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -875,7 +875,7 @@ class SkinTemplate extends Skin { */ function buildNavUrls() { global $wgUseTrackbacks, $wgOut, $wgUser, $wgRequest; - global $wgEnableUploads, $wgUploadNavigationUrl; + global $wgUploadNavigationUrl; wfProfileIn( __METHOD__ ); diff --git a/includes/StreamFile.php b/includes/StreamFile.php index 6db66ba84e..32022edf69 100644 --- a/includes/StreamFile.php +++ b/includes/StreamFile.php @@ -91,7 +91,7 @@ function wfGetType( $filename, $safe = true ) { */ if ( $safe ) { global $wgFileBlacklist, $wgCheckFileExtensions, $wgStrictFileExtensions, - $wgFileExtensions, $wgVerifyMimeType, $wgMimeTypeBlacklist, $wgRequest; + $wgFileExtensions, $wgVerifyMimeType, $wgMimeTypeBlacklist; list( $partName, $extList ) = UploadBase::splitExtensions( $filename ); if ( UploadBase::checkFileExtensionList( $extList, $wgFileBlacklist ) ) { return 'unknown/unknown'; diff --git a/includes/Title.php b/includes/Title.php index 9d2f4c9abe..be1ec8f6fc 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -789,7 +789,7 @@ class Title { * @return \type{\string} the URL */ public function getFullURL( $query = '', $variant = false ) { - global $wgContLang, $wgServer, $wgRequest; + global $wgServer, $wgRequest; if ( is_array( $query ) ) { $query = wfArrayToCGI( $query ); @@ -3230,7 +3230,7 @@ class Title { * Ignored if the user doesn't have the suppressredirect right */ private function moveToNewTitle( &$nt, $reason = '', $createRedirect = true ) { - global $wgUseSquid, $wgUser, $wgContLang; + global $wgUser, $wgContLang; $comment = wfMsgForContent( '1movedto2', $this->getPrefixedText(), $nt->getPrefixedText() ); if ( $reason ) { @@ -4042,8 +4042,7 @@ class Title { * @return Boolean */ public function canUseNoindex() { - global $wgArticleRobotPolicies, $wgContentNamespaces, - $wgExemptFromUserRobotsControl; + global $wgContentNamespaces, $wgExemptFromUserRobotsControl; $bannedNamespaces = is_null( $wgExemptFromUserRobotsControl ) ? $wgContentNamespaces diff --git a/includes/User.php b/includes/User.php index 22f9f6f3e1..558aabb193 100644 --- a/includes/User.php +++ b/includes/User.php @@ -859,7 +859,7 @@ class User { * @return \bool True if the user is logged in, false otherwise. */ private function loadFromSession() { - global $wgMemc, $wgCookiePrefix, $wgExternalAuthType, $wgAutocreatePolicy; + global $wgCookiePrefix, $wgExternalAuthType, $wgAutocreatePolicy; $result = null; wfRunHooks( 'UserLoadFromSession', array( $this, &$result ) ); diff --git a/includes/UserMailer.php b/includes/UserMailer.php index b3516015c9..14470454c2 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -359,7 +359,6 @@ class EmailNotification { # we use $wgPasswordSender as sender's address global $wgEnotifWatchlist; global $wgEnotifMinorEdits, $wgEnotifUserTalk; - global $wgEnotifImpersonal; wfProfileIn( __METHOD__ ); diff --git a/includes/UserRightsProxy.php b/includes/UserRightsProxy.php index 0d6b815117..6ecfeda185 100644 --- a/includes/UserRightsProxy.php +++ b/includes/UserRightsProxy.php @@ -105,7 +105,7 @@ class UserRightsProxy { * @return DatabaseBase or null if invalid selection */ public static function getDB( $database ) { - global $wgLocalDatabases, $wgDBname; + global $wgDBname; if( self::validDatabase( $database ) ) { if( $database == $wgDBname ) { // Hmm... this shouldn't happen though. :) diff --git a/includes/WikiMap.php b/includes/WikiMap.php index 878e165fb5..0fe12f86bb 100644 --- a/includes/WikiMap.php +++ b/includes/WikiMap.php @@ -12,7 +12,7 @@ class WikiMap { * @return WikiReference object or null if the wiki was not found */ public static function getWiki( $wikiID ) { - global $wgConf, $IP; + global $wgConf; $wgConf->loadFullData(); diff --git a/includes/db/Database.php b/includes/db/Database.php index 19a6b39884..6c065b8205 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -554,7 +554,6 @@ abstract class DatabaseBase { * @param $tempIgnore Boolean */ function reportQueryError( $error, $errno, $sql, $fname, $tempIgnore = false ) { - global $wgCommandLineMode; # Ignore errors during error handling to avoid infinite recursion $ignore = $this->ignoreErrors( true ); ++$this->mErrorCount; diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php index f07a2a5c86..3866b1ef09 100644 --- a/includes/db/DatabaseOracle.php +++ b/includes/db/DatabaseOracle.php @@ -992,8 +992,6 @@ class DatabaseOracle extends DatabaseBase { } function setup_database() { - global $wgVersion, $wgDBmwschema, $wgDBts2schema, $wgDBport, $wgDBuser; - $res = $this->sourceFile( "../maintenance/ora/tables.sql" ); if ($res === true) { print " done.\n"; diff --git a/includes/db/LoadBalancer.php b/includes/db/LoadBalancer.php index dcc531661b..c4f31e8ba2 100644 --- a/includes/db/LoadBalancer.php +++ b/includes/db/LoadBalancer.php @@ -403,7 +403,6 @@ class LoadBalancer { * @param $wiki String: wiki ID */ public function &getConnection( $i, $groups = array(), $wiki = false ) { - global $wgDBtype; wfProfileIn( __METHOD__ ); if ( $i == DB_LAST ) { diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index 323a631058..6b85dd6b56 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -258,7 +258,6 @@ abstract class FileRepo { * Get the name of an image from its title object */ function getNameFromTitle( $title ) { - global $wgCapitalLinks; if ( $this->initialCapital != MWNamespace::isCapitalized( NS_FILE ) ) { global $wgContLang; $name = $title->getUserCaseDBKey(); diff --git a/includes/installer/CoreInstaller.php b/includes/installer/CoreInstaller.php index ee514bbc09..2474453eb4 100644 --- a/includes/installer/CoreInstaller.php +++ b/includes/installer/CoreInstaller.php @@ -275,8 +275,6 @@ abstract class CoreInstaller extends Installer { * @return Status */ public function installExtensions() { - global $wgHooks, $wgAutoloadClasses; - $exts = $this->getVar( '_Extensions' ); $path = $this->getVar( 'IP' ) . '/extensions'; diff --git a/includes/installer/SqliteInstaller.php b/includes/installer/SqliteInstaller.php index f9776999b7..fe7f5c2b5b 100644 --- a/includes/installer/SqliteInstaller.php +++ b/includes/installer/SqliteInstaller.php @@ -36,7 +36,6 @@ class SqliteInstaller extends DatabaseInstaller { } public function submitConnectForm() { - global $wgSQLiteDataDir; $this->setVarsFromRequest( array( 'wgSQLiteDataDir', 'wgDBname' ) ); $dir = realpath( $this->getVar( 'wgSQLiteDataDir' ) ); diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index ca0087bff9..0645e8ae3b 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -3496,8 +3496,6 @@ class Parser { * @param $frame PPFrame */ function extensionSubstitution( $params, $frame ) { - global $wgRawHtml, $wgContLang; - $name = $frame->expand( $params['name'] ); $attrText = !isset( $params['attr'] ) ? null : $frame->expand( $params['attr'] ); $content = !isset( $params['inner'] ) ? null : $frame->expand( $params['inner'] ); diff --git a/includes/search/SearchEngine.php b/includes/search/SearchEngine.php index f7e2e1757d..a62104f68a 100644 --- a/includes/search/SearchEngine.php +++ b/includes/search/SearchEngine.php @@ -857,7 +857,7 @@ class SearchHighlighter { * @return String */ public function highlightText( $text, $terms, $contextlines, $contextchars ) { - global $wgLang, $wgContLang; + global $wgContLang; global $wgSearchHighlightBoundaries; $fname = __METHOD__; @@ -1131,8 +1131,6 @@ class SearchHighlighter { * @return String */ function extract( $text, $start, $end, &$posStart = null, &$posEnd = null ) { - global $wgContLang; - if ( $start != 0 ) $start = $this->position( $text, $start, 1 ); if ( $end >= strlen( $text ) ) @@ -1283,7 +1281,7 @@ class SearchHighlighter { * @return String */ public function highlightSimple( $text, $terms, $contextlines, $contextchars ) { - global $wgLang, $wgContLang; + global $wgContLang; $fname = __METHOD__; $lines = explode( "\n", $text ); diff --git a/includes/specials/SpecialActiveusers.php b/includes/specials/SpecialActiveusers.php index 80db3680da..ded22da8c2 100644 --- a/includes/specials/SpecialActiveusers.php +++ b/includes/specials/SpecialActiveusers.php @@ -126,7 +126,7 @@ class ActiveUsersPager extends UsersPager { } function getPageHeader() { - global $wgScript, $wgRequest; + global $wgScript; $self = $this->getTitle(); $limit = $this->mLimit ? Xml::hidden( 'limit', $this->mLimit ) : ''; diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 4c468c7696..d960791700 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -30,7 +30,7 @@ class SpecialContributions extends SpecialPage { } public function execute( $par ) { - global $wgUser, $wgOut, $wgLang, $wgRequest; + global $wgUser, $wgOut, $wgRequest; $this->setHeaders(); $this->outputHeader(); @@ -380,7 +380,7 @@ class SpecialContributions extends SpecialPage { * @param $type String */ protected function feed( $type ) { - global $wgRequest, $wgFeed, $wgFeedClasses, $wgFeedLimit; + global $wgFeed, $wgFeedClasses, $wgFeedLimit; if( !$wgFeed ) { global $wgOut; diff --git a/includes/specials/SpecialDeletedContributions.php b/includes/specials/SpecialDeletedContributions.php index 2bf450fe2d..7d17fb1c78 100644 --- a/includes/specials/SpecialDeletedContributions.php +++ b/includes/specials/SpecialDeletedContributions.php @@ -276,7 +276,7 @@ class DeletedContributionsPage extends SpecialPage { return; } - global $wgOut, $wgLang, $wgRequest; + global $wgOut, $wgRequest; $wgOut->setPageTitle( wfMsgExt( 'deletedcontributions-title', array( 'parsemag' ) ) ); @@ -463,7 +463,7 @@ class DeletedContributionsPage extends SpecialPage { * @param $options Array: the options to be included. */ function getForm( $options ) { - global $wgScript, $wgRequest; + global $wgScript; $options['title'] = SpecialPage::getTitleFor( 'DeletedContributions' )->getPrefixedText(); if ( !isset( $options['target'] ) ) { diff --git a/includes/specials/SpecialEmailuser.php b/includes/specials/SpecialEmailuser.php index ff524efcc8..0e4a55d7d6 100644 --- a/includes/specials/SpecialEmailuser.php +++ b/includes/specials/SpecialEmailuser.php @@ -217,7 +217,7 @@ class SpecialEmailUser extends UnlistedSpecialPage { * @return Mixed: True on success, String on error */ public static function submit( $data ) { - global $wgUser, $wgUserEmailUseReplyTo, $wgSiteName; + global $wgUser, $wgUserEmailUseReplyTo; $target = self::getTarget( $data['Target'] ); if( !$target instanceof User ){ diff --git a/includes/specials/SpecialExport.php b/includes/specials/SpecialExport.php index bc470d07a7..be9fecbe01 100644 --- a/includes/specials/SpecialExport.php +++ b/includes/specials/SpecialExport.php @@ -194,8 +194,6 @@ class SpecialExport extends SpecialPage { * not returning full history) */ private function doExport( $page, $history, $list_authors ) { - global $wgExportMaxHistory; - $pageSet = array(); // Inverted index of all pages to look up // Split up and normalize input @@ -347,7 +345,7 @@ class SpecialExport extends SpecialPage { * Validate link depth setting, if available. */ private function validateLinkDepth( $depth ) { - global $wgExportMaxLinkDepth, $wgExportMaxLinkDepthLimit; + global $wgExportMaxLinkDepth; if( $depth < 0 ) { return 0; } diff --git a/includes/specials/SpecialImport.php b/includes/specials/SpecialImport.php index d562fa47ee..fa976f6b6f 100644 --- a/includes/specials/SpecialImport.php +++ b/includes/specials/SpecialImport.php @@ -132,7 +132,7 @@ class SpecialImport extends SpecialPage { } private function showForm() { - global $wgUser, $wgOut, $wgRequest, $wgImportSources, $wgExportMaxLinkDepth; + global $wgUser, $wgOut, $wgImportSources, $wgExportMaxLinkDepth; if( !$wgUser->isAllowed( 'import' ) && !$wgUser->isAllowed( 'importupload' ) ) return $wgOut->permissionRequired( 'import' ); diff --git a/includes/specials/SpecialIpblocklist.php b/includes/specials/SpecialIpblocklist.php index bed2ddb36c..7e89d341a0 100644 --- a/includes/specials/SpecialIpblocklist.php +++ b/includes/specials/SpecialIpblocklist.php @@ -362,7 +362,7 @@ class IPUnblockForm extends SpecialPage { } function searchForm() { - global $wgScript, $wgRequest, $wgLang; + global $wgScript, $wgLang; $showhide = array( wfMsg( 'show' ), wfMsg( 'hide' ) ); $nondefaults = array(); diff --git a/includes/specials/SpecialLinkSearch.php b/includes/specials/SpecialLinkSearch.php index 5ffe8929cf..ef0e2c28e8 100644 --- a/includes/specials/SpecialLinkSearch.php +++ b/includes/specials/SpecialLinkSearch.php @@ -31,7 +31,7 @@ function wfSpecialLinkSearch( $par ) { list( $limit, $offset ) = wfCheckLimits(); - global $wgOut, $wgRequest, $wgUrlProtocols, $wgMiserMode, $wgLang; + global $wgOut, $wgUrlProtocols, $wgMiserMode, $wgLang; $target = $GLOBALS['wgRequest']->getVal( 'target', $par ); $namespace = $GLOBALS['wgRequest']->getIntorNull( 'namespace', null ); diff --git a/includes/specials/SpecialListusers.php b/includes/specials/SpecialListusers.php index 0bf1884380..8dc1a9dd75 100644 --- a/includes/specials/SpecialListusers.php +++ b/includes/specials/SpecialListusers.php @@ -176,7 +176,7 @@ class UsersPager extends AlphabeticPager { } function getPageHeader( ) { - global $wgScript, $wgRequest; + global $wgScript; $self = $this->getTitle(); # Form tag @@ -270,7 +270,7 @@ class UsersPager extends AlphabeticPager { * $par string (optional) A group to list users from */ function wfSpecialListusers( $par = null ) { - global $wgRequest, $wgOut; + global $wgOut; $up = new UsersPager($par); diff --git a/includes/specials/SpecialMergeHistory.php b/includes/specials/SpecialMergeHistory.php index b5817f896a..75935ec232 100644 --- a/includes/specials/SpecialMergeHistory.php +++ b/includes/specials/SpecialMergeHistory.php @@ -157,7 +157,7 @@ class SpecialMergeHistory extends SpecialPage { } private function showHistory() { - global $wgLang, $wgUser, $wgOut; + global $wgUser, $wgOut; $this->sk = $wgUser->getSkin(); diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index 030f7442c8..51c84de838 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -347,7 +347,7 @@ class MovePageForm { } function doSubmit() { - global $wgOut, $wgUser, $wgRequest, $wgMaximumMovedPages, $wgLang; + global $wgOut, $wgUser, $wgMaximumMovedPages, $wgLang; global $wgFixDoubleRedirects; if ( $wgUser->pingLimiter( 'move' ) ) { diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php index 7f755a8dce..125a8b20d6 100644 --- a/includes/specials/SpecialNewpages.php +++ b/includes/specials/SpecialNewpages.php @@ -105,7 +105,7 @@ class SpecialNewpages extends IncludableSpecialPage { * @return String */ public function execute( $par ) { - global $wgLang, $wgOut; + global $wgOut; $this->setHeaders(); $this->outputHeader(); diff --git a/includes/specials/SpecialProtectedtitles.php b/includes/specials/SpecialProtectedtitles.php index 2952dc27cb..9330ac35ec 100644 --- a/includes/specials/SpecialProtectedtitles.php +++ b/includes/specials/SpecialProtectedtitles.php @@ -69,7 +69,7 @@ class ProtectedTitlesForm { * Callback function to output a restriction */ function formatRow( $row ) { - global $wgUser, $wgLang, $wgContLang; + global $wgUser, $wgLang; wfProfileIn( __METHOD__ ); diff --git a/includes/specials/SpecialRevisionMove.php b/includes/specials/SpecialRevisionMove.php index 3972af354e..c0062c672c 100644 --- a/includes/specials/SpecialRevisionMove.php +++ b/includes/specials/SpecialRevisionMove.php @@ -69,7 +69,7 @@ class SpecialRevisionMove extends UnlistedSpecialPage { * Mostly initializes variables and calls either showForm() or submit() */ public function execute( $par ) { - global $wgUser, $wgOut, $wgSkin; + global $wgUser, $wgOut; $this->setHeaders(); $this->outputHeader(); @@ -234,8 +234,6 @@ class SpecialRevisionMove extends UnlistedSpecialPage { * This function actually move the revision. NEVER call this function, call submit() */ protected function moveRevisions() { - global $wgOut; - $oldArticle = new Article( $this->mOldTitle ); $newArticle = new Article( $this->mNewTitle ); diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index a7f09b6d03..2dba5977aa 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -443,7 +443,7 @@ class SpecialSearch { * @param $terms Array: terms to highlight */ protected function showHit( $result, $terms ) { - global $wgContLang, $wgLang, $wgUser; + global $wgLang, $wgUser; wfProfileIn( __METHOD__ ); if( $result->isBrokenTitle() ) { @@ -667,7 +667,6 @@ class SpecialSearch { */ protected function showInterwikiHit( $result, $lastInterwiki, $terms, $query, $customCaptions) { wfProfileIn( __METHOD__ ); - global $wgContLang, $wgLang; if( $result->isBrokenTitle() ) { wfProfileOut( __METHOD__ ); @@ -745,8 +744,6 @@ class SpecialSearch { * @return String: HTML form */ protected function powerSearchBox( $term ) { - global $wgScript, $wgContLang; - // Groups namespaces into rows according to subject $rows = array(); foreach( SearchEngine::searchableNamespaces() as $namespace => $name ) { @@ -894,7 +891,7 @@ class SpecialSearch { } protected function formHeader( $term, $resultsShown, $totalNum ) { - global $wgContLang, $wgLang; + global $wgLang; $out = Xml::openElement('div', array( 'class' => 'mw-search-formheader' ) ); diff --git a/includes/specials/SpecialStatistics.php b/includes/specials/SpecialStatistics.php index d3c1a767e6..7438f2d25c 100644 --- a/includes/specials/SpecialStatistics.php +++ b/includes/specials/SpecialStatistics.php @@ -38,7 +38,7 @@ class SpecialStatistics extends SpecialPage { } public function execute( $par ) { - global $wgOut, $wgRequest, $wgMessageCache, $wgMemc; + global $wgOut, $wgRequest, $wgMemc; global $wgDisableCounters, $wgMiserMode; $this->setHeaders(); @@ -123,7 +123,6 @@ class SpecialStatistics extends SpecialPage { * @return string table row in HTML format */ private function formatRow( $text, $number, $trExtraParams = array(), $descMsg = '', $descMsgParam = '' ) { - global $wgStylePath; if( $descMsg ) { $descriptionText = wfMsgExt( $descMsg, array( 'parseinline' ), $descMsgParam ); if ( !wfEmptyMsg( $descMsg, $descriptionText ) ) { diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index ba7048be25..1124374830 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -721,7 +721,7 @@ class UndeleteForm extends SpecialPage { // Generic list of deleted pages private function showList( $result ) { - global $wgLang, $wgContLang, $wgUser, $wgOut; + global $wgLang, $wgUser, $wgOut; if( $result->numRows() == 0 ) { $wgOut->addWikiMsg( 'undelete-no-results' ); @@ -1015,7 +1015,7 @@ class UndeleteForm extends SpecialPage { } private function showHistory( ) { - global $wgLang, $wgUser, $wgOut; + global $wgUser, $wgOut; $sk = $wgUser->getSkin(); if( $this->mAllowed ) { diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index 65cbfaae72..dd6314505d 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -135,7 +135,7 @@ class SpecialUpload extends SpecialPage { * Special page entry point */ public function execute( $par ) { - global $wgUser, $wgOut, $wgRequest; + global $wgUser, $wgOut; $this->setHeaders(); $this->outputHeader(); @@ -630,7 +630,7 @@ class SpecialUpload extends SpecialPage { * @return String: empty string if there is no warning or an HTML fragment */ public static function getExistsWarning( $exists ) { - global $wgUser, $wgContLang; + global $wgUser; if ( !$exists ) { return ''; @@ -878,7 +878,6 @@ class UploadForm extends HTMLForm { global $wgLang, $wgCheckFileExtensions, $wgStrictFileExtensions, $wgFileExtensions, $wgFileBlacklist; - $allowedExtensions = ''; if( $wgCheckFileExtensions ) { if( $wgStrictFileExtensions ) { # Everything not permitted is banned diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index 3191934982..818a94e017 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -624,7 +624,7 @@ class LoginForm { } function processLogin() { - global $wgUser, $wgAuth; + global $wgUser; switch ( $this->authenticateUserData() ) { case self::SUCCESS: @@ -803,7 +803,7 @@ class LoginForm { * @private */ function mailPasswordInternal( $u, $throttle = true, $emailTitle = 'passwordremindertitle', $emailText = 'passwordremindertext' ) { - global $wgServer, $wgScript, $wgUser, $wgNewPasswordExpiry; + global $wgServer, $wgScript, $wgNewPasswordExpiry; if ( $u->getEmail() == '' ) { return new WikiError( wfMsg( 'noemail', $u->getName() ) ); @@ -838,7 +838,7 @@ class LoginForm { * @private */ function successfulLogin() { - global $wgUser, $wgOut; + global $wgOut; # Run any hooks; display injected HTML if any, else redirect $injected_html = ''; @@ -862,8 +862,7 @@ class LoginForm { * @private */ function successfulCreation() { - global $wgUser, $wgOut; - + global $wgUser; # Run any hooks; display injected HTML $injected_html = ''; wfRunHooks('UserLoginComplete', array(&$wgUser, &$injected_html)); diff --git a/includes/specials/SpecialUserrights.php b/includes/specials/SpecialUserrights.php index 914b0040fe..853e78438c 100644 --- a/includes/specials/SpecialUserrights.php +++ b/includes/specials/SpecialUserrights.php @@ -159,7 +159,7 @@ class UserrightsPage extends SpecialPage { * @return null */ function saveUserGroups( $username, $reason = '' ) { - global $wgRequest, $wgUser, $wgGroupsAddToSelf, $wgGroupsRemoveFromSelf; + global $wgRequest, $wgOut; $status = $this->fetchUser( $username ); if( !$status->isOK() ) { diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index 88f547472f..05f7a598a4 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -72,8 +72,6 @@ class SpecialVersion extends SpecialPage { * @return wiki text showing the license information */ static function MediaWikiCredits() { - global $wgContLang; - $ret = Xml::element( 'h2', array( 'id' => 'mw-version-license' ), wfMsg( 'version-license' ) ); // This text is always left-to-right. diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index 33f2644183..d6628dc1da 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -36,7 +36,7 @@ function wfSpecialWatchlist( $par ) { $wgUser->saveSettings(); } - global $wgServer, $wgScriptPath, $wgFeedClasses; + global $wgFeedClasses; $apiParams = array( 'action' => 'feedwatchlist', 'allrev' => 'allrev', 'wlowner' => $wgUser->getName(), 'wltoken' => $wlToken ); $feedTemplate = wfScript('api').'?'; diff --git a/includes/specials/SpecialWithoutinterwiki.php b/includes/specials/SpecialWithoutinterwiki.php index 37eee79fa1..0414ef85fa 100644 --- a/includes/specials/SpecialWithoutinterwiki.php +++ b/includes/specials/SpecialWithoutinterwiki.php @@ -89,7 +89,7 @@ class WithoutInterwikiPage extends PageQueryPage { } function wfSpecialWithoutinterwiki() { - global $wgRequest, $wgContLang; + global $wgRequest; list( $limit, $offset ) = wfCheckLimits(); // Only searching the mainspace anyway $prefix = Title::capitalize( $wgRequest->getVal( 'prefix' ), NS_MAIN ); diff --git a/includes/upload/UploadFromUrl.php b/includes/upload/UploadFromUrl.php index 8d6de71603..6b5aac5dd2 100644 --- a/includes/upload/UploadFromUrl.php +++ b/includes/upload/UploadFromUrl.php @@ -163,7 +163,6 @@ class UploadFromUrl extends UploadBase { } if ( $status->isGood() ) { - global $wgLocalFileRepo; $file = $this->getLocalFile(); $wgUser->leaveUserMessage( wfMsg( 'successfulupload' ),