class DefaultPhpProcess extends AbstractPhpProcess (View source)

Default utility for PHP sub-processes.

Properties

protected Runtime $runtime from AbstractPhpProcess
protected bool $stderrRedirection from AbstractPhpProcess
protected string $stdin from AbstractPhpProcess
protected string $args from AbstractPhpProcess
protected array $env from AbstractPhpProcess
protected int $timeout from AbstractPhpProcess
protected string $tempFile
protected bool $useTempFile

Methods

__construct()

Creates internal Runtime instance.

setUseStderrRedirection(bool $stderrRedirection)

Defines if should use STDERR redirection or not.

bool
useStderrRedirection()

Returns TRUE if uses STDERR redirection or FALSE if not.

setStdin(string $stdin)

Sets the input string to be sent via STDIN

string
getStdin()

Returns the input string to be sent via STDIN

setArgs(string $args)

Sets the string of arguments to pass to the php job

getArgs()

Returns the string of arguments to pass to the php job

setEnv(array $env)

Sets the array of environment variables to start the child process with

array
getEnv()

Returns the array of environment variables to start the child process with

setTimeout(int $timeout)

Sets the amount of seconds to wait before timing out

int
getTimeout()

Returns the amount of seconds to wait before timing out

factory()

No description

runTestJob(string $job, Test $test, TestResult $result)

Runs a single test in a separate PHP process.

string
getCommand(array $settings, string|null $file = null)

Returns the command based into the configurations.

array
runJob(string $job, array $settings = [])

Runs a single job (PHP code) using a separate PHP process.

string
settingsToParameters(array $settings)

No description

array
getHandles()

Returns an array of file handles to be used in place of pipes

array
runProcess(string $job, array $settings)

Handles creating the child process and returning the STDOUT and STDERR

process(resource $pipe, string $job)

No description

cleanup()

No description

Details

__construct()

Creates internal Runtime instance.

setUseStderrRedirection(bool $stderrRedirection)

Defines if should use STDERR redirection or not.

Then $stderrRedirection is TRUE, STDERR is redirected to STDOUT.

Parameters

bool $stderrRedirection

Exceptions

Exception

bool useStderrRedirection()

Returns TRUE if uses STDERR redirection or FALSE if not.

Return Value

bool

setStdin(string $stdin)

Sets the input string to be sent via STDIN

Parameters

string $stdin

string getStdin()

Returns the input string to be sent via STDIN

Return Value

string

setArgs(string $args)

Sets the string of arguments to pass to the php job

Parameters

string $args

getArgs()

Returns the string of arguments to pass to the php job

setEnv(array $env)

Sets the array of environment variables to start the child process with

Parameters

array $env string> $env

array getEnv()

Returns the array of environment variables to start the child process with

Return Value

array string>

setTimeout(int $timeout)

Sets the amount of seconds to wait before timing out

Parameters

int $timeout

int getTimeout()

Returns the amount of seconds to wait before timing out

Return Value

int

runTestJob(string $job, Test $test, TestResult $result)

Runs a single test in a separate PHP process.

Parameters

string $job
Test $test
TestResult $result

Exceptions

Exception

string getCommand(array $settings, string|null $file = null)

Returns the command based into the configurations.

Parameters

array $settings
string|null $file

Return Value

string

array runJob(string $job, array $settings = [])

Runs a single job (PHP code) using a separate PHP process.

Parameters

string $job
array $settings

Return Value

array

Exceptions

Exception

protected string settingsToParameters(array $settings)

Parameters

array $settings

Return Value

string

protected array getHandles()

Returns an array of file handles to be used in place of pipes

Return Value

array

protected array runProcess(string $job, array $settings)

Handles creating the child process and returning the STDOUT and STDERR

Parameters

string $job
array $settings

Return Value

array string>

Exceptions

Exception

protected process(resource $pipe, string $job)

Parameters

resource $pipe
string $job

Exceptions

Exception

protected cleanup()