Index: trunk/tools/code-utils/check-vars.php |
— | — | @@ -16,6 +16,7 @@ |
17 | 17 | require_once( "$IP/includes/AutoLoader.php" ); |
18 | 18 | $wgAutoloadClasses = &$wgAutoloadLocalClasses; |
19 | 19 | include_once( "$IP/tests/TestsAutoLoader.php" ); |
| 20 | +$wgAutoloadClasses['MWInit'] = "$IP/includes/Init.php"; |
20 | 21 | |
21 | 22 | $mwDeprecatedFunctions = false; |
22 | 23 | @include( dirname( __FILE__ ) . "/deprecated.functions" ); |
— | — | @@ -684,7 +685,9 @@ |
685 | 686 | } else if ( $token[0] == T_CURLY_OPEN || $token == '}' ) { |
686 | 687 | continue; |
687 | 688 | } else if ( !is_array( $token ) ) { |
688 | | - if ( ( $token != '(' ) || $requirePath != '' ) { |
| 689 | + if ( $token == '(' && ( $requirePath == 'MWInit::compiledPath' || $requirePath == 'MWInit::interpretedPath' ) ) { |
| 690 | + $requirePath = "$IP/"; |
| 691 | + } elseif ( ( $token != '(' ) || $requirePath != '' ) { |
689 | 692 | $requirePath .= $token[0]; |
690 | 693 | } |
691 | 694 | } else if ( in_array( $token[0], array( T_CONSTANT_ENCAPSED_STRING, T_ENCAPSED_AND_WHITESPACE ) ) ) { |
— | — | @@ -895,7 +898,7 @@ |
896 | 899 | if ( $globalData[1] <= $this->mBraces ) |
897 | 900 | continue; # In scope |
898 | 901 | |
899 | | - # global $x still affects the variable after the endo of the |
| 902 | + # global $x still affects the variable after the end of the |
900 | 903 | # conditional, but only if the condition was true. |
901 | 904 | # We keep in the safe side and only consider it defined inside |
902 | 905 | # the if block (see r69883). |