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
On update, automatically delete from filesystem all Piwik files that are not in the latest release #5936
Comments
Check your server error logs, do you find an error listed there? Then look for error in FAQ: http://piwik.org/faq/ |
Yes, but the error isn't there:
(I removed absolute paths here.) |
Nice. That seems to have worked, thanks. |
Maybe we can remove no longer existing files from core and core plugins during update automatically to not have to create such updates everytime? |
+1 for an automatic solution during updates |
shouldn't this be in the next release as otherwise some installations break? |
Mine won't anymore, but ... |
@tsteur moved to 2.5.0 |
Wrote a lot of tests and just tested it for a while to make sure it works which it does in general. Basically I compare all files in the Was not easy to test since there is no beta for it yet. Created by own |
I was just working on an additional update file to remove no longer needed files to remove those files:
Problem is the following: Those files might be added in a future version of Piwik again. Imagine we add a What will happen is that The only solution that seems to work for me is by comparing the new Piwik version with the current Piwik version of the user and remove no longer needed files as explained and implemented above. But users will have to update at least twice until it works (see above). I just tested an update from 2.4.0 to 2.5.0-b2 and those Widget files above still exist but it is not that much of a problem as same widgets that are added multiple times are only shown once. They are defined in Reports and Widgets now because Widgets are not removed. This can be a problem in the future once the widgets are defined differently in Reports and Widgets class. Same for Menu. Any further ideas? Or is solution maybe ok for now? |
…s directories that are no longer present in the new build
…re they only delete the files they are supposed to do
… also brings the advantage to make it better testable. Controller should be always simple/small... removeGoneFiles() is not really testable as it uses the static filesystem and I did not want to make the code ugly to mock it... Looking forward to dependency injection
Good catch and well done for thinking of this important use case ahead! |
…s directories that are no longer present in the new build
…re they only delete the files they are supposed to do
… also brings the advantage to make it better testable. Controller should be always simple/small... removeGoneFiles() is not really testable as it uses the static filesystem and I did not want to make the code ugly to mock it... Looking forward to dependency injection
refs #5936 remove gone files during update
Is it ok to close this issue for now? I've created another issue #5985 to refactor the updater completely one day. Then we can maybe find a solution that will work in all cases. For now it will only work if a user performs an update and then performs an update again. Would be nice to see two betas to actually test it (again). Tested it only with my local instance so far and with custom built latest.zip etc. |
Sure, you can close it, my issue is "fixed" for now. :) |
@tsteur the 2.5.0-b3 was released. Do you want to wait for this release maybe to close it? anyway your call to close this issue or not. Cheers |
Well we could simply reopen it any time and close it now. Would be nice if someone else had a quick look at the code or better the general behavior. The code should work as I have added many tests there (very critical part as we do not want to delete any random files) and I tested it manually as well. This should work but one never knows. So if someone comes a problem into mind why we shouldn't delete no longer needed files in '/core' and '/plugins' that'd be helpful. I can't think of any since we leave all third party plugins untouched. Even the Piwik plugins installed via Marketplace remain untouched. |
there's no file being created or modified in core/ or plugins/ so it's safe to delete all files not in latest release from there (besides third party plugins and themes which should be un-deleted of course ) |
…s. this one is located in the goals plugin now and was moved in 2.3 or 2.4
After having used Piwik since 2011 or 2012, I auto-updated to the newest beta today.
Well, damn.
This happens only for a couple of widgets (the one I had before), deleting and readding them doesn't work. PHP's memory limit is "high enough". ;)
What happened?
The text was updated successfully, but these errors were encountered: