Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/myurasov/silex-mongodb-provider

MongoDB provider for Silex applications
https://github.com/myurasov/silex-mongodb-provider

Last synced: 3 days ago
JSON representation

MongoDB provider for Silex applications

Awesome Lists containing this project

README

        

# MongoDB Provider for Silex Applications

## Installation with Composer

Add the following line to your _composer.json_ __require__ section:

```
"myurasov/silex-mongodb-provider": "*"
```

Or do

`composer require myurasov/silex-mongodb-provider`

## Service Registration

```
$app->register(new MongoClientProvider(), [config options]);
```

Then `$app['mongodb.mongo_client']` service becomes available.

## Confuguration Options

```
$app['mongodb.mongo_client_options'] = [
'server' => ,
'options' => ,
'driver_options' =>
];

$app['mongodb.db'] = ;
```

See [http://php.net/manual/en/mongoclient.construct.php](http://php.net/manual/en/mongoclient.construct.php) for more info on parameters above.

## License

[WTFPL](http://www.wtfpl.net/)