PHP Класс Jyxo\Shell\Client

Автор: Ondřej Procházka
Автор: Matěj Humpál
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$cwd string Actual working directory.
$env array Environment properties.
$error string Stderr output.
$out string Stdout output.
$processList array List of running processes.

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

Метод Описание
__construct ( string $cwd = '', array $env = [] ) Constructor.
clearEnv ( ) : Client Removes environment properties.
exec ( string $cmd, integer &$status = null ) : Client Executes an external command.
getError ( ) : string Returns stderr contents.
getOut ( ) : string Returns stdout contents.
killProcess ( string $name ) : self Kills all processes of the given name.
loadProcessList ( ) : self Returns a list of processes.
processExists ( string $name ) : boolean Checks if there is a process of the given name.
setCwd ( string $cwd = '' ) : Client Sets working directory.
setEnv ( array $env ) : Client Adds one or more environment properties.

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

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

Constructor.
public __construct ( string $cwd = '', array $env = [] )
$cwd string Working directory
$env array Array of environment properties

clearEnv() публичный Метод

Removes environment properties.
public clearEnv ( ) : Client
Результат Client

exec() публичный Метод

Captures stdout and stderr. Throws an exception on status code != 0.
public exec ( string $cmd, integer &$status = null ) : Client
$cmd string Command to execute
$status integer Status code
Результат Client

getError() публичный Метод

Returns stderr contents.
public getError ( ) : string
Результат string

getOut() публичный Метод

Returns stdout contents.
public getOut ( ) : string
Результат string

killProcess() публичный Метод

Works only on Linux.
public killProcess ( string $name ) : self
$name string Process name
Результат self

loadProcessList() публичный Метод

Works only on Linux.
public loadProcessList ( ) : self
Результат self

processExists() публичный Метод

Works only on Linux.
public processExists ( string $name ) : boolean
$name string Process name
Результат boolean

setCwd() публичный Метод

Defaults to null.
public setCwd ( string $cwd = '' ) : Client
$cwd string Working directory
Результат Client

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

Adds one or more environment properties.
public setEnv ( array $env ) : Client
$env array Array of properties
Результат Client

Описание свойств

$cwd защищенное свойство

Actual working directory.
protected string $cwd
Результат string

$env защищенное свойство

Environment properties.
protected array $env
Результат array

$error защищенное свойство

Stderr output.
protected string $error
Результат string

$out защищенное свойство

Stdout output.
protected string $out
Результат string

$processList защищенное свойство

List of running processes.
protected array $processList
Результат array