PHP Класс Airship\Hangar\Command

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$cache array Cache references to other commands
$description string
$display integer
$essential boolean
$name string
$session array hangar.session.json
$tag array
$userConfig Current user's configuration

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

Свойство Тип Описание
$c array BASH COLORS
$config array hangar.json

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

Метод Описание
fire ( array $args = [] ) : boolean Execute a command
getCommandObject ( string $name, boolean $cache = true ) : self Return a command
getCommandStatic ( string $name, boolean $cache = true ) : Command Return a command (statically callable)
getScreenSize ( ) : array Return the size of the current terminal window
getToken ( string $supplier ) : string Get a token for HTTP requests
saveConfig ( ) Save the configuration
storeConfig ( array $data = [] )
usageInfo ( array $args = [] ) : boolean Display the usage information for this command.

Защищенные методы

Метод Описание
getSession ( ) : mixed Get the session data
prompt ( string $text ) : string Prompt the user for an input value
silentPrompt ( string $text = "Enter Password:" ) : string Interactively prompts for input without echoing to the terminal.

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

fire() абстрактный публичный Метод

Execute a command
abstract public fire ( array $args = [] ) : boolean
$args array
Результат boolean

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

Return a command
public getCommandObject ( string $name, boolean $cache = true ) : self
$name string
$cache boolean
Результат self (derived class)

getCommandStatic() публичный статический Метод

Return a command (statically callable)
public static getCommandStatic ( string $name, boolean $cache = true ) : Command
$name string
$cache boolean
Результат Command

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

Return the size of the current terminal window
public getScreenSize ( ) : array
Результат array (int, int)

getSession() закрытый защищенный Метод

Get the session data
final protected getSession ( ) : mixed
Результат mixed

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

Get a token for HTTP requests
public getToken ( string $supplier ) : string
$supplier string
Результат string

prompt() закрытый защищенный Метод

Prompt the user for an input value
final protected prompt ( string $text ) : string
$text string
Результат string

saveConfig() закрытый публичный Метод

Save the configuration
final public saveConfig ( )

silentPrompt() закрытый защищенный Метод

Requires a bash shell or Windows and won't work with safe_mode settings (Uses shell_exec)
final protected silentPrompt ( string $text = "Enter Password:" ) : string
$text string
Результат string

storeConfig() закрытый публичный Метод

final public storeConfig ( array $data = [] )
$data array

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

Display the usage information for this command.
public usageInfo ( array $args = [] ) : boolean
$args array - CLI arguments
Результат boolean

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

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

BASH COLORS
protected array $c
Результат array

$cache публичное статическое свойство

Cache references to other commands
public static array $cache
Результат array

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

hangar.json
protected array $config
Результат array

$description публичное свойство

public string $description
Результат string

$display публичное свойство

public int $display
Результат integer

$essential публичное свойство

public bool $essential
Результат boolean

$name публичное свойство

public string $name
Результат string

$session публичное свойство

hangar.session.json
public array $session
Результат array

$tag публичное свойство

public array $tag
Результат array

$userConfig публичное статическое свойство

Current user's configuration
public static $userConfig