Add CLI support to Arrow.

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

This package is not auto-updated.

Last update: 2024-04-18 21:38:05 UTC


README

Software License

This is the Arrow CLI. It adds CLI capability into to any Arrow powered application.

Install

Via project composer.json

  "require": {
    "arrowphp/arrow": "@dev",
    "arrowphp/cli": "@dev"
  }

Usage

$ vendor/bin/arrow-cli

Implementation

Now available in the module class is a registerCLI method. This method will register the defined command and make it available to be used via the 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 registerServices(Container $container, Config $config)
    {
        $container->add('<container-name>', <Module>\<ClassName>::class)
            ->withArgument($container)
            ->withArgument($config);
    }

Change log

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please contact Chris Pennycuick directly instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.