PluginInterface.php 1.2 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\Plugin;
  12. use Composer\Composer;
  13. use Composer\IO\IOInterface;
  14. /**
  15. * Plugin interface
  16. *
  17. * @author Nils Adermann <naderman@naderman.de>
  18. */
  19. interface PluginInterface
  20. {
  21. /**
  22. * Version number of the internal composer-plugin-api package
  23. *
  24. * @var string
  25. */
  26. const PLUGIN_API_VERSION = '2.0.0';
  27. /**
  28. * Apply plugin modifications to Composer
  29. *
  30. * @param Composer $composer
  31. * @param IOInterface $io
  32. */
  33. public function activate(Composer $composer, IOInterface $io);
  34. /**
  35. * Remove any hooks from Composer
  36. *
  37. * @param Composer $composer
  38. * @param IOInterface $io
  39. */
  40. public function deactivate(Composer $composer, IOInterface $io);
  41. /**
  42. * Prepare the plugin to be uninstalled
  43. *
  44. * This will be called after deactivate
  45. *
  46. * @param Composer $composer
  47. * @param IOInterface $io
  48. */
  49. public function uninstall(Composer $composer, IOInterface $io);
  50. }