PHP Класс Assetic\Util\Process

Автор: Fabien Potencier ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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 )

Описание методов

__construct() публичный метод

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 addErrorOutput ( $line )

addOutput() публичный метод

public addOutput ( $line )

getCommandLine() публичный метод

public getCommandLine ( )

getEnv() публичный метод

public getEnv ( )

getErrorOutput() публичный метод

This only returns the error output if you have not supplied a callback to the run() method.
public getErrorOutput ( ) : string
Результат string The process error output

getExitCode() публичный метод

Returns the exit code returned by the process.
public getExitCode ( ) : integer
Результат integer The exit status code

getOptions() публичный метод

public getOptions ( )

getOutput() публичный метод

This only returns the output if you have not supplied a callback to the run() method.
public getOutput ( ) : string
Результат string The process output

getStdin() публичный метод

public getStdin ( )

getStopSignal() публичный метод

It is only meaningful if hasBeenStopped() returns true.
public getStopSignal ( ) : integer
Результат integer

getTermSignal() публичный метод

It is only meaningful if hasBeenSignaled() returns true.
public getTermSignal ( ) : integer
Результат integer

getTimeout() публичный метод

public getTimeout ( )

getWorkingDirectory() публичный метод

public getWorkingDirectory ( )

hasBeenSignaled() публичный метод

It always returns false on Windows.
public hasBeenSignaled ( ) : boolean
Результат boolean

hasBeenStopped() публичный метод

It always returns false on Windows.
public hasBeenStopped ( ) : boolean
Результат boolean

isSuccessful() публичный метод

Checks if the process ended successfully.
public isSuccessful ( ) : boolean
Результат boolean true if the process ended successfully, false otherwise

run() публичный метод

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
Результат integer The exit status code

setCommandLine() публичный метод

public setCommandLine ( $commandline )

setEnv() публичный метод

public setEnv ( array $env )
$env array

setOptions() публичный метод

public setOptions ( array $options )
$options array

setStdin() публичный метод

public setStdin ( $stdin )

setTimeout() публичный метод

public setTimeout ( $timeout )

setWorkingDirectory() публичный метод

public setWorkingDirectory ( $cwd )