wfk / symfony-console-module
Symfony Console Component for Zend Framework MVC
Requires
- php: >=5.3
- symfony/console: 2.*
- zendframework/zend-mvc: 2.*
This package is not auto-updated.
Last update: 2024-12-21 15:30:56 UTC
README
Symfony Console Module for Zend Framework. Note that this is a full replacement for the Zend Console so your zend commands will not work any longer.
See Symfony Console on how to write commands.
Installation
Installation of DoctrineModule uses composer. For composer documentation, please refer to getcomposer.org.
-
cd my/project/directory
-
create or modify the
composer.json
file within your ZF2 application file with following contents:{ "require": { "wfk/symfony-console-module": "*" } }
-
install composer via
curl -s https://getcomposer.org/installer | php
(on windows, download https://getcomposer.org/installer and execute it with PHP). Then runphp composer.phar install
-
open
my/project/directory/configs/application.config.php
and add the following key to yourmodules
:'SymfonyConsoleModule',
Register commands
All commands registered in config[console][commands] get pulled from the service locator and placed in the Symfony console application.
<?php return array( 'console' => array( 'commands' => array( 'MyService\LocatorAlias\ToCommand' ) ) );
Running commands
To run your console app simply run index.php. From your project root:
php public/index.php <arguments>
Extra configuration
The following extra configurations are optional for the Symfony console application.
<?php return array( 'console' => array( 'name' => 'Some console title', 'version' => 'Some console version', 'commands' => array( // ... ), ) );