r75729 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75728‎ | r75729 | r75730 >
Date:18:22, 31 October 2010
Author:platonides
Status:ok
Tags:
Comment:
Merge my WC changes.
Moved up the $IP added by r75725 and corrected the usage.
Modified paths:
  • /trunk/tools/code-utils/check-vars.php (modified) (history)

Diff [purge]

Index: trunk/tools/code-utils/check-vars.php
@@ -9,6 +9,7 @@
1010 if( ! $IP = getenv( 'MW_INSTALL_PATH' ) ) {
1111 $IP = dirname( __FILE__ ) . "/../../phase3/";
1212 }
 13+
1314 require_once( "$IP/includes/Defines.php" ); # Faster than parsing
1415 require_once( "$IP/includes/AutoLoader.php" );
1516
@@ -122,7 +123,7 @@
123124 '$wgHtmlEntityAliases' => array( 'Sanitizer.php' ),
124125 '$wgFullyInitialised' => array( /* Set */ 'Setup.php', /* read */ 'Exception.php' ),
125126 '$wgContLanguageCode' => array( 'Setup.php' ),
126 - '$wgUseLatin1' => array( 'FiveUpgrade.inc' ), # If you upgrade from MW < 1.5 it will be there
 127+ '$wgUseLatin1' => array( 'upgrade1_5.php' ), # If you upgrade from MW < 1.5 it will be there
127128 '$wgDatabase' => array( 'DatabaseUpdater.php' ),
128129 '$wgExtPGNewFields' => array( 'DatabaseUpdater.php', 'PostgresUpdater.php' ),
129130 '$wgExtPGAlteredFields' => array( 'DatabaseUpdater.php', 'PostgresUpdater.php' ),
@@ -130,7 +131,7 @@
131132 '$mainListOpened' => array( 'Installer.php' ),
132133 '$optionsWithArgs' => array( 'commandLine.inc' ),
133134 '$args' => array( 'commandLine.inc' ),
134 - '$options' => array( 'commandLine.inc', 'FiveUpgrade.inc' ),
 135+ '$options' => array( 'commandLine.inc', 'upgrade1_5.php' ),
135136 '$canonicalDecomp' => array( 'UtfNormalGenerate.php' ),
136137 '$compatibilityDecomp' => array( 'UtfNormalGenerate.php' ),
137138 '$mmfl' => array( 'mergeMessageFileList.php' ),
@@ -196,6 +197,7 @@
197198 static $functionQualifiers = array( T_ABSTRACT, T_PRIVATE, T_PUBLIC, T_PROTECTED, T_STATIC );
198199
199200 function execute() {
 201+ global $IP;
200202 $currentToken = null;
201203
202204 foreach ( $this->mTokens as $token ) {
@@ -474,6 +476,10 @@
475477 $this->mStatus = $this->mStatus - self::IN_REQUIRE_WAITING;
476478 continue;
477479 }
 480+ if ( substr( $requirePath, -18 ) == "/LocalSettings.php" ) {
 481+ $this->mStatus = $this->mStatus - self::IN_REQUIRE_WAITING;
 482+ continue;
 483+ }
478484
479485 if ( ( $requirePath == '' ) || ( !file_exists( $requirePath ) && $requirePath[0] != '/' ) ) {
480486 /* Try prepending the script folder, for maintenance scripts (but see Maintenance.php:758) */
@@ -519,6 +525,8 @@
520526 $requirePath = dirname( $this->mFilename );
521527 } elseif ( $requirePath == 'dirname(dirname(__FILE__))' ) {
522528 $requirePath = dirname( dirname( $this->mFilename ) );
 529+ } elseif ( $requirePath == 'dirname(dirname(dirname(__FILE__)))' ) {
 530+ $requirePath = dirname( dirname( dirname( $this->mFilename ) ) );
523531 }
524532 } else if ( $token[0] == T_CURLY_OPEN || $token == '}' ) {
525533 continue;
@@ -530,16 +538,12 @@
531539 $requirePath .= trim( $token[1], '\'"' );
532540 } else if ( $token[0] == T_VARIABLE ) {
533541 if ( $token[1] == '$IP' || $token[1] == '$mwPath' ) {
534 - #$requirePath .= dirname( __FILE__ ) . '/../../phase3';
535 - global $IP;
536 - $requirePath .= $IP ;
 542+ $requirePath .= $IP;
537543 } elseif ( $token[1] == '$dir' ) {
538544 // Scripts at phase3/maintenance/language/
539545 $requirePath .= dirname( $this->mFilename );
540546 } elseif ( $token[1] == '$wgStyleDirectory' ) {
541 - #$requirePath .= dirname( __FILE__ ) . '/../../phase3/skins';
542 - global $IP;
543 - $requirePath .= "$IP/skins/";
 547+ $requirePath .= "$IP/skins";
544548 } elseif ( in_array( $token[1], array( '$classFile', '$file', '$_fileName', '$fileName', '$filename' ) ) ) {
545549 /* Maintenance.php lines 374 and 894 */
546550 /* LocalisationCache.php, MessageCache.php, AutoLoader.php */
@@ -548,8 +552,6 @@
549553 $requirePath .= $token[1];
550554 }
551555 } elseif ( $token[0] == T_STRING && $token[1] == 'DO_MAINTENANCE' ) {
552 - #$requirePath .= dirname( __FILE__ ) . '/../../phase3/maintenance/doMaintenance.php';
553 - global $IP;
554556 $requirePath .= "$IP/maintenance/doMaintenance.php";
555557 } else {
556558 $requirePath .= $token[1];
@@ -733,6 +735,7 @@
734736 if ( $token[1] == "Testing_Selenium" || $token[1] == "Testing_Selenium_Exception" ) return $token[1];
735737 if ( substr( $token[1], 0, 12 ) == "Net_Gearman_" ) return $token[1]; # phase3/maintenance/gearman/gearman.inc
736738 if ( $token[1] == "PEAR_Error" ) return $token[1]; # Services_JSON.php
 739+ if ( $token[1] == "PHP_Timer" ) return $token[1]; # From PEAR, used in ParserHelpers.php
737740
738741 if ( !isset( $wgAutoloadLocalClasses[$token[1]] ) && !in_array( $token[1], $this->mKnownFileClasses ) ) {
739742 if ( $warn == 'now' ) {
@@ -772,11 +775,12 @@
773776
774777 }
775778
 779+if( $argc < 2 ) {
 780+ die ("Usage: php $argv[0] [--generate-deprecated-list] <PHP_source_file1> <PHP_source_file2> ...\n");
 781+}
 782+
776783 $cv = new CheckVars();
777784 // $cv->mDebug = true;
778 -if( $argc < 2 ) {
779 - die ("Usage: $argv[0] <PHP_source_file> [--generate-deprecated-list]\n");
780 -}
781785 array_shift( $argv );
782786 if ( $argv[0] == '--generate-deprecated-list' ) {
783787 $cv->setGenerateDeprecatedList( true );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r75725* Use MW_INSTALL_PATH environment variable as a base path, default to previou...hashar17:23, 31 October 2010

Status & tagging log