PendingProcess
class PendingProcess (View source)
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
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 environent 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.
Specify the fake process result handlers for the pending process.
Resolve the given fake handler for a synchronous process.
Resolve the given fake handler for an asynchronous process.
Details
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.