mirror of
https://devops.lemonos.cn/lawson/FendxPHP.git
synced 2026-06-15 15:02:49 +08:00
27 lines
562 B
Plaintext
27 lines
562 B
Plaintext
|
|
#!/usr/bin/env php
|
||
|
|
<?php
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
// 自动加载
|
||
|
|
require_once __DIR__ . '/../vendor/autoload.php';
|
||
|
|
|
||
|
|
use Fendx\CLI\Application;
|
||
|
|
use Fendx\CLI\Command;
|
||
|
|
|
||
|
|
// 创建应用
|
||
|
|
$app = new Application('FendxCLI', '1.0.0');
|
||
|
|
|
||
|
|
// 注册默认命令
|
||
|
|
$app->registerDefaultCommands();
|
||
|
|
|
||
|
|
// 注册自定义命令
|
||
|
|
$app->add(new Command\ListCommand());
|
||
|
|
$app->add(new Command\HelpCommand());
|
||
|
|
$app->add(new Command\VersionCommand());
|
||
|
|
|
||
|
|
// 加载项目命令
|
||
|
|
$app->loadCommandsFromDirectory(__DIR__ . '/commands', 'Fendx\\CLI\\Commands');
|
||
|
|
|
||
|
|
// 运行应用
|
||
|
|
$app->run();
|