PharDownloader.php 962 B

1234567891011121314151617181920212223242526272829303132333435363738
  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 phar files
  15. *
  16. * @author Kirill chEbba Chebunin <iam@chebba.org>
  17. */
  18. class PharDownloader extends FileDownloader
  19. {
  20. /**
  21. * {@inheritDoc}
  22. */
  23. protected function extract($file, $path)
  24. {
  25. // Can throw an UnexpectedValueException
  26. $archive = new \Phar($file);
  27. $archive->extractTo($path);
  28. /* TODO: handle openssl signed phars
  29. * https://github.com/composer/composer/pull/33#issuecomment-2250768
  30. * https://github.com/koto/phar-util
  31. * http://blog.kotowicz.net/2010/08/hardening-php-how-to-securely-include.html
  32. */
  33. }
  34. }