r70284 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70283‎ | r70284 | r70285 >
Date:19:03, 1 August 2010
Author:platonides
Status:deferred
Tags:
Comment:
Follow up Nikerabbit CR to r70253
Modified paths:
  • /trunk/tools/code-utils/check-vars.php (modified) (history)

Diff [purge]

Index: trunk/tools/code-utils/check-vars.php
@@ -7,8 +7,8 @@
88 * find phase3/ \( -name \*.php -or -name \*.inc \) -not \( -name importUseModWiki.php -o -name diffLanguage.php \) -exec php tools/code-utils/check-vars.php \{\} +
99 */
1010
11 -require_once( dirname( dirname( dirname( __FILE__ ) ) ) . "/phase3/includes/Defines.php" ); # Faster than parsing
12 -require_once( dirname( dirname( dirname( __FILE__ ) ) ) . "/phase3/includes/AutoLoader.php" );
 11+require_once( dirname( __FILE__ ) . "/../../phase3/includes/Defines.php" ); # Faster than parsing
 12+require_once( dirname( __FILE__ ) . "/phase3/includes/AutoLoader.php" );
1313
1414 if ( !extension_loaded( 'sockets' ) ) dl('sockets.so');
1515 if ( !extension_loaded( 'PDO' ) ) dl('pdo.so');
@@ -61,47 +61,47 @@
6262
6363 if ( count( $this->mTokens ) > 0 ) {
6464 $globals = array (
65 - '$wgArticle', # Setup.php
66 - '$wgAutoloadLocalClasses', # AutoLoader.php, a couple of readers
67 - '$wgBlobCache', # HistoryBlob.php
68 - '$wgCaches', # ObjectCache.php
69 - '$wgCanonicalNamespaceNames', # Namespace.phph-
70 - '$wgContLang', # Setup.php
 65+ '$wgArticle', # Setup.php
 66+ '$wgAutoloadLocalClasses', # AutoLoader.php, a couple of readers
 67+ '$wgBlobCache', # HistoryBlob.php
 68+ '$wgCaches', # ObjectCache.php
 69+ '$wgCanonicalNamespaceNames', # Namespace.php
 70+ '$wgContLang', # Setup.php
7171
72 - '$wgContLanguageCode', # Should probably be removed
73 - '$wgDatabase', # For update scripts
74 - '$wgDBcataloged', # http://www.mediawiki.org/wiki/Special:Code/MediaWiki/45755#c7954
75 - '$wgDeferredUpdateList', # Setup.php
76 - '$wgExternalBlobCache', # ExternalStoreDB.php
 72+ '$wgContLanguageCode', # Should probably be removed
 73+ '$wgDatabase', # For update scripts
 74+ '$wgDBcataloged', # http://www.mediawiki.org/wiki/Special:Code/MediaWiki/45755#c7954
 75+ '$wgDeferredUpdateList', # Setup.php
 76+ '$wgExternalBlobCache', # ExternalStoreDB.php
7777
78 - '$wgExtModifiedFields', '$wgExtNewFields', '$wgExtNewIndexes', '$wgExtNewTables', # Updates
 78+ '$wgExtModifiedFields', '$wgExtNewFields', '$wgExtNewIndexes', '$wgExtNewTables', # Updates
7979
80 - '$wgFeedClasses', # Defines.php, many uses
81 - '$wgFullyInitialised', # Set by Setup.php, read by Exception
82 - '$wgHtmlEntities', '$wgHtmlEntityAliases', # Sanitizer.php
83 - '$wgIP', # Setup.php
84 - '$wgLang', # Setup.php
85 - '$wgLanguageNames', # Language.php, read by others
86 - '$wgMemc', # Setup.php
87 - '$wgMessageCache', # Setup.php
 80+ '$wgFeedClasses', # Defines.php, many uses
 81+ '$wgFullyInitialised', # Set by Setup.php, read by Exception
 82+ '$wgHtmlEntities', '$wgHtmlEntityAliases', # Sanitizer.php
 83+ '$wgIP', # Setup.php
 84+ '$wgLang', # Setup.php
 85+ '$wgLanguageNames', # Language.php, read by others
 86+ '$wgMemc', # Setup.php
 87+ '$wgMessageCache', # Setup.php
8888
89 - '$wgNoDBParam', # maintenance, serialized
90 - '$wgOut', # Setup.php
91 - '$wgParser', # Setup.php
92 - '$wgPostCommitUpdateList', # Initialised in Setup.php, should be removed
93 - '$wgProfiler', # StartProfiler.php
94 - '$wgProfiling', # Profiler.php
95 - '$wgQueryPages', # QueryPage.php
96 - '$wgRequest', # Setup.php
97 - '$wgRequestTime', # WebStart.php
98 - '$wgRUstart', # WebStart.php, for Profiler stuff
99 - '$wgTitle', # index.php
100 - '$wgUpdates', # updaters
101 - '$wgUseEnotif', # Setup.php
102 - '$wgUseNormalUser', # maintenance
103 - '$wgUser', # Setup.php
104 - '$wgWikiFarm', # maintenance, to be removed
105 - );
 89+ '$wgNoDBParam', # maintenance, serialized
 90+ '$wgOut', # Setup.php
 91+ '$wgParser', # Setup.php
 92+ '$wgPostCommitUpdateList', # Initialised in Setup.php, should be removed
 93+ '$wgProfiler', # StartProfiler.php
 94+ '$wgProfiling', # Profiler.php
 95+ '$wgQueryPages', # QueryPage.php
 96+ '$wgRequest', # Setup.php
 97+ '$wgRequestTime', # WebStart.php
 98+ '$wgRUstart', # WebStart.php, for Profiler stuff
 99+ '$wgTitle', # index.php
 100+ '$wgUpdates', # updaters
 101+ '$wgUseEnotif', # Setup.php
 102+ '$wgUseNormalUser', # maintenance
 103+ '$wgUser', # Setup.php
 104+ '$wgWikiFarm', # maintenance, to be removed
 105+ );
106106
107107 foreach ( $this->mTokens as $token ) {
108108 if ( is_array( $token ) && ($token[0] == T_VARIABLE) && (substr($token[1], 0, 3) == '$wg') ) {
@@ -370,7 +370,7 @@
371371 function shouldBeGlobal( $name ) {
372372 static $specialGlobals = array( '$IP', '$parserMemc', '$messageMemc', '$hackwhere', '$haveProctitle' );
373373 static $nonGlobals = array( '$wgOptionalMessages', '$wgIgnoredMessages', '$wgEXIFMessages', # Used by Translate extension, read from maintenance/languages/messageTypes.inc
374 - '$wgMessageStructure', '$wgBlockComments' ); # Used by Translate extension, read from maintenance/languages/messages.inc
 374+ '$wgMessageStructure', '$wgBlockComments' ); # Used by Translate extension and maintenance/language/writeMessagesArray.inc, read from maintenance/languages/messages.inc
375375
376376 return ( ( substr($name, 0, 3) == '$wg' ) || ( substr($name, 0, 3) == '$eg' ) || in_array( $name, $specialGlobals ) ) && !in_array($name, $nonGlobals);
377377 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r70336Fix the include after r70284platonides14:35, 2 August 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r70253Commit check-vars.php file. Detects possible errors using MediaWiki conventio...platonides23:36, 31 July 2010

Status & tagging log