TarDownloader.php 697 B

12345678910111213141516171819202122232425262728293031
  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. /**
  13. * Downloader for tar files: tar, tar.gz or tar.bz2
  14. *
  15. * @author Kirill chEbba Chebunin <iam@chebba.org>
  16. */
  17. class TarDownloader extends ArchiveDownloader
  18. {
  19. /**
  20. * {@inheritDoc}
  21. */
  22. protected function extract($file, $path)
  23. {
  24. // Can throw an UnexpectedValueException
  25. $archive = new \PharData($file);
  26. $archive->extractTo($path, null, true);
  27. }
  28. }