arrowphp / cli
为Arrow添加CLI支持。
v0.2.20191024
2019-10-23 14:43 UTC
Requires
- arrowphp/arrow: @dev
Requires (Dev)
This package is not auto-updated.
Last update: 2024-09-19 23:30:06 UTC
README
这是Arrow CLI。它为任何由Arrow驱动的应用程序添加CLI功能。
安装
通过项目的composer.json
"require": {
"arrowphp/arrow": "@dev",
"arrowphp/cli": "@dev"
}
使用方法
$ vendor/bin/arrow-cli
实现
现在模块类中提供了registerCLI
方法。此方法将注册定义的命令,并通过arrow-cli
使其可用。
public function registerCLI(\Arrow\CLI\CLI $cli, \League\Container\Container $container, \Arrow\Config $config): void
{
// Call an anonymouse function directly
$cli->register('<module>:<tag>', '<description>', function () {
// Do work
});
// or call a controller / controller action.
$cli->register('<module>:<tag>', '<description>', '<container-name>');
}
public function register(Container $container, Config $config)
{
$container->add('<container-name>', <Module>\<ClassName>::class)
->withArgument($container)
->withArgument($config);
}
变更日志
有关最近更改的更多信息,请参阅CHANGELOG。
贡献
请参阅CONTRIBUTING和CODE_OF_CONDUCT以获取详细信息。
安全
如果您发现任何与安全相关的问题,请直接联系Chris Pennycuick,而不是使用问题跟踪器。
鸣谢
许可证
MIT许可证(MIT)。有关更多信息,请参阅许可证文件。