blanchonvincent / symfony-bridge-module
A bridge to integrate Symfony component
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 1 474
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 0
Open Issues: 0
Type:module
Requires
- php: >=5.3.3
- symfony/config: ^2.6.4
- symfony/console: ^2.6.4
- symfony/dependency-injection: ^2.6.4
- symfony/routing: ^2.6.4
- zendframework/zendframework: ^2.3.0
Requires (Dev)
- fabpot/php-cs-fixer: 0.4.*@dev
- phpunit/phpunit: ~3.7
- slm/queue: 0.3.*
- slm/queue-sqs: 0.3.*
README
Introduction
This repository will provide bridge to integrate Symfony component.
Console
To integrate the Symfony2 console component, that's pretty easy :
- Add configuration to your
application.config.php
:
return array( 'modules' => array( // your usual config there ), 'module_listener_options' => array( // your usual config there ), 'service_manager' => array( 'invokables' => array( 'SymfonyBridgeModule\Console\CommandsManager' => 'SymfonyBridgeModule\Console\CommandsManager', ), ), 'service_listener_options' => array( array( 'service_manager' => 'SymfonyBridgeModule\Console\CommandsManager', 'config_key' => 'symfony_commands', 'interface' => 'SymfonyBridgeModule\ModuleManager\Feature\ConsoleCommandsProviderInterface', 'method' => 'getConsoleCommands', ), ), );
Now, just implements the SymfonyBridgeModule\ModuleManager\Feature\ConsoleCommandsProviderInterface
interface in the modules
to provide commands :
class Module implements ConsoleCommandsProviderInterface { public function getConsoleCommands() { return array( 'invokables' => array( 'foo' => 'SymfonyBridgeModuleTest\Fixtures\FooModule\Command\FooCommand', ), ); } }
Then copy the console console.php.dist
and update the file from your project settings.
You can try to run the console.php
as an example :
php console.php
Available commands:
foo
help Displays help for a command
list Lists commands
The foo
command will print Hello world!
.
Container Builder
This module provide a gateway to integrate the container builder from Symfony2.
Router
Once you're using the container builder, the route listener will be automatically added. You have just to provide your
routing.yml
file inside the config folder.