PHP Класс Moosh\MooshCommand

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

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

Свойство Тип Описание
$BOOTSTRAP_CONFIG set CLI_SCRIPT, ABORT_AFTER_CONFIG and include config.php
$BOOTSTRAP_FULL set CLI_SCRIPT and include config.php
$BOOTSTRAP_FULL_NOCLI no CLI_SCRIPT, include config.php
$BOOTSTRAP_NONE Do not include config.php at all
$arguments
$cwd string Current working directory
$defaults array Default global options
$expandedOptions array After expanding
$finalOptions array Before expanding
$mooshDir string moosh installation directory.
$options
$relativeDir string Directory relative to the current Moodle root dir.
$spec GetOptionKit\OptionSpecCollection
$topDir string Top Moodle installation directory.
$verbose

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

Свойство Тип Описание
$argumentNames array
$group
$maxArguments integer .
$minArguments integer How many arguments minimum are required.
$name
$parsedOptions GetOptionKit\OptionResult
$pluginInfo array Possible information on plugin in a current directory.
$session array Temporary session information.

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

Метод Описание
__construct ( $name, $group = NULL )
addArgument ( string $name, $type = ARG_GENERIC ) Define required argument. Call function again to add another argument.
addOption ( $optionSpec, $description = NULL, $default = NULL )
bootstrapLevel ( ) : integer Should command be bootstrapped as CLI_SCRIPT and include config.php?
checkDirArg ( $name )
checkFileArg ( $name )
checkPathArg ( $name )
expandOptions ( ) Make the special replacements of %s in the options
expandOptionsManually ( $replacements ) Make the special replacements of %s in the options with custom list of arguments
getName ( )
printOptions ( )
processOptions ( $defaults )
requireHomeWriteable ( ) : integer Does the command require writing to ~/.moosh/ directory?
setArguments ( $arguments )
setParsedOptions ( $parsedOptions )
setPluginInfo ( $pluginInfo )
status ( )

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

Метод Описание
getArgumentsHelp ( ) Can be overwritten by child classes to provide custom description.
getLangCategory ( )
loadSession ( ) Loads temporary session information from the temp file.
onErrorHelp ( ) : string Overwrite to display extra information (e.g. help) when error occured (e.g. wrong arguments were given)
saveSession ( ) Saves session information to the temp file.

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

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

public __construct ( $name, $group = NULL )

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

Define required argument. Call function again to add another argument.
public addArgument ( string $name, $type = ARG_GENERIC )
$name string

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

public addOption ( $optionSpec, $description = NULL, $default = NULL )

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

Should command be bootstrapped as CLI_SCRIPT and include config.php?
public bootstrapLevel ( ) : integer
Результат integer

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

public checkDirArg ( $name )

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

public checkFileArg ( $name )

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

public checkPathArg ( $name )

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

Make the special replacements of %s in the options
public expandOptions ( )

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

Make the special replacements of %s in the options with custom list of arguments
public expandOptionsManually ( $replacements )

getArgumentsHelp() защищенный Метод

Can be overwritten by child classes to provide custom description.
protected getArgumentsHelp ( )

getLangCategory() защищенный Метод

protected getLangCategory ( )

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

public getName ( )

loadSession() защищенный Метод

Loads temporary session information from the temp file.
protected loadSession ( )

onErrorHelp() защищенный Метод

Overwrite to display extra information (e.g. help) when error occured (e.g. wrong arguments were given)
protected onErrorHelp ( ) : string
Результат string

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

public printOptions ( )

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

public processOptions ( $defaults )

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

Does the command require writing to ~/.moosh/ directory?
public requireHomeWriteable ( ) : integer
Результат integer

saveSession() защищенный Метод

Saves session information to the temp file.
protected saveSession ( )

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

public setArguments ( $arguments )

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

public setParsedOptions ( $parsedOptions )

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

public setPluginInfo ( $pluginInfo )

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

public status ( )

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

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

set CLI_SCRIPT, ABORT_AFTER_CONFIG and include config.php
public static $BOOTSTRAP_CONFIG

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

set CLI_SCRIPT and include config.php
public static $BOOTSTRAP_FULL

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

no CLI_SCRIPT, include config.php
public static $BOOTSTRAP_FULL_NOCLI

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

Do not include config.php at all
public static $BOOTSTRAP_NONE

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

protected array $argumentNames
Результат array

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

public $arguments

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

Current working directory
public string $cwd
Результат string

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

Default global options
public array $defaults
Результат array

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

After expanding
public array $expandedOptions
Результат array

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

Before expanding
public array $finalOptions
Результат array

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

protected $group

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

.
protected int $maxArguments
Результат integer

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

How many arguments minimum are required.
protected int $minArguments
Результат integer

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

moosh installation directory.
public string $mooshDir
Результат string

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

protected $name

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

public $options

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

protected OptionResult,GetOptionKit $parsedOptions
Результат GetOptionKit\OptionResult

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

Possible information on plugin in a current directory.
protected array $pluginInfo
Результат array

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

Directory relative to the current Moodle root dir.
public string $relativeDir
Результат string

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

Temporary session information.
protected array $session
Результат array

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

public OptionSpecCollection,GetOptionKit $spec
Результат GetOptionKit\OptionSpecCollection

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

Top Moodle installation directory.
public string $topDir
Результат string

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

public $verbose