PHP Class AbortableProcess

Process is relying on error_get_last to learn if the stream reading was interrupted by a signal (see UnixSignal's readAndWrite, the hasSystemCallBeenInterrupted call). Unfortunately this doesn't work if we trapp the signal, which wipes out the error, which makes Process think it's some other kind of error which makes it commit suicide for no good reason. Workaround is to avoid blocking stream_select as ->run nor ->wait do. Fortunately we can call ->isRunning instead, which uses a non-blocking readPipes via updateStatus. This means our callback will still get called if we loop over ->isRunning.
Inheritance: extends Symfony\Component\Process\Process
Show file Open project: silverstripe/deploynaut Class Usage Examples

Public Methods

Method Description
run ( $callback = null )

Method Details

run() public method

public run ( $callback = null )