Brion VIBBER has submitted this change and it was merged. Change subject: Rename lessc->embeddedImages to lessc->embeddedFiles ......................................................................
Rename lessc->embeddedImages to lessc->embeddedFiles 'embeddedImages' is a custom property we set on lessc compiler instances to track the set of files that were embedded in the generated source as data URIs. This is so done so we know to regenerate the CSS if the source file for an embedded asset changes. (If my pull request[1] is merged, we won't have to use a custom property at all.) I realized that the property name should be 'embeddedFiles' rather than 'embeddedImages', because it's not just images that can be usefully embedded in CSS, but fonts as well. [1]: https://github.com/leafo/lessphp/pull/472 Change-Id: Ief3afaa23e4532f4a536e0dfef943d4fa20db80d --- M includes/DefaultSettings.php M includes/resourceloader/ResourceLoaderFileModule.php M includes/resourceloader/ResourceLoaderModule.php 3 files changed, 8 insertions(+), 8 deletions(-) Approvals: Brion VIBBER: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 7a1eb22..46d1fd4 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -3355,7 +3355,7 @@ $file = realpath( $base . '/' . $url ); $data = CSSMin::encodeImageAsDataURI( $file ); - $less->embeddedImages[ $file ] = filemtime( $file ); + $less->embeddedFiles[ $file ] = filemtime( $file ); return 'url(' . $data . ')'; }, ); diff --git a/includes/resourceloader/ResourceLoaderFileModule.php b/includes/resourceloader/ResourceLoaderFileModule.php index ead81cc..3b81b11 100644 --- a/includes/resourceloader/ResourceLoaderFileModule.php +++ b/includes/resourceloader/ResourceLoaderFileModule.php @@ -772,9 +772,9 @@ $result['files'] = array( $fileName => self::safeFilemtime( $fileName ) ); $result['updated'] = time(); } - // Tie cache expiry to the names and mtimes of image files that were - // embedded in the generated CSS source. - $result['files'] += $compiler->embeddedImages; + // 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/ResourceLoaderModule.php b/includes/resourceloader/ResourceLoaderModule.php index 226d91c..1119cdb 100644 --- a/includes/resourceloader/ResourceLoaderModule.php +++ b/includes/resourceloader/ResourceLoaderModule.php @@ -470,10 +470,10 @@ foreach ( $wgResourceLoaderLESSFunctions as $name => $func ) { $less->registerFunction( $name, $func ); } - // To ensure embedded images are refreshed when their source files - // change, track the names and modification times of image files that - // were embedded in the generated CSS source. - $less->embeddedImages = array(); + // 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/85775 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ief3afaa23e4532f4a536e0dfef943d4fa20db80d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Ori.livneh <o...@wikimedia.org> Gerrit-Reviewer: Brion VIBBER <br...@wikimedia.org> Gerrit-Reviewer: Jdlrobson <jrob...@wikimedia.org> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits