PHP 클래스 ConsoleKit\Console

상속: implements consolekit\TextWriter
파일 보기 프로젝트 열기: maximebf/consolekit 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$commands array
$defaultCommand string
$exitOnException boolean
$helpCommand string
$helpCommandClass string
$optionsParser consolekit\OptionsParser
$singleCommand boolean
$textWriter consolekit\TextWriter
$verboseException boolean

공개 메소드들

메소드 설명
__construct ( array $commands = [], consolekit\OptionsParser $parser = null, consolekit\TextWriter $writer = null )
addCommand ( callback $callback, string $alias = null, boolean $default = false ) : Console Registers a command
addCommands ( array $commands ) : Console Adds multiple commands at once
addCommandsFromDir ( string $dir, string $namespace = '', boolean $includeFiles = false ) : Console Registers commands from a directory
areExceptionsVerbose ( ) : boolean
execute ( string $command = null, array $args = [], array $options = [] ) : mixed Executes a command
exitsOnException ( ) : boolean
getCommand ( string $name ) : string
getCommands ( ) : array
getDefaultCommand ( ) : string
getOptionsParser ( ) : consolekit\OptionsParser
getTextWriter ( ) : consolekit\TextWriter
hasCommand ( string $name ) : boolean
run ( array $argv = null ) : mixed
setDefaultCommand ( string $name = null ) : Console
setExitOnException ( boolean $exit = true ) : Console Sets whether to call exit(1) when an exception is caught
setOptionsParser ( consolekit\OptionsParser $parser ) : Console
setSingleCommand ( type $singleCommand ) : Console Turn off command parsing
setTextWriter ( consolekit\TextWriter $writer ) : Console
setVerboseException ( boolean $enable = true ) Sets whether a detailed error message is displayed when exception are caught
write ( string $text, $pipe = TextWriter::STDOUT ) : Console Writes some text to the text writer
writeException ( Exception $e ) : Console Writes an error message to stderr
writeln ( string $text = '', $pipe = TextWriter::STDOUT ) : Console Writes a line of text

메소드 상세

__construct() 공개 메소드

public __construct ( array $commands = [], consolekit\OptionsParser $parser = null, consolekit\TextWriter $writer = null )
$commands array
$parser consolekit\OptionsParser
$writer consolekit\TextWriter

addCommand() 공개 메소드

Registers a command
public addCommand ( callback $callback, string $alias = null, boolean $default = false ) : Console
$callback callback Associated class name, function name, Command instance or closure
$alias string Command name to be used in the shell
$default boolean True to set the command as the default one
리턴 Console

addCommands() 공개 메소드

Adds multiple commands at once
또한 보기: addCommand()
public addCommands ( array $commands ) : Console
$commands array
리턴 Console

addCommandsFromDir() 공개 메소드

Registers commands from a directory
public addCommandsFromDir ( string $dir, string $namespace = '', boolean $includeFiles = false ) : Console
$dir string
$namespace string
$includeFiles boolean
리턴 Console

areExceptionsVerbose() 공개 메소드

public areExceptionsVerbose ( ) : boolean
리턴 boolean

execute() 공개 메소드

Executes a command
public execute ( string $command = null, array $args = [], array $options = [] ) : mixed
$command string
$args array
$options array
리턴 mixed

exitsOnException() 공개 메소드

public exitsOnException ( ) : boolean
리턴 boolean

getCommand() 공개 메소드

public getCommand ( string $name ) : string
$name string
리턴 string

getCommands() 공개 메소드

public getCommands ( ) : array
리턴 array

getDefaultCommand() 공개 메소드

public getDefaultCommand ( ) : string
리턴 string

getOptionsParser() 공개 메소드

public getOptionsParser ( ) : consolekit\OptionsParser
리턴 consolekit\OptionsParser

getTextWriter() 공개 메소드

public getTextWriter ( ) : consolekit\TextWriter
리턴 consolekit\TextWriter

hasCommand() 공개 메소드

public hasCommand ( string $name ) : boolean
$name string
리턴 boolean

run() 공개 메소드

public run ( array $argv = null ) : mixed
$argv array
리턴 mixed Results of the command callback

setDefaultCommand() 공개 메소드

public setDefaultCommand ( string $name = null ) : Console
$name string
리턴 Console

setExitOnException() 공개 메소드

Sets whether to call exit(1) when an exception is caught
public setExitOnException ( boolean $exit = true ) : Console
$exit boolean
리턴 Console

setOptionsParser() 공개 메소드

public setOptionsParser ( consolekit\OptionsParser $parser ) : Console
$parser consolekit\OptionsParser
리턴 Console

setSingleCommand() 공개 메소드

Turn off command parsing
public setSingleCommand ( type $singleCommand ) : Console
$singleCommand type
리턴 Console

setTextWriter() 공개 메소드

public setTextWriter ( consolekit\TextWriter $writer ) : Console
$writer consolekit\TextWriter
리턴 Console

setVerboseException() 공개 메소드

Sets whether a detailed error message is displayed when exception are caught
public setVerboseException ( boolean $enable = true )
$enable boolean

write() 공개 메소드

Writes some text to the text writer
또한 보기: TextWriter::write()
public write ( string $text, $pipe = TextWriter::STDOUT ) : Console
$text string
리턴 Console

writeException() 공개 메소드

Writes an error message to stderr
public writeException ( Exception $e ) : Console
$e Exception
리턴 Console

writeln() 공개 메소드

Writes a line of text
또한 보기: TextWriter::writeln()
public writeln ( string $text = '', $pipe = TextWriter::STDOUT ) : Console
$text string
리턴 Console

프로퍼티 상세

$commands 보호되어 있는 프로퍼티

protected array $commands
리턴 array

$defaultCommand 보호되어 있는 프로퍼티

protected string $defaultCommand
리턴 string

$exitOnException 보호되어 있는 프로퍼티

protected bool $exitOnException
리턴 boolean

$helpCommand 보호되어 있는 프로퍼티

protected string $helpCommand
리턴 string

$helpCommandClass 보호되어 있는 프로퍼티

protected string $helpCommandClass
리턴 string

$optionsParser 보호되어 있는 프로퍼티

protected OptionsParser,consolekit $optionsParser
리턴 consolekit\OptionsParser

$singleCommand 보호되어 있는 프로퍼티

protected bool $singleCommand
리턴 boolean

$textWriter 보호되어 있는 프로퍼티

protected TextWriter,consolekit $textWriter
리턴 consolekit\TextWriter

$verboseException 보호되어 있는 프로퍼티

protected bool $verboseException
리턴 boolean