uniondrug / console
Uniondrug Console Component for uniondrug/framework
Installs: 6 036
Dependents: 4
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- symfony/console: ^3.0
- uniondrug/framework: ^2.0
README
安装
composer requre uniondrug/console
使用
$ php console __ __ _ ____ / / / /___ (_)___ ____ / __ \_______ ______ _ / / / / __ \/ / __ \/ __ \/ / / / ___/ / / / __ `/ / /_/ / / / / / /_/ / / / / /_/ / / / /_/ / /_/ / \____/_/ /_/_/\____/_/ /_/_____/_/ \__,_/\__, / /____/ Console 1.0.0 Usage: command [options] [arguments] Options: -h, --help Display this help message -q, --quiet Do not output any message -V, --version Display this application version --ansi Force ANSI output --no-ansi Disable ANSI output -n, --no-interaction Do not ask any interactive question -e, --env[=ENV] The environment the command should run under. [default: "development"] -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug Available commands: config 列出所有配置文件 help Displays help for a command list Lists commands
命令
默认命令
config
列出所有配置文件信息。使用如下:
$ php console config -e production +-----------------------------------+----------------------+ | Key | Value | +-----------------------------------+----------------------+ | key.k1.k2 | value | +-----------------------------------+----------------------+
自定义命令
在项目app\Commands
目录下,创建命令,默认命名空间是App\Commands
,命令类必须以Command
结尾,继承UniondrugConsole\Command
.
比如:
namespace App\Commands; use Uniondrug\Console\Command; class LocalCommand extends Command { public function configure() { $this->setName('local:name'); } public function handle() { $this->line("Hello world"); } }