DownloaderInterface.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 interface.
  15. *
  16. * @author Konstantin Kudryashov <ever.zet@gmail.com>
  17. * @author Jordi Boggiano <j.boggiano@seld.be>
  18. */
  19. interface DownloaderInterface
  20. {
  21. /**
  22. * Returns installation source (either source or dist).
  23. *
  24. * @return string "source" or "dist"
  25. */
  26. public function getInstallationSource();
  27. /**
  28. * Downloads specific package into specific folder.
  29. *
  30. * @param PackageInterface $package package instance
  31. * @param string $path download path
  32. */
  33. public function download(PackageInterface $package, $path);
  34. /**
  35. * Updates specific package in specific folder from initial to target version.
  36. *
  37. * @param PackageInterface $initial initial package
  38. * @param PackageInterface $target updated package
  39. * @param string $path download path
  40. */
  41. public function update(PackageInterface $initial, PackageInterface $target, $path);
  42. /**
  43. * Removes specific package from specific folder.
  44. *
  45. * @param PackageInterface $package package instance
  46. * @param string $path download path
  47. */
  48. public function remove(PackageInterface $package, $path);
  49. /**
  50. * Sets whether to output download progress information or not
  51. *
  52. * @param bool $outputProgress
  53. * @return DownloaderInterface
  54. */
  55. public function setOutputProgress($outputProgress);
  56. }