funivan / console
Improved symfony console
Installs: 11 636
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
pkg:composer/funivan/console
Requires
- php: >=5.5.0
- jan-swiecki/simple-annotations: ^0.3.1
- mtdowling/cron-expression: ^1.0
- symfony/console: ~3.1
- symfony/event-dispatcher: ~3.1
- symfony/finder: ~2.7|~3.0
Requires (Dev)
- phpunit/phpunit: 5.*
This package is auto-updated.
Last update: 2023-09-12 05:11:08 UTC
README
Improved symfony console
Install
Via Composer
composer require funivan/console
Usage
use Funivan\Console\CommandsLoader\FileSystemCommandsLoader; use Funivan\Console\NameResolver\StandardNameResolver; use Funivan\Console\SingleState\SingleStateConfigurator; $configurator = new \Funivan\Console\ConsoleApplicationConfigurator(); $dispatcher = new \Symfony\Component\EventDispatcher\EventDispatcher(); $configurator->setEventDispatcher($dispatcher); $finder = new \Symfony\Component\Finder\Finder(); $finder->files()->in(__DIR__ . '/commands/')->name('*.php'); # load commands from commands dir # Base namespace is 'Commands' $commandsLoader = (new FileSystemCommandsLoader($finder, new StandardNameResolver('Commands'))); $configurator->setCommandsLoader($commandsLoader); $singleStateConfigurator = new SingleStateConfigurator(); $configurator->setSingleStateConfigurator($singleStateConfigurator); # configure your app $consoleApp = new \Funivan\Console\ConsoleApplication(); $configurator->configure($consoleApp); $consoleApp->run();
Testing
./vendor/bin/phpunit
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.