2022-02-23 15:58:18 +00:00
|
|
|
<?php declare(strict_types=1);
|
2011-09-29 21:05:30 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This file is part of Composer.
|
|
|
|
*
|
|
|
|
* (c) Nils Adermann <naderman@naderman.de>
|
|
|
|
* Jordi Boggiano <j.boggiano@seld.be>
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Composer\Downloader;
|
|
|
|
|
2019-01-17 16:12:33 +00:00
|
|
|
use Composer\Package\PackageInterface;
|
2022-02-22 21:10:52 +00:00
|
|
|
use React\Promise\PromiseInterface;
|
2019-01-17 16:12:33 +00:00
|
|
|
|
2011-09-29 21:05:30 +00:00
|
|
|
/**
|
|
|
|
* Downloader for tar files: tar, tar.gz or tar.bz2
|
|
|
|
*
|
|
|
|
* @author Kirill chEbba Chebunin <iam@chebba.org>
|
|
|
|
*/
|
2012-02-17 22:10:02 +00:00
|
|
|
class TarDownloader extends ArchiveDownloader
|
2011-09-29 21:05:30 +00:00
|
|
|
{
|
|
|
|
/**
|
2021-10-27 13:47:42 +00:00
|
|
|
* @inheritDoc
|
2011-09-29 21:05:30 +00:00
|
|
|
*/
|
2022-02-22 21:10:52 +00:00
|
|
|
protected function extract(PackageInterface $package, string $file, string $path): PromiseInterface
|
2011-09-29 21:05:30 +00:00
|
|
|
{
|
|
|
|
// Can throw an UnexpectedValueException
|
|
|
|
$archive = new \PharData($file);
|
2012-04-10 10:44:21 +00:00
|
|
|
$archive->extractTo($path, null, true);
|
2021-03-09 14:49:40 +00:00
|
|
|
|
2022-03-18 08:20:42 +00:00
|
|
|
return \React\Promise\resolve(null);
|
2011-09-29 21:05:30 +00:00
|
|
|
}
|
|
|
|
}
|