1
0
Fork 0
composer/src/Composer/Downloader/TarDownloader.php

37 lines
901 B
PHP
Raw Normal View History

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;
use Composer\Package\PackageInterface;
2022-02-22 21:10:52 +00:00
use React\Promise\PromiseInterface;
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>
*/
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);
$archive->extractTo($path, null, true);
return \React\Promise\resolve(null);
2011-09-29 21:05:30 +00:00
}
}