TarDownloader.php 737 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /*
  3. * This file is part of Composer.
  4. *
  5. * (c) Nils Adermann <naderman@naderman.de>
  6. * Jordi Boggiano <j.boggiano@seld.be>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. namespace Composer\Downloader;
  12. use Composer\Package\PackageInterface;
  13. /**
  14. * Downloader for tar files: tar, tar.gz or tar.bz2
  15. *
  16. * @author Kirill chEbba Chebunin <iam@chebba.org>
  17. */
  18. class TarDownloader extends ArchiveDownloader
  19. {
  20. /**
  21. * {@inheritDoc}
  22. */
  23. protected function extract($file, $path)
  24. {
  25. // Can throw an UnexpectedValueException
  26. $archive = new \PharData($file);
  27. $archive->extractTo($path, null, true);
  28. }
  29. }