Download the PHP package gos/pubsub-router-bundle without Composer
On this page you can find all versions of the php package gos/pubsub-router-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gos/pubsub-router-bundle
More information about gos/pubsub-router-bundle
Files in gos/pubsub-router-bundle
Package pubsub-router-bundle
Short Description Symfony PubSub Router Bundle
License MIT
Homepage https://github.com/GeniusesOfSymfony/PubSubRouterBundle
Informations about the package pubsub-router-bundle
GosPubSubRouterBundle
About
GosPubSubRouterBundle is a Symfony Bundle whose goal is to plug any logic behind pubsub channel. When you use PubSub pattern you will make face to a problem, rely channels with business logic. PubSub router is here to make the junction between channel and business logic.
Support
Version | Status | Symfony Versions |
---|---|---|
1.x | No Longer Supported | 3.4, 4.4, 5.2-5.4 |
2.x | Actively Supported | 4.4, 5.3-5.4, 6.0 |
3.x | In Development | 5.3-5.4, 6.0 |
Features
- [x] Route definition
- [x] Route matching
- [x] Route generator
Installation
Add the bundle to your project using Composer:
Once installed, you will need to add the bundle to your project.
If your project is based on Symfony Flex, the bundle should be automatically added to your config/bundles.php
file:
If your project is based on the Symfony Standard Edition, you will need to add the bundle to your Kernel's registerBundles
method by editing app/AppKernel.php
:
Bundle configuration
Below is an example bundle configuration. For projects based on Symfony Flex, this should be stored in config/packages/gos_pubsub_router.yaml
. For projects based on Symfony Standard Edition, this should be added to app/config/config.yml
.
NOTE : Each router is insulated. If you have several routers in the same class you will need to inject each router that you need.
Usage
Routing definition
Example with websocket pubsub
Example with redis pubsub
NOTE : The handler is not typehinted, this allows you to define the handler callback in any way you'd like (such as an array to call a method on a class or a string to call a PHP function or a service from the container).
Use router
Let's generate a route !
Match your first route !
What about mismatch?
- If you only need to generate route, typehint against
Gos\Bundle\PubSubRouterBundle\Generator\GeneratorInterface
- If you only need to match route, typehint against
Gos\Bundle\PubSubRouterBundle\Matcher\MatcherInterface
- If you need both, typehint against
Gos\Bundle\PubSubRouterBundle\Router\RouterInterface
Router CLI
php bin/console gos:prouter:debug -r websocket
dump all registered routes for websocket router
License
MIT, See LICENSE
file in the root of project.
All versions of pubsub-router-bundle with dependencies
symfony/config Version ^4.4.42 || ^5.4 || ^6.0
symfony/console Version ^4.4.42 || ^5.4 || ^6.0
symfony/dependency-injection Version ^4.4.42 || ^5.4 || ^6.0
symfony/deprecation-contracts Version ^2.1 || ^3.0
symfony/http-foundation Version ^4.4.42 || ^5.4 || ^6.0
symfony/http-kernel Version ^4.4.42 || ^5.4 || ^6.0
symfony/polyfill-php80 Version ^1.22
symfony/yaml Version ^4.4.42 || ^5.4 || ^6.0