代码拉取完成,页面将自动刷新
<?php declare(strict_types=1);
/**
* The file is part of inhere/console
*
* @author https://github.com/inhere
* @homepage https://github.com/inhere/php-console
* @license https://github.com/inhere/php-console/blob/master/LICENSE
*/
use Inhere\Console\Application;
use Inhere\Console\BuiltIn\PharController;
use Inhere\Console\BuiltIn\SelfUpdateCommand;
use Inhere\Console\Examples\Command\CorCommand;
use Inhere\Console\Examples\Command\DemoCommand;
use Inhere\Console\Examples\Command\TestCommand;
use Inhere\Console\Examples\Controller\HomeController;
use Inhere\Console\Examples\Controller\InteractController;
use Inhere\Console\Examples\Controller\ProcessController;
use Inhere\Console\Examples\Controller\ShowController;
use Inhere\Console\IO\Input;
use Inhere\Console\IO\Output;
/** @var Application $app */
$app->command(DemoCommand::class);
$app->command('exam', function (Input $in, Output $out): void {
$cmd = $in->getCommand();
$out->info('hello, this is a test command: ' . $cmd);
}, [
'desc' => '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);
$app->controller(ShowController::class);
$app->controller(InteractController::class);
// add alias for a group command.
$app->addAliases('home:test', 'h-test');
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。