Advertisement
Guest User

Untitled

a guest
May 24th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Command;
  4.  
  5. use Symfony\Component\Console\Command\Command;
  6. use Symfony\Component\Console\Input\InputArgument;
  7. use Symfony\Component\Console\Input\InputInterface;
  8. use Symfony\Component\Console\Input\InputOption;
  9. use Symfony\Component\Console\Output\OutputInterface;
  10.  
  11. class ProcessorCommand extends Command
  12. {
  13. protected function configure()
  14. {
  15. $this->setName('process')
  16. ->addArgument('directories', InputArgument::IS_ARRAY, 'Directories to process')
  17. ->addOption('extension', 'e', InputOption::VALUE_OPTIONAL, 'Filter by extension');
  18. }
  19.  
  20. protected function execute(InputInterface $input, OutputInterface $output)
  21. {
  22. $dirs = $input->getArgument('directories');
  23. $extension = $input->getOption('extension');
  24. foreach ($dirs as $dir) {
  25. $output->writeln(sprintf("<info>Leyendo archivos en %s ..</info>", $dir));
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement