From: Timo Tijhof Date: Fri, 27 Sep 2013 12:29:38 +0000 (+0200) Subject: less: Use new addParsedFile method, replacing embeddedFiles hack X-Git-Tag: 1.31.0-rc.0~18655 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=93cb656139efbe9325cf868dcd4132354f2db99c;p=lhc%2Fweb%2Fwiklou.git 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 --- 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; }