xtreamwayz / mezzio-console
Symfony Console for Mezzio
Fund package maintenance!
www.paypal.me/xtreamwayz
Installs: 1 022
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 3
Forks: 0
Open Issues: 2
Requires
- php: ^7.4 || ^8.0
- psr/container: ^1.0 || ^2.0
- symfony/console: ^5.0 || ^6.0
Requires (Dev)
- laminas/laminas-coding-standard: ^2.3.0
- phpspec/prophecy-phpunit: ^2.0.1
- phpstan/phpstan: ^1.2.0
- phpunit/phpunit: ^9.5.10
README
Symfony Console for Mezzio
This packages brings Symfony Console to your
Mezzio project. It uses the FactoryCommandLoader
for lazy loading
dependencies. The FactoryCommandLoader
does almost a good job: It only loads the one command that is
required. But if no command is requested, it still initializes all commands to get the descriptions for
each command. This is fixed by using a LazyLoadingCommand
. With a bit of reflection and magic it grabs
the configuration from the original command while preventing the command from executing. This way you end
with a list of all commands and their descriptions.
Installation
$ composer require xtreamwayz/mezzio-console
Configuration
<?php declare(strict_types=1); namespace App; return [ 'dependencies' => [ 'factories' => [ Console\MyCommand::class => Console\MyCommandFactory::class, Console\AnotherCommand::class => Console\AnotherCommandFactory::class, ], ], 'console' => [ 'commands' => [ 'my:command' => Console\MyCommand::class, 'another:command' => Console\AnotherCommand::class, ], ], ];
Documentation
All project documentation is located in the ./docs folder. If you would like to contribute to the documentation, please submit a pull request. You can read the docs online: https://xtreamwayz.github.io/mezzio-console/
Contributing
BEFORE you start work on a feature or fix, please read & follow the contributing guidelines to help avoid any wasted or duplicate effort.
Copyright and license
Code released under the MIT License. Documentation distributed under CC BY 4.0.