From 93cb656139efbe9325cf868dcd4132354f2db99c Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Fri, 27 Sep 2013 14:29:38 +0200 Subject: [PATCH] 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 --- includes/resourceloader/ResourceLoaderFileModule.php | 3 --- includes/resourceloader/ResourceLoaderLESSFunctions.php | 2 +- includes/resourceloader/ResourceLoaderModule.php | 4 ---- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/includes/resourceloader/ResourceLoaderFileModule.php b/includes/resourceloader/ResourceLoaderFileModule.php index 23fbf73e24..b3622977b5 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 084bb54ff4..08d574c87e 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 da47724d0e..822e73cb54 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; } -- 2.20.1