PHP Class pharext\ExecCmd

Datei anzeigen Open project: m6w6/pharext Class Usage Examples

Public Methods

Method Description
__construct ( string $command, $verbose = false )
getOutput ( ) : string Retrieve output of cmd run
getStatus ( ) : integer Retrieve exit code of cmd run
run ( array $args = null ) : ExecCmd Run the command
setSu ( string $sudo = false ) (Re-)set sudo command

Private Methods

Method Description
progress ( string $string, integer $flags ) : string Output handler that displays some progress while soaking output
suExec ( string $command, boolean $verbose = null ) : integer Execute a program with escalated privileges handling interactive password prompt

Method Details

__construct() public method

public __construct ( string $command, $verbose = false )
$command string

getOutput() public method

Retrieve output of cmd run
public getOutput ( ) : string
return string

getStatus() public method

Retrieve exit code of cmd run
public getStatus ( ) : integer
return integer

run() public method

Run the command
public run ( array $args = null ) : ExecCmd
$args array
return ExecCmd self

setSu() public method

(Re-)set sudo command
public setSu ( string $sudo = false )
$sudo string