PharDownloader.php 937 B

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