1 Star 3 Fork 26

yg178/php-console

forked from inhere/php-console 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
commands.php 1.20 KB
一键复制 编辑 原始数据 按行查看 历史
inhere 提交于 2018-01-26 18:03 +08:00 . add new features:
<?php
/**
* Created by PhpStorm.
* User: inhere
* Date: 2016/12/7
* Time: 12:46
* @var Inhere\Console\Application $app
*/
use Inhere\Console\BuiltIn\PharController;
use Inhere\Console\BuiltIn\SelfUpdateCommand;
use Inhere\Console\Examples\Commands\CorCommand;
use Inhere\Console\Examples\Commands\DemoCommand;
use Inhere\Console\Examples\Commands\TestCommand;
use Inhere\Console\Examples\Controllers\HomeController;
use Inhere\Console\Examples\Controllers\ProcessController;
use Inhere\Console\IO\Input;
use Inhere\Console\IO\Output;
$app->command(DemoCommand::class);
$app->command('exam', function (Input $in, Output $out) {
$cmd = $in->getCommand();
$out->info('hello, this is a test command: ' . $cmd);
}, 'a description message');
$app->command('test', TestCommand::class, [
'aliases' => ['t']
]);
$app->command(SelfUpdateCommand::class, null, [
'aliases' => ['selfUpdate']
]);
$app->command(CorCommand::class);
$app->controller('home', HomeController::class, [
'aliases' => ['h']
]);
$app->controller(ProcessController::class, null, [
'aliases' => 'prc'
]);
$app->controller(PharController::class);
// add alias for a group command.
$app->addCommandAliases('home:test', 'h-test');
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/hwsyy/php-console.git
git@gitee.com:hwsyy/php-console.git
hwsyy
php-console
php-console
master

搜索帮助