2017 © Pedro Peláez
 

library mongodb-service-provider

Silex Service Provider for MongoDB extension

image

lexpress/mongodb-service-provider

Silex Service Provider for MongoDB extension

  • Tuesday, December 16, 2014
  • by GromNaN
  • Repository
  • 6 Watchers
  • 7 Stars
  • 459 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

LExpress / MongoDBServiceProvider

Parameters

  • mongodb.server: (optional) Server to connect.
    Example: 'mongodb.server' => 'mongodb://127.0.0.1:27017,127.0.0.1:27018', (*1)

  • mongodb.options: Array of MongoDB options, (*2)

    • db: DB name (required)
    • username: Authentication user
    • password: Authentication password
    • replicaSet: ReplicaSet name

Services

Using multiple connections

You can use many MongoDB connections by registering the service provider multiple times with a different prefix passed to the constructor., (*3)

use LExpress\Silex\MongoDBServiceProvider;

$app->register(new MongoDBServiceProvider('mongodb.db1'), array(
    'mongodb.db1.options' => array(
        'db' => 'articles',
        'replicaSet' => 'rs1',
    ),
));

$app->register(new MongoDBServiceProvider('mongodb.db2'), array(
    'mongodb.db2.options' => array(
        'db' => 'users',
        'username' => 'bar',
        'password' => 'secret',
    ),
));

That will register 2 services: mongodb.db1 and mongodb.db2., (*4)

The Versions

16/12 2014

dev-master

9999999-dev

Silex Service Provider for MongoDB extension

  Sources   Download

MIT

The Requires

 

by Jérôme Tamarelle
by Medhy DARA

13/02 2014

v1.0.0

1.0.0.0

Silex Service Provider for MongoDB extension

  Sources   Download

MIT

The Requires

 

by Jérôme Tamarelle
by Mehdy Dara