r88489 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88488‎ | r88489 | r88490 >
Date:21:34, 20 May 2011
Author:platonides
Status:deferred
Tags:
Comment:
Use the real paths
Modified paths:
  • /trunk/tools/code-utils/check-vars.php (modified) (history)

Diff [purge]

Index: trunk/tools/code-utils/check-vars.php
@@ -638,25 +638,29 @@
639639 /* Try prepending the script folder, for maintenance scripts (but see Maintenance.php:758) */
640640 $requirePath = dirname( $this->mFilename ) . "/" . $requirePath;
641641 }
 642+
642643 if ( !file_exists( $requirePath ) ) {
643644 if ( strpos( $requirePath, '$' ) === false ) {
644645 $this->warning( "Did not found the expected require of $requirePath" );
645646 }
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] );
650647 } 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+ }
661665 }
662666 $this->mStatus = $this->mStatus - self::IN_REQUIRE_WAITING;
663667 continue;

Status & tagging log