Index: trunk/tools/code-utils/check-vars.php |
— | — | @@ -638,25 +638,29 @@ |
639 | 639 | /* Try prepending the script folder, for maintenance scripts (but see Maintenance.php:758) */ |
640 | 640 | $requirePath = dirname( $this->mFilename ) . "/" . $requirePath; |
641 | 641 | } |
| 642 | + |
642 | 643 | if ( !file_exists( $requirePath ) ) { |
643 | 644 | if ( strpos( $requirePath, '$' ) === false ) { |
644 | 645 | $this->warning( "Did not found the expected require of $requirePath" ); |
645 | 646 | } |
646 | | - } else if ( isset( self::$mRequireKnownClasses[$requirePath] ) ) { |
647 | | - $this->mKnownFileClasses = array_merge( $this->mKnownFileClasses, self::$mRequireKnownClasses[$requirePath] ); |
648 | | - $this->mKnownFunctions = array_merge( $this->mKnownFunctions, self::$mRequireKnownFunctions[$requirePath] ); |
649 | | - $this->mConstants = array_merge( $this->mConstants, self::$mRequireKnownConstants[$requirePath] ); |
650 | 647 | } else { |
651 | | - $newCheck = new CheckVars; |
652 | | - $newCheck->load( $requirePath, false ); |
653 | | - $newCheck->execute(); |
654 | | - /* Get the classes defined there */ |
655 | | - $this->mKnownFileClasses = array_merge( $this->mKnownFileClasses, $newCheck->mKnownFileClasses ); |
656 | | - $this->mKnownFunctions = array_merge( $this->mKnownFunctions, $newCheck->mKnownFunctions ); |
657 | | - $this->mConstants = array_merge( $this->mConstants, $newCheck->mConstants ); |
658 | | - self::$mRequireKnownClasses[$requirePath] = $newCheck->mKnownFileClasses; |
659 | | - self::$mRequireKnownFunctions[$requirePath] = $newCheck->mKnownFunctions; |
660 | | - self::$mRequireKnownConstants[$requirePath] = $newCheck->mConstants; |
| 648 | + $requirePath = realpath( $requirePath ); |
| 649 | + if ( isset( self::$mRequireKnownClasses[$requirePath] ) ) { |
| 650 | + $this->mKnownFileClasses = array_merge( $this->mKnownFileClasses, self::$mRequireKnownClasses[$requirePath] ); |
| 651 | + $this->mKnownFunctions = array_merge( $this->mKnownFunctions, self::$mRequireKnownFunctions[$requirePath] ); |
| 652 | + $this->mConstants = array_merge( $this->mConstants, self::$mRequireKnownConstants[$requirePath] ); |
| 653 | + } else { |
| 654 | + $newCheck = new CheckVars; |
| 655 | + $newCheck->load( $requirePath, false ); |
| 656 | + $newCheck->execute(); |
| 657 | + /* Get the classes defined there */ |
| 658 | + $this->mKnownFileClasses = array_merge( $this->mKnownFileClasses, $newCheck->mKnownFileClasses ); |
| 659 | + $this->mKnownFunctions = array_merge( $this->mKnownFunctions, $newCheck->mKnownFunctions ); |
| 660 | + $this->mConstants = array_merge( $this->mConstants, $newCheck->mConstants ); |
| 661 | + self::$mRequireKnownClasses[$requirePath] = $newCheck->mKnownFileClasses; |
| 662 | + self::$mRequireKnownFunctions[$requirePath] = $newCheck->mKnownFunctions; |
| 663 | + self::$mRequireKnownConstants[$requirePath] = $newCheck->mConstants; |
| 664 | + } |
661 | 665 | } |
662 | 666 | $this->mStatus = $this->mStatus - self::IN_REQUIRE_WAITING; |
663 | 667 | continue; |