Command-line interface for Laminas projects
Install the library using Composer:
$ composer require laminas/laminas-cli$ vendor/bin/laminas [--container=<path>] [command-name]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,
],
],
];