-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check for MD5 changes when deploying static content #4295
Check for MD5 changes when deploying static content #4295
Conversation
} | ||
|
||
return true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return md5_file($source) === md5_file($destination)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually I don't think shortening it will be best. In the future the md5_file()
lines might need to be replaced with a wrapped class call (currently $this->filesystem
does not support MD5 calls). So I think the explicit call consumes more lines indeed, but allows for better modification in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, the "let's make present just a little bit worse to favour a future which might not come as soon as I think it would" argument. Fine with me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm ;)
Travis failed because it inserted a dummy file (/root/something) as source which was not readable. Updated PR now includes also a check for existence of the source file. |
@jissereitsma Hey. Travis fails on code style checks in your code. Also please make sure to update your fork to latest develop - there were some failures previously caused by our tests. |
@piotrekkaminski Thanks for notifying me. I've looked into this, and am unable to solve it. The unit test fails with the call to |
@jissereitsma could you update to latest develop? @piotrekkaminski could you merge afterwards? |
@jissereitsma can you please update this branch with the latest develop? |
@jissereitsma I've done some testing and I think that I would be much faster (about 10x) to check filemtime than md5_file. If any original file is changed than it would have bigger mtime than the file in static folder and than you could check md5 to see if file is changed. Here is the output of my test script:
|
Closing this PR due to inactivity. |
The old
Publisher
is copying files only from their original source to thepub/static
folder, if the destination does not exist. This PR changes this, so that for each file the MD5 sum is used as well. Most developers do not want to wipe out files inpub/static
when changing file. This fixes that for them. There are other patches underway as well (@denisristic) to add arguments to the deployment command to specify which parts need to be refreshed.