r69838 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69837‎ | r69838 | r69839 >
Date:19:11, 24 July 2010
Author:reedy
Status:ok
Tags:
Comment:
Remove various unused globals

Add missing global $wgUser;
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -250,7 +250,7 @@
251251 * @return Return the text of this revision
252252 */
253253 public function getContent() {
254 - global $wgUser, $wgContLang, $wgOut, $wgMessageCache;
 254+ global $wgUser, $wgContLang, $wgMessageCache;
255255
256256 wfProfileIn( __METHOD__ );
257257
@@ -826,9 +826,8 @@
827827 * page of the given title.
828828 */
829829 public function view() {
830 - global $wgUser, $wgOut, $wgRequest, $wgContLang;
831 - global $wgEnableParserCache, $wgStylePath, $wgParser;
832 - global $wgUseTrackbacks, $wgUseFileCache;
 830+ global $wgUser, $wgOut, $wgRequest, $wgParser;
 831+ global $wgUseFileCache;
833832
834833 wfProfileIn( __METHOD__ );
835834
@@ -1048,7 +1047,7 @@
10491048 * Article::view() only, other callers should use the DifferenceEngine class.
10501049 */
10511050 public function showDiffPage() {
1052 - global $wgOut, $wgRequest, $wgUser;
 1051+ global $wgRequest, $wgUser;
10531052
10541053 $diff = $wgRequest->getVal( 'diff' );
10551054 $rcid = $wgRequest->getVal( 'rcid' );
@@ -1285,7 +1284,7 @@
12861285 * Show the footer section of an ordinary page view
12871286 */
12881287 public function showViewFooter() {
1289 - global $wgOut, $wgUseTrackbacks, $wgRequest;
 1288+ global $wgOut, $wgUseTrackbacks;
12901289
12911290 # check if we're displaying a [[User talk:x.x.x.x]] anonymous talk page
12921291 if ( $this->mTitle->getNamespace() == NS_USER_TALK && IP::isValid( $this->mTitle->getText() ) ) {
@@ -2359,7 +2358,7 @@
23602359 * Mark this particular edit/page as patrolled
23612360 */
23622361 public function markpatrolled() {
2363 - global $wgOut, $wgRequest, $wgUseRCPatrol, $wgUseNPPatrol, $wgUser;
 2362+ global $wgOut, $wgRequest;
23642363
23652364 $wgOut->setRobotPolicy( 'noindex,nofollow' );
23662365
@@ -3125,7 +3124,7 @@
31263125 * Perform a deletion and output success or failure messages
31273126 */
31283127 public function doDelete( $reason, $suppress = false ) {
3129 - global $wgOut, $wgUser;
 3128+ global $wgOut;
31303129
31313130 $id = $this->mTitle->getArticleID( GAID_FOR_UPDATE );
31323131
@@ -3181,8 +3180,7 @@
31823181 * @return boolean true if successful
31833182 */
31843183 public function doDeleteArticle( $reason, $suppress = false, $id = 0, $commit = true ) {
3185 - global $wgUseSquid, $wgDeferredUpdateList;
3186 - global $wgUseTrackbacks;
 3184+ global $wgDeferredUpdateList, $wgUseTrackbacks;
31873185
31883186 wfDebug( __METHOD__ . "\n" );
31893187
@@ -3493,7 +3491,7 @@
34943492 * User interface for rollback operations
34953493 */
34963494 public function rollback() {
3497 - global $wgUser, $wgOut, $wgRequest, $wgUseRCPatrol;
 3495+ global $wgUser, $wgOut, $wgRequest;
34983496
34993497 $details = null;
35003498
@@ -4006,6 +4004,7 @@
40074005 $revision->insertOn( $dbw );
40084006 $this->updateRevisionOn( $dbw, $revision );
40094007
 4008+ global $wgUser;
40104009 wfRunHooks( 'NewRevisionFromEditComplete', array( $this, $revision, false, $wgUser ) );
40114010
40124011 wfProfileOut( __METHOD__ );
@@ -4420,7 +4419,7 @@
44214420 * @return string containing parsed output
44224421 */
44234422 public function getOutputFromWikitext( $text, $cache = true, $parserOptions = false ) {
4424 - global $wgParser, $wgOut, $wgEnableParserCache, $wgUseFileCache;
 4423+ global $wgParser, $wgEnableParserCache, $wgUseFileCache;
44254424
44264425 if ( !$parserOptions ) {
44274426 $parserOptions = $this->getParserOptions();
@@ -4500,8 +4499,6 @@
45014500 __METHOD__
45024501 );
45034502
4504 - global $wgContLang;
4505 -
45064503 foreach ( $res as $row ) {
45074504 $tlTemplates["{$row->tl_namespace}:{$row->tl_title}"] = true;
45084505 }
@@ -4596,7 +4593,7 @@
45974594 * @param $oldid mixed integer Revision ID or null
45984595 */
45994596 public function getParserOutput( $oldid = null ) {
4600 - global $wgEnableParserCache, $wgUser, $wgOut;
 4597+ global $wgEnableParserCache, $wgUser;
46014598
46024599 // Should the parser cache be used?
46034600 $useParserCache = $wgEnableParserCache &&

Status & tagging log