davidrjonas / composer-lock-diff

See what has changed after a composer update
MIT License
274 stars 18 forks source link

from and to: allow http(s) comparison #16

Closed wiese closed 5 years ago

wiese commented 6 years ago

Enable the use of http(s) URLs to identify lock files. Files are already loaded via generic stream wrappers but not all stream wrappers, http(s) in particular[0], support the used checking ("stat") for the existence of the file.

Would be happy to supply testing and refactoring beyond this naive solution once the maintainer outlines some paradigms.

Sample use:

./composer-lock-diff --from https://github.com/wikimedia/mediawiki-vendor/raw/REL1_29/composer.lock --to https://github.com/wikimedia/mediawiki-vendor/raw/REL1_30/composer.lock

Please note that, for github repositories, you need to provide URLs of the "raw" version of files to ensure a comparison can be performed.

[0] https://secure.php.net/manual/en/wrappers.http.php#refsect1-wrappers.http-options

wiese commented 6 years ago

@davidrjonas Please let me know if you consider this useful at all or require changes for it to make it into the main line. Thank you.

davidrjonas commented 5 years ago

Hi Weise, sorry it has taken me so long to get to this. I've been unavailable due to health issues. All good now though!

Thanks for this fix. I think just detecting the format of $fileish will be enough, no need for a HEAD request. I've added it to the master branch and I'll be tagging a new version soon.

Thanks!