为Arrow添加CLI支持。

维护者

详细信息

gitlab.com/arrowphp/cli

源代码

问题

安装: 19

依赖: 2

建议者: 1

安全: 0

星星: 0

Forks: 0

类型:arrow-module

v0.2.20191024 2019-10-23 14:43 UTC

This package is not auto-updated.

Last update: 2024-09-19 23:30:06 UTC


README

Software License

这是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

贡献

请参阅CONTRIBUTINGCODE_OF_CONDUCT以获取详细信息。

安全

如果您发现任何与安全相关的问题,请直接联系Chris Pennycuick,而不是使用问题跟踪器。

鸣谢

许可证

MIT许可证(MIT)。有关更多信息,请参阅许可证文件