On this page
PendingProcess
class PendingProcess (View source)
Traits
Properties
protected Factory | $factory | The process factory instance. |
|
array<array-key,string>|string|null | $command | The command to invoke the process. |
|
string|null | $path | The working directory of the process. |
|
int|null | $timeout | The maximum number of seconds the process may run. |
|
int | $idleTimeout | The maximum number of seconds the process may go without returning output. |
|
array | $environment | The additional environment variables for the process. |
|
string|int|float|bool|resource|Traversable|null | $input | The standard input data that should be piped into the command. |
|
bool | $quietly | Indicates whether output should be disabled for the process. |
|
bool | $tty | Indicates if TTY mode should be enabled. |
|
array | $options | The options that will be passed to "proc_open". |
|
protected array | $fakeHandlers | The registered fake handler callbacks. |
Methods
$this|TWhenReturnType | when($value = null, callable $callback = null, callable $default = null) Apply the callback if the given "value" is (or resolves to) truthy. |
from Conditionable |
$this|TUnlessReturnType | unless($value = null, callable $callback = null, callable $default = null) Apply the callback if the given "value" is (or resolves to) falsy. |
from Conditionable |
void | __construct(Factory $factory) Create a new pending process instance. |
|
$this | command(array|string $command) Specify the command that will invoke the process. |
|
$this | path(string $path) Specify the working directory of the process. |
|
$this | timeout(int $timeout) Specify the maximum number of seconds the process may run. |
|
$this | idleTimeout(int $timeout) Specify the maximum number of seconds a process may go without returning output. |
|
$this | forever() Indicate that the process may run forever without timing out. |
|
$this | env(array $environment) Set the additional environent variables for the process. |
|
$this | input(Traversable|resource|string|int|float|bool|null $input) Set the standard input that should be provided when invoking the process. |
|
$this | quietly() Disable output for the process. |
|
$this | tty(bool $tty = true) Enable TTY mode for the process. |
|
$this | options(array $options) Set the "proc_open" options that should be used when invoking the process. |
|
ProcessResult | run(array|string $command = null, callable $output = null) Run the process. |
|
InvokedProcess | start(array|string $command = null, callable $output = null) Start the process in the background. |
|
Process | toSymfonyProcess(array|string|null $command) Get a Symfony Process instance from the current pending command. |
|
$this | withFakeHandlers(array $fakeHandlers) Specify the fake process result handlers for the pending process. |
|
Closure|null | fakeFor(string $command) Get the fake handler for the given command, if applicable. |
|
mixed | resolveSynchronousFake(string $command, Closure $fake) Resolve the given fake handler for a synchronous process. |
|
FakeInvokedProcess | resolveAsynchronousFake(string $command, callable|null $output, Closure $fake) Resolve the given fake handler for an asynchronous process. |
Details
$this|TWhenReturnType when($value = null, callable $callback = null, callable $default = null)
Apply the callback if the given "value" is (or resolves to) truthy.
$this|TUnlessReturnType unless($value = null, callable $callback = null, callable $default = null)
Apply the callback if the given "value" is (or resolves to) falsy.
void __construct(Factory $factory)
Create a new pending process instance.
$this command(array|string $command)
Specify the command that will invoke the process.
$this path(string $path)
Specify the working directory of the process.
$this timeout(int $timeout)
Specify the maximum number of seconds the process may run.
$this idleTimeout(int $timeout)
Specify the maximum number of seconds a process may go without returning output.
$this forever()
Indicate that the process may run forever without timing out.
$this env(array $environment)
Set the additional environent variables for the process.
$this input(Traversable|resource|string|int|float|bool|null $input)
Set the standard input that should be provided when invoking the process.
$this quietly()
Disable output for the process.
$this tty(bool $tty = true)
Enable TTY mode for the process.
$this options(array $options)
Set the "proc_open" options that should be used when invoking the process.
ProcessResult run(array|string $command = null, callable $output = null)
Run the process.
InvokedProcess start(array|string $command = null, callable $output = null)
Start the process in the background.
protected Process toSymfonyProcess(array|string|null $command)
Get a Symfony Process instance from the current pending command.
$this withFakeHandlers(array $fakeHandlers)
Specify the fake process result handlers for the pending process.
protected Closure|null fakeFor(string $command)
Get the fake handler for the given command, if applicable.
protected mixed resolveSynchronousFake(string $command, Closure $fake)
Resolve the given fake handler for a synchronous process.
protected FakeInvokedProcess resolveAsynchronousFake(string $command, callable|null $output, Closure $fake)
Resolve the given fake handler for an asynchronous process.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/10.x/Illuminate/Process/PendingProcess.html