zakirullin / laminas-cli

Console command runner, exposing commands written in Laminas MVC and Mezzio components and applications

Home Page:https://docs.laminas.dev/laminas-cli

Repository from Github https://github.comzakirullin/laminas-cliRepository from Github https://github.comzakirullin/laminas-cli

laminas-cli

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,
        ],
    ],
];

About

Console command runner, exposing commands written in Laminas MVC and Mezzio components and applications

https://docs.laminas.dev/laminas-cli

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:PHP 100.0%