ebichan / silex-amqp-provider
AMQP service provider for the Silex framework.
Installs: 66 346
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 9
Open Issues: 2
Requires
- php-amqplib/php-amqplib: 2.6.*
- pimple/pimple: *
- silex/silex: 1.*
This package is not auto-updated.
Last update: 2025-05-02 05:57:01 UTC
README
Amqp service provider for the Silex framework.
This repository is strongly inspired by the work of Vitaliy Chesnokov on his Mongo Silex Provider.
Install via composer
Add in your composer.json
the require entry for this library.
{ "require": { "ebichan/silex-amqp-provider": "dev-master" } }
and run composer install
(or update
) to download all files.
Usage
Service registration
$app->register(new AmqpServiceProvider, array( 'amqp.connections' => array( 'default' => array( 'host' => 'localhost', 'port' => 5672, 'username' => 'guest', 'password' => 'guest', 'vhost' => '/' ) ), ));
Connections retrieving
$connections = $app['amqp']; $defaultConnection = $connections['default'];
Creating amqp connection via factory
$amqpFactory = $app['amqp.factory']; $customConnection = $amqpFactory('localhost', 5672, 'guest', 'guest', '/');