Hash generation from relative path instead of absolute #141
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.
I think that generating hashes from relative path instead of absolute path would allow more usages of this library.
For example, I am working on a website made with Grav CMS, and there's lots of images generation, so first page loads takes lots times (scaling, transforming images etc..). Before deploying in production, I want to ensure that every image has been generated and compiled (to not make the prod verrrry slooww), it does execute
php -S ...
and crawl all the pages withwget -r ...
then doing arsync
theimages/
directory from local to prod.But because the absolute path is used, the pre-generated images on local won't be used by prod. Prod having as base path something like
/opt/sflx/live/
and the local have something like/home/dctremblay/Containers/SFLxNG/build/live
. If relative path is used instead of absolute, this trick would work. The commit introduces this fix.If you have further questions do not hesitate, thank you very much and have a great day !