__construct() __construct(string $name = 'UNKNOWN', string $version = 'UNKNOWN', null|string $user = null) : mixed Console constructor. Parameters string $name 名称 string $version 版本 null|string $user 执行用户 Returns mixed —
init() init(bool $run = true) : int|\think\Console 初始化 Console Parameters bool $run 是否运行 Console Returns int|\think\Console —
call() call(string $command, array $parameters = [], string $driver = 'buffer') : \think\console\Output 调用命令 Parameters string $command array $parameters string $driver Returns \think\console\Output —
doRun() doRun(\think\console\Input $input, \think\console\Output $output) : int 执行指令 Parameters \think\console\Input $input 输入 \think\console\Output $output 输出 Returns int —
setDefinition() setDefinition(\think\console\input\Definition $definition) : mixed 设置输入参数定义 Parameters \think\console\input\Definition $definition 输入定义 Returns mixed —
getDefinition() getDefinition() : \think\console\input\Definition 获取输入参数定义 Returns \think\console\input\Definition —
setCatchExceptions() setCatchExceptions(bool $boolean) : $this 设置是否捕获异常 Parameters bool $boolean 是否捕获 Returns $this —
setAutoExit() setAutoExit(bool $boolean) : $this 设置是否自动退出 Parameters bool $boolean 是否自动退出 Returns $this —
setVersion() setVersion(string $version) : $this 设置版本 Parameters string $version 版本信息 Returns $this —
register() register(string $name) : \think\console\Command 注册一个指令 Parameters string $name 指令名称 Returns \think\console\Command —
addCommands() addCommands(\think\console\Command[] $commands) : $this 批量添加指令 Parameters \think\console\Command[] $commands 指令实例 Returns $this —
add() add(\think\console\Command $command) : \think\console\Command|bool 添加一个指令 Parameters \think\console\Command $command 命令实例 Returns \think\console\Command|bool —
get() get(string $name) : \think\console\Command 获取指令 Parameters string $name 指令名称 Throws \InvalidArgumentException Returns \think\console\Command —
findNamespace() findNamespace(string $namespace) : string 查找注册命名空间中的名称或缩写 Parameters string $namespace Throws \InvalidArgumentException Returns string —
find() find(string $name) : \think\console\Command 查找指令 Parameters string $name 名称或者别名 Throws \InvalidArgumentException Returns \think\console\Command —
all() all(string $namespace = null) : \think\console\Command[] 获取所有的指令 Parameters string $namespace 命名空间 Returns \think\console\Command[] —
getAbbreviations() getAbbreviations(array $names) : array 获取可能的指令名 Parameters array $names 指令名 Returns array —
extractNamespace() extractNamespace(string $name, string $limit = null) : string 返回指令的命名空间部分 Parameters string $name 指令名称 string $limit 部分的命名空间的最大数量 Returns string —
setDefaultCommand() setDefaultCommand(string $commandName) : $this 设置默认的指令 Parameters string $commandName 指令名称 Returns $this —
configureIO() configureIO(\think\console\Input $input, \think\console\Output $output) : void 配置基于用户的参数和选项的输入和输出实例 Parameters \think\console\Input $input 输入实例 \think\console\Output $output 输出实例
doRunCommand() doRunCommand(\think\console\Command $command, \think\console\Input $input, \think\console\Output $output) : int 执行指令 Parameters \think\console\Command $command 指令实例 \think\console\Input $input 输入实例 \think\console\Output $output 输出实例 Throws \Exception Returns int —
getCommandName() getCommandName(\think\console\Input $input) : string 获取指令的名称 Parameters \think\console\Input $input 输入实例 Returns string —
getDefaultInputDefinition() getDefaultInputDefinition() : \think\console\input\Definition 获取默认输入定义 Returns \think\console\input\Definition —
getDefaultCommands() getDefaultCommands() : \think\console\Command[] 获取默认命令 Returns \think\console\Command[] —
getAbbreviationSuggestions() getAbbreviationSuggestions(array $abbrevs) : string 获取可能的建议 Parameters array $abbrevs Returns string —
findAlternatives() findAlternatives(string $name, array|\Traversable $collection) : array 查找可替代的建议 Parameters string $name 指令名称 array|\Traversable $collection 建议集合 Returns array —
extractAllNamespaces() extractAllNamespaces(string $name) : array 返回所有的命名空间 Parameters string $name 指令名称 Returns array —