diff options
author | Stefan Giehl <stefan@matomo.org> | 2020-11-09 11:40:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-09 11:40:43 +0300 |
commit | 3d8f8cad71615c97c47ce3454479d24292dd5782 (patch) | |
tree | 5a292c45b31cec11dce0994ce7e43e3714a7b587 /plugins/GeoIp2 | |
parent | b5eac2c5271bc0c586fb8fd3ef93c8d6a7062ec3 (diff) |
Download GeoIP files always to tmp directory (#16677)
Diffstat (limited to 'plugins/GeoIp2')
-rw-r--r-- | plugins/GeoIp2/Controller.php | 4 | ||||
-rw-r--r-- | plugins/GeoIp2/GeoIP2AutoUpdater.php | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/plugins/GeoIp2/Controller.php b/plugins/GeoIp2/Controller.php index 2de183067e..17b451eb19 100644 --- a/plugins/GeoIp2/Controller.php +++ b/plugins/GeoIp2/Controller.php @@ -36,7 +36,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin if ($_SERVER["REQUEST_METHOD"] == "POST") { $this->checkTokenInUrl(); Json::sendHeaderJSON(); - $outputPath = GeoIp2::getPathForGeoIpDatabase('DBIP-City.mmdb') . '.gz'; + $outputPath = GeoIP2AutoUpdater::getTemporaryFolder('DBIP-City.mmdb') . '.gz'; try { $result = Http::downloadChunk( $url = GeoIp2::getDbIpLiteUrl(), @@ -146,7 +146,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin $url = GeoIP2AutoUpdater::getConfiguredUrl($key); $filename = GeoIP2AutoUpdater::getZippedFilenameToDownloadTo($url, $key, GeoIP2AutoUpdater::getGeoIPUrlExtension($url)); - $outputPath = GeoIp2::getPathForGeoIpDatabase($filename); + $outputPath = GeoIP2AutoUpdater::getTemporaryFolder($filename); // download part of the file $result = Http::downloadChunk( diff --git a/plugins/GeoIp2/GeoIP2AutoUpdater.php b/plugins/GeoIp2/GeoIP2AutoUpdater.php index f4be4291b2..32d6af210e 100644 --- a/plugins/GeoIp2/GeoIP2AutoUpdater.php +++ b/plugins/GeoIp2/GeoIP2AutoUpdater.php @@ -190,7 +190,7 @@ class GeoIP2AutoUpdater extends Task Log::info("GeoIP2AutoUpdater: successfully updated GeoIP 2 database '%s'", $url); } - protected static function getTemporaryFolder($file) + public static function getTemporaryFolder($file) { return \Piwik\Container\StaticContainer::get('path.tmp') . '/latest/' . $file; } |