lkt/commander

LKT Commander

2.0.1 2023-09-04 15:25 UTC

This package is auto-updated.

Last update: 2024-09-24 13:40:42 UTC


README

这个库是为了方便在包含多个包的应用中注册Symfony控制台命令而设计的。

用法

命令注册

$command = new YourSymfonyCommand(); 
\Lkt\Commander\Commander::register($command);

用法

在您的 cli.php 文件中

\Lkt\Commander\Commander::run();

或者,如果您不是所有控制台命令都使用 LKT Commander,您可以通过这种方式获取 Symfony 应用程序

$application = \Lkt\Commander\Commander::getApplication();

// Your stuff...

$application->run();