DownloaderInterface.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. */
  18. interface DownloaderInterface
  19. {
  20. /**
  21. * Downloads specific package into specific folder.
  22. *
  23. * @param PackageInterface $package package instance
  24. * @param string $path download path
  25. * @param string $url download url
  26. * @param string $checksum package checksum (for dists)
  27. */
  28. function download(PackageInterface $package, $path, $url, $checksum = null);
  29. /**
  30. * Updates specific package in specific folder from initial to target version.
  31. *
  32. * @param PackageInterface $initial initial package
  33. * @param PackageInterface $target updated package
  34. * @param string $path download path
  35. */
  36. function update(PackageInterface $initial, PackageInterface $target, $path);
  37. /**
  38. * Removes specific package from specific folder.
  39. *
  40. * @param PackageInterface $package package instance
  41. * @param string $path download path
  42. */
  43. function remove(PackageInterface $package, $path);
  44. }