An Elegent wrapper around Symfony's Process component.
Bot releases are visible (Hide)
Published by TitasGailius almost 3 years ago
Published by TitasGailius over 3 years ago
To use Terminal with PHP 8.x, please upgrade Terminal to the ^1.0
version.
composer.json
to use the latest version of the terminal: "titasgailius/terminal": "^1.0"
.Builder::retry
is now a protected
method. It's very unlikely that you were was using this method..Published by TitasGailius almost 4 years ago
Alternatively you can also check that a given command was not executed. You may accomplish this by calling the Terminal::assertNotExecuted
method after calling Terminal::fake
.
Terminal::fake();
Terminal::assertNotExecuted('php artisan migrate');
Published by TitasGailius over 4 years ago
You may enable or disable TTY mode:
Terminal::enableTty()->run(...);
Terminal::disableTty()->run(...);
You may specify max allowed time since last output:
// Seconds.
Terminal::idleTimeout(20)->run(...);
// Carbon.
Terminal::idleTimeout(Carbon::now()->addSeconds(20))->run(...);
// DateInterval.
Terminal::idleTimeout(new DateInterval('PT20S'))->run(...);
Published by TitasGailius over 4 years ago
Published by TitasGailius over 4 years ago
If you run Terminal from the Laravel's Artisan command, you may send the output to the console by
passing an instance of the Command to the output
method:
public function handle()
{
Terminal::output($this)->run('echo Hello, World');
}
If you run Terminal from the Symfony's Console command, you may send the output to the console by
passing an instance of the OutputInterface to the output
method:
protected function execute(InputInterface $input, OutputInterface $output)
{
Terminal::output($output)->run('echo Hello, World');
}
Published by TitasGailius over 4 years ago
Published by TitasGailius over 4 years ago
Published by TitasGailius over 4 years ago
Published by TitasGailius over 4 years ago
Fixes a bug with "retries" option.
Published by TitasGailius over 4 years ago
There was a typo when proxying missing methods of the Builder instance to the Process instance.
Published by TitasGailius over 4 years ago
This release makes it possible to set input for the Symfony Process:
Terminal::input($input)->run('rm -rf vendor');
Published by TitasGailius over 4 years ago
Published by TitasGailius over 4 years ago
If you need to pass any data to your command line, it's better to bind it using the with
method.
Terminal can escape and prepare the values for you. Reference these values using the {{ $key }}
syntax.
Terminal::with([
'firstname' => 'John',
'lastname' => 'Doe',
])->run('echo Hello, {{ $firstname}} {{ $lastname }}');
Alternatively, you may pass the key-value pair in separate parameters.
Terminal::with('greeting', 'World')
->run('echo Hello, {{ $greeting }}');
Published by TitasGailius over 4 years ago
Initial release