PHP 클래스 Moosh\MooshCommand

파일 보기 프로젝트 열기: tmuras/moosh 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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

보호된 프로퍼티들

프로퍼티 타입 설명
$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