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|null | $timeout | The maximum number of seconds the process may run. |
|
| int|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 16
protected Closure|null
guardProcessOutput(Process $process, callable|null $output)
Stop the process if its output callback fails.
at line 97
__construct(Factory $factory)
Create a new pending process instance.
at line 105
PendingProcess
command(array|string $command)
Specify the command that will invoke the process.
at line 115
PendingProcess
path(string $path)
Specify the working directory of the process.
at line 125
PendingProcess
timeout(CarbonInterval|int $timeout)
Specify the maximum number of seconds the process may run.
at line 135
PendingProcess
idleTimeout(CarbonInterval|int $timeout)
Specify the maximum number of seconds a process may go without returning output.
at line 145
PendingProcess
forever()
Indicate that the process may run forever without timing out.
at line 157
PendingProcess
env(array $environment)
Set the additional environment variables for the process.
at line 169
PendingProcess
input(mixed $input)
Set the standard input that should be provided when invoking the process.
at line 179
PendingProcess
quietly()
Disable output for the process.
at line 189
PendingProcess
tty(bool $tty = true)
Enable TTY mode for the process.
at line 201
PendingProcess
options(array $options)
Set the "proc_open" options that should be used when invoking the process.
at line 214
ProcessResult
run(array|string|null $command = null, callable|null $output = null)
Run the process.
at line 241
InvokedProcess
start(array|string|null $command = null, callable|null $output = null)
Start the process in the background.
The caller must wait for or stop the process before its owning coroutine exits.
at line 262
protected Process
toSymfonyProcess(array|string|null $command)
Get a Symfony Process instance from the current pending command.
at line 299
bool
supportsTty()
Determine whether TTY is supported on the current operating system.
at line 309
PendingProcess
withFakeHandlers(array $fakeHandlers)
Specify the fake process result handlers for the pending process.
at line 319
protected callable|null
fakeFor(string $command)
Get the fake handler for the given command, if applicable.
at line 330
protected ProcessResult
resolveSynchronousFake(string $command, Closure $fake)
Resolve the given fake handler for a synchronous process.
at line 357
protected InvokedProcess
resolveAsynchronousFake(string $command, callable|null $output, Closure $fake)
Resolve the given fake handler for an asynchronous process.