From fdbb1752ab37538fb8965996baa2a40f75bf8834 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Tue, 28 Apr 2009 03:03:48 +0000 Subject: [PATCH] Kill a bunch of unused $wgUser --- includes/Article.php | 2 +- includes/EditPage.php | 2 +- includes/ImagePage.php | 2 +- includes/Linker.php | 1 - includes/LogEventsList.php | 1 - includes/Title.php | 2 +- includes/User.php | 1 - includes/api/ApiPatrol.php | 2 +- includes/filerepo/LocalFile.php | 4 ++-- includes/specials/SpecialContributions.php | 2 +- includes/specials/SpecialDeletedContributions.php | 2 +- includes/specials/SpecialMergeHistory.php | 6 +++--- includes/specials/SpecialNewpages.php | 2 +- includes/specials/SpecialRemoveRestrictions.php | 2 +- includes/specials/SpecialUndelete.php | 2 +- includes/specials/SpecialUpload.php | 2 +- includes/specials/SpecialUserlogin.php | 2 -- languages/classes/LanguageWa.php | 2 -- 18 files changed, 16 insertions(+), 23 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 4c21c7bd79..1f30e8797f 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -3569,7 +3569,7 @@ class Article { * @param $cache Boolean */ public function outputWikiText( $text, $cache = true ) { - global $wgParser, $wgUser, $wgOut, $wgEnableParserCache, $wgUseFileCache; + global $wgParser, $wgOut, $wgEnableParserCache, $wgUseFileCache; $popts = $wgOut->parserOptions(); $popts->setTidy(true); diff --git a/includes/EditPage.php b/includes/EditPage.php index 6dbee62153..16230f57e2 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -352,7 +352,7 @@ class EditPage { * the newly-edited page. */ function edit() { - global $wgOut, $wgUser, $wgRequest; + global $wgOut, $wgRequest; // Allow extensions to modify/prevent this form or submission if ( !wfRunHooks( 'AlternateEdit', array( &$this ) ) ) { return; diff --git a/includes/ImagePage.php b/includes/ImagePage.php index a6da109001..612d2a6919 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -481,7 +481,7 @@ EOT * Show a notice that the file is from a shared repository */ protected function printSharedImageText() { - global $wgOut, $wgUser; + global $wgOut; $this->loadFile(); diff --git a/includes/Linker.php b/includes/Linker.php index b3c98f754c..9cbe815663 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -443,7 +443,6 @@ class Linker { * @param $prefix String: optional prefix. As trail, only before instead of after. */ function makeLinkObj( $nt, $text= '', $query = '', $trail = '', $prefix = '' ) { - global $wgUser; wfProfileIn( __METHOD__ ); $query = wfCgiToArray( $query ); diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index ac6c9fc91d..b4b36f3834 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -774,7 +774,6 @@ class LogViewer { * LogEventsList::NO_ACTION_LINK Don't show restore/unblock/block links */ function __construct( &$reader, $flags = 0 ) { - global $wgUser; wfDeprecated(__METHOD__); $this->reader =& $reader; $this->reader->pager->mLogEventsList->flags = $flags; diff --git a/includes/Title.php b/includes/Title.php index b38cad97b1..3da588874d 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -2996,7 +2996,7 @@ class Title { * arrays (errors) as values, or an error array with numeric indices if no pages were moved */ public function moveSubpages( $nt, $auth = true, $reason = '', $createRedirect = true ) { - global $wgUser, $wgMaximumMovedPages; + global $wgMaximumMovedPages; // Check permissions if( !$this->userCan( 'move-subpages' ) ) return array( 'cant-move-subpages' ); diff --git a/includes/User.php b/includes/User.php index 12577f6c67..4ab5785578 100644 --- a/includes/User.php +++ b/includes/User.php @@ -2375,7 +2375,6 @@ class User { * Log this user out. */ function logout() { - global $wgUser; if( wfRunHooks( 'UserLogout', array(&$this) ) ) { $this->doLogout(); } diff --git a/includes/api/ApiPatrol.php b/includes/api/ApiPatrol.php index 19f3f1b0f3..83dcbdb9b8 100644 --- a/includes/api/ApiPatrol.php +++ b/includes/api/ApiPatrol.php @@ -41,7 +41,7 @@ class ApiPatrol extends ApiBase { * Patrols the article or provides the reason the patrol failed. */ public function execute() { - global $wgUser, $wgUseRCPatrol, $wgUseNPPatrol; + global $wgUser; $params = $this->extractRequestParams(); if(!isset($params['token'])) diff --git a/includes/filerepo/LocalFile.php b/includes/filerepo/LocalFile.php index 321461d104..d1ef4e2883 100644 --- a/includes/filerepo/LocalFile.php +++ b/includes/filerepo/LocalFile.php @@ -1398,7 +1398,7 @@ class LocalFileDeleteBatch { * Run the transaction */ function execute() { - global $wgUser, $wgUseSquid; + global $wgUseSquid; wfProfileIn( __METHOD__ ); $this->file->lock(); @@ -1540,7 +1540,7 @@ class LocalFileRestoreBatch { * So we save the batch and let the caller call cleanup() */ function execute() { - global $wgUser, $wgLang; + global $wgLang; if ( !$this->all && !$this->ids ) { // Do nothing return $this->file->repo->newGood(); diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 36f2020bb1..835cce6258 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -473,7 +473,7 @@ class ContribsPager extends ReverseChronologicalPager { * @todo This would probably look a lot nicer in a table. */ function formatRow( $row ) { - global $wgLang, $wgUser, $wgContLang; + global $wgLang, $wgContLang; wfProfileIn( __METHOD__ ); $sk = $this->getSkin(); diff --git a/includes/specials/SpecialDeletedContributions.php b/includes/specials/SpecialDeletedContributions.php index 55dd43e477..78828513b7 100644 --- a/includes/specials/SpecialDeletedContributions.php +++ b/includes/specials/SpecialDeletedContributions.php @@ -108,7 +108,7 @@ class DeletedContribsPager extends IndexPager { function formatRow( $row ) { wfProfileIn( __METHOD__ ); - global $wgLang, $wgUser; + global $wgLang; $sk = $this->getSkin(); diff --git a/includes/specials/SpecialMergeHistory.php b/includes/specials/SpecialMergeHistory.php index c51ce7c3c4..ead8a3bcc8 100644 --- a/includes/specials/SpecialMergeHistory.php +++ b/includes/specials/SpecialMergeHistory.php @@ -67,7 +67,7 @@ class MergehistoryForm { } function execute() { - global $wgOut, $wgUser; + global $wgOut; $wgOut->setPagetitle( wfMsgHtml( "mergehistory" ) ); @@ -218,7 +218,7 @@ class MergehistoryForm { } function formatRevisionRow( $row ) { - global $wgUser, $wgLang; + global $wgLang; $rev = new Revision( $row ); @@ -270,7 +270,7 @@ class MergehistoryForm { } function merge() { - global $wgOut, $wgUser; + global $wgOut; # Get the titles directly from the IDs, in case the target page params # were spoofed. The queries are done based on the IDs, so it's best to # keep it consistent... diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php index 886c41a254..e85238c9e4 100644 --- a/includes/specials/SpecialNewpages.php +++ b/includes/specials/SpecialNewpages.php @@ -247,7 +247,7 @@ class SpecialNewpages extends SpecialPage { * @return string */ public function formatRow( $result ) { - global $wgLang, $wgContLang, $wgUser; + global $wgLang, $wgContLang; $classes = array(); diff --git a/includes/specials/SpecialRemoveRestrictions.php b/includes/specials/SpecialRemoveRestrictions.php index 75645e70d7..a3428a5a59 100644 --- a/includes/specials/SpecialRemoveRestrictions.php +++ b/includes/specials/SpecialRemoveRestrictions.php @@ -46,7 +46,7 @@ function wfSpecialRemoveRestrictions() { } function wfSpecialRemoveRestrictionsProcess( $r ) { - global $wgUser, $wgRequest; + global $wgRequest; $reason = $wgRequest->getVal( 'reason' ); $result = $r->delete(); $log = new LogPage( 'restrict' ); diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index a9fa3b7461..6c89d166c0 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -833,7 +833,7 @@ class UndeleteForm { * @return string HTML */ function showDiff( $previousRev, $currentRev ) { - global $wgOut, $wgUser; + global $wgOut; $diffEngine = new DifferenceEngine(); $diffEngine->showDiffStyle(); diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index d8679cd154..232064dfd8 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -288,7 +288,7 @@ class UploadForm { * @access private */ function processUpload(){ - global $wgUser, $wgOut, $wgFileExtensions, $wgLang; + global $wgOut, $wgFileExtensions, $wgLang; $details = null; $value = null; $value = $this->internalProcessUpload( $details ); diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index b065bdd6a4..55615a9f76 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -948,8 +948,6 @@ class LoginForm { * @private */ function onCookieRedirectCheck( $type ) { - global $wgUser; - if ( !$this->hasSessionCookie() ) { if ( $type == 'new' ) { return $this->mainLoginForm( wfMsgExt( 'nocookiesnew', array( 'parseinline' ) ) ); diff --git a/languages/classes/LanguageWa.php b/languages/classes/LanguageWa.php index d97b2026a2..3d117e5fcc 100644 --- a/languages/classes/LanguageWa.php +++ b/languages/classes/LanguageWa.php @@ -15,8 +15,6 @@ class LanguageWa extends Language { ### " d' " for months starting with a vowel ### function date( $ts, $adj = false, $format = true, $tc = false ) { - global $wgUser; - if ( $adj ) { $ts = $this->userAdjust( $ts, $tc ); } $datePreference = $this->dateFormat( $format ); -- 2.20.1