The `Tar` class is perfectly able to handle compressed tar archives, no need to
explicitly extract.
}
$file->close();
- // unzip tar
- $this->archive = self::unzipPackageArchive($tmpFile);
-
- return $this->archive;
+ return $tmpFile;
}
/**
return $filename;
}
- /**
- * Unzips compressed package archives and returns the temporary file name.
- *
- * @param string $archive filename
- * @return string
- */
- public static function unzipPackageArchive($archive)
- {
- if (!FileUtil::isURL($archive)) {
- $tar = new Tar($archive);
- $tar->close();
- if ($tar->isZipped()) {
- $tmpName = FileUtil::getTemporaryFilename('package_');
- if (FileUtil::uncompressFile($archive, $tmpName)) {
- return $tmpName;
- }
- }
- }
-
- return $archive;
- }
-
/**
* Returns a list of packages which exclude this package.
*