class ProcessPipes

ProcessPipes manages descriptors and pipes for the use of proc_open.

Properties

array $pipes

Methods

__construct($useFiles, $ttyMode)

No description

__destruct()

No description

unblock()

Sets non-blocking mode on pipes.

close()

Closes file handles and pipes.

closeUnixPipes()

Closes Unix pipes.

array
getDescriptors()

Returns an array of descriptors for the use of proc_open.

array
read(Boolean $blocking)

Reads data in file handles and pipes.

array
readAndCloseHandles(Boolean $blocking)

Reads data in file handles and pipes, closes them if EOF is reached.

Boolean
hasOpenHandles()

Returns if the current state has open file handles or pipes.

write(Boolean $blocking, string|null $stdin)

Writes stdin data.

Details

at line line 32
__construct($useFiles, $ttyMode)

Parameters

$useFiles
$ttyMode

at line line 58
__destruct()

at line line 66
unblock()

Sets non-blocking mode on pipes.

at line line 76
close()

Closes file handles and pipes.

at line line 90
closeUnixPipes()

Closes Unix pipes.

Nothing happens in case file handles are used.

at line line 103
array getDescriptors()

Returns an array of descriptors for the use of proc_open.

Return Value

array

at line line 136
array read(Boolean $blocking)

Reads data in file handles and pipes.

Parameters

Boolean $blocking Whether to use blocking calls or not.

Return Value

array An array of read data indexed by their fd.

at line line 148
array readAndCloseHandles(Boolean $blocking)

Reads data in file handles and pipes, closes them if EOF is reached.

Parameters

Boolean $blocking Whether to use blocking calls or not.

Return Value

array An array of read data indexed by their fd.

at line line 158
Boolean hasOpenHandles()

Returns if the current state has open file handles or pipes.

Return Value

Boolean

at line line 173
write(Boolean $blocking, string|null $stdin)

Writes stdin data.

Parameters

Boolean $blocking Whether to use blocking calls or not.
string|null $stdin The data to write.