PendingProcess
Uses
Properties
$command
array |string|null
The command to invoke the process.
$path string|null
The working directory of the process.
$timeout int|null
The maximum number of seconds the process may run.
$idleTimeout int
The maximum number of seconds the process may go without returning output.
$environment array
The additional environment variables for the process.
$input string|int|float|bool|resource|Traversable |null
The standard input data that should be piped into the command.
$quietly bool
Indicates whether output should be disabled for the process.
$tty bool
Indicates if TTY mode should be enabled.
$options array
The options that will be passed to "proc_open".
$fakeHandlers array
The registered fake handler callbacks.
Methods
__construct ( Factory $factory ) : void
Create a new pending process instance.
Parameters
- $factory Factory
command ( $command ) : $this
Specify the command that will invoke the process.
Parameters
-
$command
array
|string
path ( string $path ) : $this
Specify the working directory of the process.
Parameters
- $path string
timeout ( int $timeout ) : $this
Specify the maximum number of seconds the process may run.
Parameters
- $timeout int
idleTimeout ( int $timeout ) : $this
Specify the maximum number of seconds a process may go without returning output.
Parameters
- $timeout int
forever ( ) : $this
Indicate that the process may run forever without timing out.
env ( array $environment ) : $this
Set the additional environent variables for the process.
Parameters
- $environment array
input ( $input ) : $this
Set the standard input that should be provided when invoking the process.
Parameters
- $input Traversable |resource|string|int|float|bool|null
quietly ( ) : $this
Disable output for the process.
tty ( bool $tty ) : $this
Enable TTY mode for the process.
Parameters
- $tty bool
options ( array $options ) : $this
Set the "proc_open" options that should be used when invoking the process.
Parameters
- $options array
run ( $command , callable $output ) : ProcessResult
Run the process.
Parameters
-
$command
array
|string|null - $output callable|null
start ( $command , callable $output ) : InvokedProcess
Start the process in the background.
Parameters
-
$command
array
|string|null - $output callable
toSymfonyProcess ( $command ) : Symfony\...\Process
Get a Symfony Process instance from the current pending command.
Parameters
-
$command
array
|string|null
withFakeHandlers ( array $fakeHandlers ) : $this
Specify the fake process result handlers for the pending process.
Parameters
- $fakeHandlers array
fakeFor ( string $command ) : Closure |null
Get the fake handler for the given command, if applicable.
Parameters
- $command string
resolveSynchronousFake ( string $command , Closure $fake ) : mixed
Resolve the given fake handler for a synchronous process.
Parameters
- $command string
- $fake Closure
resolveAsynchronousFake ( string $command , callable $output , Closure $fake ) : FakeInvokedProcess
Resolve the given fake handler for an asynchronous process.
Parameters
- $command string
- $output callable|null
- $fake Closure