CommandProvider.php 655 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace Installer;
  3. use Composer\Plugin\Capability\CommandProvider;
  4. use Symfony\Component\Console\Input\InputInterface;
  5. use Symfony\Component\Console\Output\OutputInterface;
  6. use Composer\Command\BaseCommand;
  7. class CommandProvider implements CommandProvider
  8. {
  9. public function __construct(array $args)
  10. {
  11. }
  12. public function getCommands()
  13. {
  14. return array(new Command);
  15. }
  16. }
  17. class Command extends BaseCommand
  18. {
  19. protected function configure()
  20. {
  21. $this->setName('custom-plugin-command');
  22. }
  23. protected function execute(InputInterface $input, OutputInterface $output)
  24. {
  25. return 5;
  26. }
  27. }