aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Tijhof <krinklemail@gmail.com>2013-09-27 14:29:38 +0200
committerOri.livneh <ori@wikimedia.org>2013-09-29 05:16:00 +0000
commit93cb656139efbe9325cf868dcd4132354f2db99c (patch)
tree2fc8bcc1d86bf1fb1efd7509b73979536c201c7d
parent217fd4345ada3f9899406bf352219bb795876706 (diff)
downloadmediawikicore-93cb656139efbe9325cf868dcd4132354f2db99c.tar.gz
mediawikicore-93cb656139efbe9325cf868dcd4132354f2db99c.zip
less: Use new addParsedFile method, replacing embeddedFiles hack
Follows-up b67b9e1, lessphp now has a public method to add to the list of files for compilation cache. Change-Id: I62a6c7cdeb34ea742fa7547e3ca10e24ee484b97
-rw-r--r--includes/resourceloader/ResourceLoaderFileModule.php3
-rw-r--r--includes/resourceloader/ResourceLoaderLESSFunctions.php2
-rw-r--r--includes/resourceloader/ResourceLoaderModule.php4
3 files changed, 1 insertions, 8 deletions
diff --git a/includes/resourceloader/ResourceLoaderFileModule.php b/includes/resourceloader/ResourceLoaderFileModule.php
index 23fbf73e24f8..b3622977b54e 100644
--- a/includes/resourceloader/ResourceLoaderFileModule.php
+++ b/includes/resourceloader/ResourceLoaderFileModule.php
@@ -776,9 +776,6 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
$result['files'] = array( $fileName => self::safeFilemtime( $fileName ) );
$result['updated'] = time();
}
- // Tie cache expiry to the names and mtimes of files that were embedded
- // as data URIs in the generated CSS source.
- $result['files'] += $compiler->embeddedFiles;
$this->localFileRefs += array_keys( $result['files'] );
$cache->set( $key, $result, $expire );
return $result['compiled'];
diff --git a/includes/resourceloader/ResourceLoaderLESSFunctions.php b/includes/resourceloader/ResourceLoaderLESSFunctions.php
index 084bb54ff414..08d574c87e19 100644
--- a/includes/resourceloader/ResourceLoaderLESSFunctions.php
+++ b/includes/resourceloader/ResourceLoaderLESSFunctions.php
@@ -62,7 +62,7 @@ class ResourceLoaderLESSFunctions {
$file = realpath( $base . '/' . $url );
$data = CSSMin::encodeImageAsDataURI( $file );
- $less->embeddedFiles[ $file ] = filemtime( $file );
+ $less->addParsedFile( $file );
return 'url(' . $data . ')';
}
}
diff --git a/includes/resourceloader/ResourceLoaderModule.php b/includes/resourceloader/ResourceLoaderModule.php
index da47724d0e8e..822e73cb546f 100644
--- a/includes/resourceloader/ResourceLoaderModule.php
+++ b/includes/resourceloader/ResourceLoaderModule.php
@@ -471,10 +471,6 @@ abstract class ResourceLoaderModule {
foreach ( $wgResourceLoaderLESSFunctions as $name => $func ) {
$less->registerFunction( $name, $func );
}
- // To ensure embedded resources are refreshed when their source files
- // change, track the names and modification times of any files that
- // were embedded as data URIs in the generated CSS source.
- $less->embeddedFiles = array();
return $less;
}