DownloaderInterface.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. 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. 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. 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. function remove(PackageInterface $package, $path);
  49. }