Zhamao Framework  3.0.0-beta1
A high-performance chatbot + web framework
Command类 参考
类 Command 继承关系图:
[图例]
Command 的协作图:
[图例]

Protected 成员函数

 execute (InputInterface $input, OutputInterface $output)
 
 shouldExecute ()
 
 handle ()
 
 write (string $message, bool $newline=true)
 
 info (string $message, bool $newline=true)
 
 error (string $message, bool $newline=true)
 
 comment (string $message, bool $newline=true)
 
 question (string $message, bool $newline=true)
 
 detail (string $message, bool $newline=true)
 
 section (string $message, callable $callback)
 

Protected 属性

InputInterface $input
 
OutputInterface $output
 

成员函数说明

◆ comment()

comment ( string  $message,
bool  $newline = true 
)
protected

输出文本,一般用于警告或附注信息

参数
string$message要输出的文本
bool$newline是否在文本后换行
函数调用图:

◆ detail()

detail ( string  $message,
bool  $newline = true 
)
protected

输出文本,一般用于详细信息

参数
string$message要输出的文本
bool$newline是否在文本后换行
函数调用图:

◆ error()

error ( string  $message,
bool  $newline = true 
)
protected

输出文本,一般用于错误信息

参数
string$message要输出的文本
bool$newline是否在文本后换行
函数调用图:

◆ execute()

execute ( InputInterface  $input,
OutputInterface  $output 
)
protected

{}

ProxyServerCommand, BuildCommand , 以及 SystemdGenerateCommand 重载.

函数调用图:

◆ handle()

handle ( )
abstractprotected

命令的主体

返回
int 命令执行结果 {
参见
self::SUCCESS} 或 {
self::FAILURE} 或 {
self::INVALID}

InitCommand, CheckConfigCommand, ReplCommand , 以及 BotCraftCommand 重载.

◆ info()

info ( string  $message,
bool  $newline = true 
)
protected

输出文本,一般用于提示信息

参数
string$message要输出的文本
bool$newline是否在文本后换行
函数调用图:

◆ question()

question ( string  $message,
bool  $newline = true 
)
protected

输出文本,一般用于提问信息

参数
string$message要输出的文本
bool$newline是否在文本后换行
函数调用图:

◆ section()

section ( string  $message,
callable  $callback 
)
protected

输出一个区块,区块内内容可以覆写

此功能需要 $output 为 {

参见
ConsoleOutputInterface} 类型
参数
string$message作为标题的文本
callable$callback回调函数,接收一个参数,类型为 {
参见
ConsoleSectionOutput}
函数调用图:

◆ shouldExecute()

shouldExecute ( )
protected

是否应该执行

返回
bool 返回 true 以继续执行,返回 false 以中断执行

◆ write()

write ( string  $message,
bool  $newline = true 
)
protected

输出一段文本,默认样式

参数
string$message要输出的文本
bool$newline是否在文本后换行
参见
OutputInterface::write()

结构体成员变量说明

◆ $input

InputInterface $input
protected

输入

◆ $output

OutputInterface $output
protected

输出

一般来说同样会是 ConsoleOutputInterface


该类的文档由以下文件生成: