r72221 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72220‎ | r72221 | r72222 >
Date:20:10, 2 September 2010
Author:tparscal
Status:ok
Tags:
Comment:
Using $IP for accessing resources/statup.js and checking mtime as well.
Modified paths:
  • /branches/resourceloader/phase3/includes/ResourceLoaderModule.php (modified) (history)

Diff [purge]

Index: branches/resourceloader/phase3/includes/ResourceLoaderModule.php
@@ -595,16 +595,17 @@
596596 private $modifiedTime = null;
597597
598598 public function getScript( $lang, $skin, $debug ) {
599 - return file_get_contents( 'resources/startup.js' );
 599+ global $IP;
 600+ return file_get_contents( "$IP/resources/startup.js" );
600601 }
601602
602603 public function getModifiedTime( $lang, $skin, $debug ) {
 604+ global $IP;
603605 if ( !is_null( $this->modifiedTime ) ) {
604606 return $this->modifiedTime;
605607 }
606 -
607608 // HACK getHighestModifiedTime() calls this function, so protect against infinite recursion
608 - $this->modifiedTime = 1;
 609+ $this->modifiedTime = filemtime( "$IP/resources/startup.js" );
609610 $this->modifiedTime = ResourceLoader::getHighestModifiedTime( $lang, $skin, $debug );
610611 return $this->modifiedTime;
611612 }

Status & tagging log