private function decompressArchive($archiveFile)
{
$extractionPath = $this->tmpPath . self::PATH_TO_EXTRACT_LATEST_VERSION;
$extractedArchiveDirectory = $extractionPath . 'piwik';
// Remove previous decompressed archive
if (file_exists($extractedArchiveDirectory)) {
Filesystem::unlinkRecursive($extractedArchiveDirectory, true);
}
$archive = Unzip::factory('PclZip', $archiveFile);
$archiveFiles = $archive->extract($extractionPath);
if (0 == $archiveFiles) {
throw new Exception($this->translator->translate('CoreUpdater_ExceptionArchiveIncompatible', $archive->errorInfo()));
}
if (0 == count($archiveFiles)) {
throw new Exception($this->translator->translate('CoreUpdater_ExceptionArchiveEmpty'));
}
unlink($archiveFile);
return $extractedArchiveDirectory;
}