Append version to dist URL to force re-download #20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist:
Description
Currently, this Composer plugin reuses the same cache key regardless of the specified package version because the package's
dist.url
does not change between version bumps.Based on Composer's documentation for packages that do not support Composer (and this snippet from the source code) the
dist.url
is expected to reflect the version:This means if you were to change the
dist.url
(any random URI) along with a version bump, you'd see that Composer would use a new cache key with that new version.Since the real archive files for these premium WordPress plugins are hidden behind complex URLs, API response keys, and often expire, this Composer plugin needs to assign some kind of unique stand-in for the
dist.url
to serve as a unique cache key for each version.How has this been tested?
I've tested this on a client project that uses Advanced Custom Fields Pro, Gravity Forms, and Polylang Pro.
Types of changes
This pull request introduces a change that when a download URL is resolved, the package's unique name (name + normlized version) is appended to the internal
dist.url
(as a hashed URI fragment) in order to generate a new cache key to trigger the download of the package update.Similar to ffraenz/private-composer-installer.
Resolves #7, #18