2017 © Pedro Peláez
 

library symfony-command-runner

Run multiple commands easily

image

fichtme/symfony-command-runner

Run multiple commands easily

  • Friday, November 24, 2017
  • by Fichtme
  • Repository
  • 1 Watchers
  • 0 Stars
  • 123 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 186 % Grown

The README.md

symfony-command-runner

Run multiple commands in another process and wait for completion., (*1)

Usage

(new CommandRunner([
            new Process("my:command -q"),
            new Process("my:command2 -q"),
            new Process("my:command3 -q").
            new Process("my:command4 -q"),
            new Process("my:command5 -q"),
            new Process("my:command6 -q --env=$env"),
        ]))
            ->continueOnError(true)
            ->setIO($this->io)
            ->setLimit(3)
            ->run();

Possible use case:


/** * Class UpdateCommand * * @package App\Command\Update */ class UpdateCommand extends AbstractCommand { /** * Configures the current command. */ protected function configure() { $this->setName('app:update') ->setDescription('execute updates'); } /** * @param InputInterface $input * @param OutputInterface $output * * @return int */ protected function execute(InputInterface $input, OutputInterface $output): int { $this->io->writeln('Running update scripts'); sleep(5); # Sleep so user can abort update (new CommandRunner([ new Process("my:command -q"), new Process("my:command2 -q"), new Process("my:command3 -q"). new Process("my:command4 -q"), new Process("my:command5 -q"), new Process("my:command6 -q"), ])) ->continueOnError(true) ->setIO($this->io) ->setLimit(3) ->run(); return 0; } }

The Versions

24/11 2017

dev-master

9999999-dev

Run multiple commands easily

  Sources   Download

MIT

The Requires

 

by Henny Krijnen

commands symfony

24/11 2017

0.1.0

0.1.0.0

Run multiple commands easily

  Sources   Download

MIT

The Requires

 

by Henny Krijnen

commands symfony