PHP Class Assetic\Util\Process

Author: Fabien Potencier ([email protected])
Afficher le fichier Open project: pmjones/php-framework-benchmarks Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( string $commandline, string $cwd = null, array $env = null, string $stdin = null, integer $timeout = 60, array $options = [] ) Constructor.
addErrorOutput ( $line )
addOutput ( $line )
getCommandLine ( )
getEnv ( )
getErrorOutput ( ) : string Returns the error output of the process (STDERR).
getExitCode ( ) : integer Returns the exit code returned by the process.
getOptions ( )
getOutput ( ) : string Returns the output of the process (STDOUT).
getStdin ( )
getStopSignal ( ) : integer Returns the number of the signal that caused the child process to stop its execution
getTermSignal ( ) : integer Returns the number of the signal that caused the child process to terminate its execution.
getTimeout ( )
getWorkingDirectory ( )
hasBeenSignaled ( ) : boolean Returns true if the child process has been terminated by an uncaught signal.
hasBeenStopped ( ) : boolean Returns true if the child process has been stopped by a signal.
isSuccessful ( ) : boolean Checks if the process ended successfully.
run ( Closure | string | array $callback = null ) : integer Runs the process.
setCommandLine ( $commandline )
setEnv ( array $env )
setOptions ( array $options )
setStdin ( $stdin )
setTimeout ( $timeout )
setWorkingDirectory ( $cwd )

Method Details

__construct() public méthode

Constructor.
public __construct ( string $commandline, string $cwd = null, array $env = null, string $stdin = null, integer $timeout = 60, array $options = [] )
$commandline string The command line to run
$cwd string The working directory
$env array The environment variables
$stdin string The STDIN content
$timeout integer The timeout in seconds
$options array An array of options for proc_open

addErrorOutput() public méthode

public addErrorOutput ( $line )

addOutput() public méthode

public addOutput ( $line )

getCommandLine() public méthode

public getCommandLine ( )

getEnv() public méthode

public getEnv ( )

getErrorOutput() public méthode

This only returns the error output if you have not supplied a callback to the run() method.
public getErrorOutput ( ) : string
Résultat string The process error output

getExitCode() public méthode

Returns the exit code returned by the process.
public getExitCode ( ) : integer
Résultat integer The exit status code

getOptions() public méthode

public getOptions ( )

getOutput() public méthode

This only returns the output if you have not supplied a callback to the run() method.
public getOutput ( ) : string
Résultat string The process output

getStdin() public méthode

public getStdin ( )

getStopSignal() public méthode

It is only meaningful if hasBeenStopped() returns true.
public getStopSignal ( ) : integer
Résultat integer

getTermSignal() public méthode

It is only meaningful if hasBeenSignaled() returns true.
public getTermSignal ( ) : integer
Résultat integer

getTimeout() public méthode

public getTimeout ( )

getWorkingDirectory() public méthode

public getWorkingDirectory ( )

hasBeenSignaled() public méthode

It always returns false on Windows.
public hasBeenSignaled ( ) : boolean
Résultat boolean

hasBeenStopped() public méthode

It always returns false on Windows.
public hasBeenStopped ( ) : boolean
Résultat boolean

isSuccessful() public méthode

Checks if the process ended successfully.
public isSuccessful ( ) : boolean
Résultat boolean true if the process ended successfully, false otherwise

run() public méthode

The callback receives the type of output (out or err) and some bytes from the output in real-time. It allows to have feedback from the independent process during execution. The STDOUT and STDERR are also available after the process is finished via the getOutput() and getErrorOutput() methods.
public run ( Closure | string | array $callback = null ) : integer
$callback Closure | string | array A PHP callback to run whenever there is some output available on STDOUT or STDERR
Résultat integer The exit status code

setCommandLine() public méthode

public setCommandLine ( $commandline )

setEnv() public méthode

public setEnv ( array $env )
$env array

setOptions() public méthode

public setOptions ( array $options )
$options array

setStdin() public méthode

public setStdin ( $stdin )

setTimeout() public méthode

public setTimeout ( $timeout )

setWorkingDirectory() public méthode

public setWorkingDirectory ( $cwd )