Index: branches/resourceloader/phase3/includes/ResourceLoaderModule.php |
— | — | @@ -396,7 +396,7 @@ |
397 | 397 | $this->loaders, |
398 | 398 | $this->getFileDependencies( $skin ) |
399 | 399 | ); |
400 | | - $this->modifiedTime = max( array_map( 'filemtime', $files ) ); |
| 400 | + $this->modifiedTime = max( array_map( 'filemtime', array_map( array( __CLASS__, 'remapFilename' ), $files ) ) ); |
401 | 401 | return $this->modifiedTime; |
402 | 402 | } |
403 | 403 | |
— | — | @@ -513,7 +513,7 @@ |
514 | 514 | * @return string Concatenated contents of $files |
515 | 515 | */ |
516 | 516 | protected static function concatScripts( $files ) { |
517 | | - return implode( "\n", array_map( 'file_get_contents', array_unique( (array) $files ) ) ); |
| 517 | + return implode( "\n", array_map( 'file_get_contents', array_map( array( __CLASS__, 'remapFilename' ), array_unique( (array) $files ) ) ) ); |
518 | 518 | } |
519 | 519 | |
520 | 520 | /** |
— | — | @@ -527,13 +527,23 @@ |
528 | 528 | } |
529 | 529 | |
530 | 530 | /** |
| 531 | + * Remap a relative to $IP. Used as a callback for array_map() |
| 532 | + * @param $file string File name |
| 533 | + * @return string $IP/$file |
| 534 | + */ |
| 535 | + protected static function remapFilename( $file ) { |
| 536 | + global $IP; |
| 537 | + return "$IP/$file"; |
| 538 | + } |
| 539 | + |
| 540 | + /** |
531 | 541 | * Get the contents of a CSS file and run it through CSSMin::remap(). |
532 | 542 | * This wrapper is needed so we can use array_map() in concatStyles() |
533 | 543 | * @param $file string File name |
534 | 544 | * @return string Remapped CSS |
535 | 545 | */ |
536 | 546 | protected static function remapStyle( $file ) { |
537 | | - return CSSMin::remap( file_get_contents( $file ), dirname( $file ) ); |
| 547 | + return CSSMin::remap( file_get_contents( self::remapFilename( $file ) ), dirname( $file ) ); |
538 | 548 | } |
539 | 549 | } |
540 | 550 | |