Index: trunk/tools/code-utils/check-vars.php |
— | — | @@ -9,6 +9,7 @@ |
10 | 10 | if( ! $IP = getenv( 'MW_INSTALL_PATH' ) ) { |
11 | 11 | $IP = dirname( __FILE__ ) . "/../../phase3/"; |
12 | 12 | } |
| 13 | + |
13 | 14 | require_once( "$IP/includes/Defines.php" ); # Faster than parsing |
14 | 15 | require_once( "$IP/includes/AutoLoader.php" ); |
15 | 16 | |
— | — | @@ -122,7 +123,7 @@ |
123 | 124 | '$wgHtmlEntityAliases' => array( 'Sanitizer.php' ), |
124 | 125 | '$wgFullyInitialised' => array( /* Set */ 'Setup.php', /* read */ 'Exception.php' ), |
125 | 126 | '$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 |
127 | 128 | '$wgDatabase' => array( 'DatabaseUpdater.php' ), |
128 | 129 | '$wgExtPGNewFields' => array( 'DatabaseUpdater.php', 'PostgresUpdater.php' ), |
129 | 130 | '$wgExtPGAlteredFields' => array( 'DatabaseUpdater.php', 'PostgresUpdater.php' ), |
— | — | @@ -130,7 +131,7 @@ |
131 | 132 | '$mainListOpened' => array( 'Installer.php' ), |
132 | 133 | '$optionsWithArgs' => array( 'commandLine.inc' ), |
133 | 134 | '$args' => array( 'commandLine.inc' ), |
134 | | - '$options' => array( 'commandLine.inc', 'FiveUpgrade.inc' ), |
| 135 | + '$options' => array( 'commandLine.inc', 'upgrade1_5.php' ), |
135 | 136 | '$canonicalDecomp' => array( 'UtfNormalGenerate.php' ), |
136 | 137 | '$compatibilityDecomp' => array( 'UtfNormalGenerate.php' ), |
137 | 138 | '$mmfl' => array( 'mergeMessageFileList.php' ), |
— | — | @@ -196,6 +197,7 @@ |
197 | 198 | static $functionQualifiers = array( T_ABSTRACT, T_PRIVATE, T_PUBLIC, T_PROTECTED, T_STATIC ); |
198 | 199 | |
199 | 200 | function execute() { |
| 201 | + global $IP; |
200 | 202 | $currentToken = null; |
201 | 203 | |
202 | 204 | foreach ( $this->mTokens as $token ) { |
— | — | @@ -474,6 +476,10 @@ |
475 | 477 | $this->mStatus = $this->mStatus - self::IN_REQUIRE_WAITING; |
476 | 478 | continue; |
477 | 479 | } |
| 480 | + if ( substr( $requirePath, -18 ) == "/LocalSettings.php" ) { |
| 481 | + $this->mStatus = $this->mStatus - self::IN_REQUIRE_WAITING; |
| 482 | + continue; |
| 483 | + } |
478 | 484 | |
479 | 485 | if ( ( $requirePath == '' ) || ( !file_exists( $requirePath ) && $requirePath[0] != '/' ) ) { |
480 | 486 | /* Try prepending the script folder, for maintenance scripts (but see Maintenance.php:758) */ |
— | — | @@ -519,6 +525,8 @@ |
520 | 526 | $requirePath = dirname( $this->mFilename ); |
521 | 527 | } elseif ( $requirePath == 'dirname(dirname(__FILE__))' ) { |
522 | 528 | $requirePath = dirname( dirname( $this->mFilename ) ); |
| 529 | + } elseif ( $requirePath == 'dirname(dirname(dirname(__FILE__)))' ) { |
| 530 | + $requirePath = dirname( dirname( dirname( $this->mFilename ) ) ); |
523 | 531 | } |
524 | 532 | } else if ( $token[0] == T_CURLY_OPEN || $token == '}' ) { |
525 | 533 | continue; |
— | — | @@ -530,16 +538,12 @@ |
531 | 539 | $requirePath .= trim( $token[1], '\'"' ); |
532 | 540 | } else if ( $token[0] == T_VARIABLE ) { |
533 | 541 | if ( $token[1] == '$IP' || $token[1] == '$mwPath' ) { |
534 | | - #$requirePath .= dirname( __FILE__ ) . '/../../phase3'; |
535 | | - global $IP; |
536 | | - $requirePath .= $IP ; |
| 542 | + $requirePath .= $IP; |
537 | 543 | } elseif ( $token[1] == '$dir' ) { |
538 | 544 | // Scripts at phase3/maintenance/language/ |
539 | 545 | $requirePath .= dirname( $this->mFilename ); |
540 | 546 | } elseif ( $token[1] == '$wgStyleDirectory' ) { |
541 | | - #$requirePath .= dirname( __FILE__ ) . '/../../phase3/skins'; |
542 | | - global $IP; |
543 | | - $requirePath .= "$IP/skins/"; |
| 547 | + $requirePath .= "$IP/skins"; |
544 | 548 | } elseif ( in_array( $token[1], array( '$classFile', '$file', '$_fileName', '$fileName', '$filename' ) ) ) { |
545 | 549 | /* Maintenance.php lines 374 and 894 */ |
546 | 550 | /* LocalisationCache.php, MessageCache.php, AutoLoader.php */ |
— | — | @@ -548,8 +552,6 @@ |
549 | 553 | $requirePath .= $token[1]; |
550 | 554 | } |
551 | 555 | } elseif ( $token[0] == T_STRING && $token[1] == 'DO_MAINTENANCE' ) { |
552 | | - #$requirePath .= dirname( __FILE__ ) . '/../../phase3/maintenance/doMaintenance.php'; |
553 | | - global $IP; |
554 | 556 | $requirePath .= "$IP/maintenance/doMaintenance.php"; |
555 | 557 | } else { |
556 | 558 | $requirePath .= $token[1]; |
— | — | @@ -733,6 +735,7 @@ |
734 | 736 | if ( $token[1] == "Testing_Selenium" || $token[1] == "Testing_Selenium_Exception" ) return $token[1]; |
735 | 737 | if ( substr( $token[1], 0, 12 ) == "Net_Gearman_" ) return $token[1]; # phase3/maintenance/gearman/gearman.inc |
736 | 738 | 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 |
737 | 740 | |
738 | 741 | if ( !isset( $wgAutoloadLocalClasses[$token[1]] ) && !in_array( $token[1], $this->mKnownFileClasses ) ) { |
739 | 742 | if ( $warn == 'now' ) { |
— | — | @@ -772,11 +775,12 @@ |
773 | 776 | |
774 | 777 | } |
775 | 778 | |
| 779 | +if( $argc < 2 ) { |
| 780 | + die ("Usage: php $argv[0] [--generate-deprecated-list] <PHP_source_file1> <PHP_source_file2> ...\n"); |
| 781 | +} |
| 782 | + |
776 | 783 | $cv = new CheckVars(); |
777 | 784 | // $cv->mDebug = true; |
778 | | -if( $argc < 2 ) { |
779 | | - die ("Usage: $argv[0] <PHP_source_file> [--generate-deprecated-list]\n"); |
780 | | -} |
781 | 785 | array_shift( $argv ); |
782 | 786 | if ( $argv[0] == '--generate-deprecated-list' ) { |
783 | 787 | $cv->setGenerateDeprecatedList( true ); |