private function downloadArchive($version, $url)
{
$path = $this->tmpPath . self::PATH_TO_EXTRACT_LATEST_VERSION;
$archiveFile = $path . 'latest.zip';
Filechecks::dieIfDirectoriesNotWritable(array($path));
$url .= '?cb=' . $version;
try {
Http::fetchRemoteFile($url, $archiveFile, 0, self::DOWNLOAD_TIMEOUT);
} catch (Exception $e) {
// We throw a specific exception allowing to offer HTTP download if HTTPS failed
throw new ArchiveDownloadException($e);
}
return $archiveFile;
}