PendingProcess
class PendingProcess
Traits
Properties
| protected Factory | $factory | The process factory instance. |
|
| null|array<array-key, string>|string | $command | The command to invoke the process. |
|
| string|null | $path | The working directory of the process. |
|
| int|float|null | $timeout | The maximum number of seconds the process may run. |
|
| int|float|null | $idleTimeout | The maximum number of seconds the process may go without returning output. |
|
| array<string, false|string|Stringable> | $environment | The additional environment variables for the process. |
|
| null|bool|float|int|resource|string|Traversable | $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<string, mixed> | $options | The options that will be passed to "proc_open". |
|
| protected array<string, callable> | $fakeHandlers | The registered fake handler callbacks. |
Methods
Apply the callback if the given "value" is (or resolves to) truthy.
Apply the callback if the given "value" is (or resolves to) falsy.
Stop the process if its output callback fails.
Specify the command that will invoke the process.
Specify the working directory of the process.
Specify the maximum number of seconds the process may run.
Specify the maximum number of seconds a process may go without returning output.
Indicate that the process may run forever without timing out.
Set the additional environment variables for the process.
Set the standard input that should be provided when invoking the process.
Disable output for the process.
Enable TTY mode for the process.
Set the "proc_open" options that should be used when invoking the process.
Run the process.
Start the process in the background.
Get a Symfony Process instance from the current pending command.
Determine whether TTY is supported on the current operating system.
Specify the fake process result handlers for the pending process.
Get the fake handler for the given command, if applicable.
Resolve the given fake handler for a synchronous process.
Resolve the given fake handler for an asynchronous process.
Details
in
Conditionable at line 23
mixed
when(mixed $value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) truthy.
in
Conditionable at line 56
mixed
unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) falsy.
in
GuardsProcessOutput at line 17
protected Closure|null
guardProcessOutput(Process $process, callable|null $output)
Stop the process if its output callback fails.
at line 99
__construct(Factory $factory)
Create a new pending process instance.
at line 109
PendingProcess
command(array|string $command)
Specify the command that will invoke the process.
at line 121
PendingProcess
path(string $path)
Specify the working directory of the process.
at line 133
PendingProcess
timeout(CarbonInterval|int $timeout)
Specify the maximum number of seconds the process may run.
at line 145
PendingProcess
idleTimeout(CarbonInterval|int $timeout)
Specify the maximum number of seconds a process may go without returning output.
at line 157
PendingProcess
forever()
Indicate that the process may run forever without timing out.
at line 170
PendingProcess
env(array $environment)
Set the additional environment variables for the process.
at line 183
PendingProcess
input(mixed $input)
Set the standard input that should be provided when invoking the process.
at line 195
PendingProcess
quietly()
Disable output for the process.
at line 207
PendingProcess
tty(bool $tty = true)
Enable TTY mode for the process.
at line 220
PendingProcess
options(array $options)
Set the "proc_open" options that should be used when invoking the process.
at line 233
ProcessResult
run(array|string|null $command = null, callable|null $output = null)
Run the process.
at line 266
InvokedProcess
start(array|string|null $command = null, callable|null $output = null)
Start the process in the background.
Start the process in the coroutine that will wait for it. It is stopped when that coroutine exits, unless the create_new_console option explicitly detaches it.
at line 311
protected Process
toSymfonyProcess(array|string|null $command)
Get a Symfony Process instance from the current pending command.
at line 348
bool
supportsTty()
Determine whether TTY is supported on the current operating system.
at line 359
PendingProcess
withFakeHandlers(array $fakeHandlers)
Specify the fake process result handlers for the pending process.
at line 369
protected callable|null
fakeFor(string $command)
Get the fake handler for the given command, if applicable.
at line 381
protected ProcessResult
resolveSynchronousFake(string $command, Closure $fake)
Resolve the given fake handler for a synchronous process.
at line 409
protected InvokedProcess
resolveAsynchronousFake(string $command, callable|null $output, Closure $fake)
Resolve the given fake handler for an asynchronous process.