FooLock2Command.php 613 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. use Symfony\Component\Console\Command\Command;
  3. use Symfony\Component\Console\Command\LockableTrait;
  4. use Symfony\Component\Console\Input\InputInterface;
  5. use Symfony\Component\Console\Output\OutputInterface;
  6. class FooLock2Command extends Command
  7. {
  8. use LockableTrait;
  9. protected function configure()
  10. {
  11. $this->setName('foo:lock2');
  12. }
  13. protected function execute(InputInterface $input, OutputInterface $output)
  14. {
  15. try {
  16. $this->lock();
  17. $this->lock();
  18. } catch (LogicException $e) {
  19. return 1;
  20. }
  21. return 2;
  22. }
  23. }