Skip to content
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

copy file instead of renaming it. #11908

Merged
merged 3 commits into from Sep 18, 2017
Merged

copy file instead of renaming it. #11908

merged 3 commits into from Sep 18, 2017

Conversation

RMastop
Copy link
Contributor

@RMastop RMastop commented Aug 1, 2017

As stated in thread; fixes #5050

Please issue pull request against the 3.x-dev branch only.

Piwik 2 is in LTS mode. This means we do not accept any pull request for 2.x except critical security bugs and major data loss bugs.

If you need to create a pull request for 2.x, then please also create the pull request against the 3.x-dev so we can merge both.

Happy hacking!

@@ -268,7 +268,7 @@ public static function unzipDownloadedFile($path, $unlink = false)
}

$tempFile = GeoIp::getPathForGeoIpDatabase($tempFilename);
rename($tempFile, $oldDbFile);
copy($tempFile, $oldDbFile);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Richard, should we also delete the $tempFile then?
have you had a chance to test this works?

@mattab mattab modified the milestone: 3.1.0 Aug 3, 2017
RMastop and others added 2 commits August 3, 2017 15:30
In most cases the rename is successful, in rare cases the rename cannot be completed. In those cases we do a copy, leaving the $tempFile in place, it will be overwritten during the next  GeoIPAutopudater task.

Tested in both windows and Ubuntu environment.
@mattab mattab merged commit b0d46dc into matomo-org:3.x-dev Sep 18, 2017
@mattab mattab modified the milestones: 3.2.0, 3.1.1 Sep 18, 2017
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Sep 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
2 participants