Ori.livneh has uploaded a new change for review.
https://gerrit.wikimedia.org/r/86360
Change subject: Use lessc::addParsedFile instead of custom attribute
......................................................................
Use lessc::addParsedFile instead of custom attribute
'embeddedFiles' was a custom property we set on the LESS compiler instance to
track the files we embedded in the generated the CSS. As of change Idffe6946f,
lessc::addParsedFile is now a public method, so the need for a custom property
is gone.
Change-Id: I7714b5714dcc7c26db1164fb11bd1357b0da4650
---
M includes/resourceloader/ResourceLoaderFileModule.php
M includes/resourceloader/ResourceLoaderLESSFunctions.php
M includes/resourceloader/ResourceLoaderModule.php
3 files changed, 1 insertion(+), 6 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/60/86360/1
diff --git a/includes/resourceloader/ResourceLoaderFileModule.php
b/includes/resourceloader/ResourceLoaderFileModule.php
index 3b81b11..bcf879f 100644
--- a/includes/resourceloader/ResourceLoaderFileModule.php
+++ b/includes/resourceloader/ResourceLoaderFileModule.php
@@ -774,7 +774,6 @@
}
// 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 084bb54..08d574c 100644
--- a/includes/resourceloader/ResourceLoaderLESSFunctions.php
+++ b/includes/resourceloader/ResourceLoaderLESSFunctions.php
@@ -62,7 +62,7 @@
$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 1119cdb..ecd01c6 100644
--- a/includes/resourceloader/ResourceLoaderModule.php
+++ b/includes/resourceloader/ResourceLoaderModule.php
@@ -470,10 +470,6 @@
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;
}
--
To view, visit https://gerrit.wikimedia.org/r/86360
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7714b5714dcc7c26db1164fb11bd1357b0da4650
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits