laminas/laminas-cli

Command-line interface for Laminas projects

Fund package maintenance!
Community Bridge

Installs: 144 587

Dependents: 24

Suggesters: 6

Security: 0

Stars: 27

Watchers: 16

Forks: 13

1.2.0 2021-09-20 14:36 UTC

This package is auto-updated.

Last update: 2021-09-20 14:40:11 UTC


README

Build Status

Command-line interface for Laminas projects

Installation

Via Composer

Install the library using Composer:

$ composer require laminas/laminas-cli

Usage

$ vendor/bin/laminas [--container=<path>] [command-name]

Custom command

If you want to add a command for a Laminas MVC or Mezzio application, implement a standard Symfony console command and register the command to use with laminas-cli via application configuration:

return [
    'laminas-cli' => [
        'commands' => [
            'package:command-name' => MyCommand::class,
        ],
    ],
];

Please remember that if a command has any constructor dependencies, you should also map a factory for the command within the container.

For Laminas MVC applications, this would like like:

return [
    'service_manager' => [
        'factories' => [
            MyCommand::class => MyCommandFactory::class,
        ],
    ],
];

For Mezzio applications, this would like like:

return [
    'dependencies' => [
        'factories' => [
            MyCommand::class => MyCommandFactory::class,
        ],
    ],
];