WritableRepositoryInterface.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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\Repository;
  12. use Composer\Package\PackageInterface;
  13. use Composer\Installer\InstallationManager;
  14. /**
  15. * Writable repository interface.
  16. *
  17. * @author Konstantin Kudryashov <ever.zet@gmail.com>
  18. */
  19. interface WritableRepositoryInterface extends RepositoryInterface
  20. {
  21. /**
  22. * Writes repository (f.e. to the disc).
  23. *
  24. * @param bool $devMode Whether dev requirements were included or not in this installation
  25. */
  26. public function write($devMode, InstallationManager $installationManager);
  27. /**
  28. * Adds package to the repository.
  29. *
  30. * @param PackageInterface $package package instance
  31. */
  32. public function addPackage(PackageInterface $package);
  33. /**
  34. * Removes package from the repository.
  35. *
  36. * @param PackageInterface $package package instance
  37. */
  38. public function removePackage(PackageInterface $package);
  39. /**
  40. * Get unique packages (at most one package of each name), with aliases resolved and removed.
  41. *
  42. * @return PackageInterface[]
  43. */
  44. public function getCanonicalPackages();
  45. /**
  46. * Forces a reload of all packages.
  47. */
  48. public function reload();
  49. }