dev-master
9999999-dev
MIT
The Requires
by Olaf Gałązka
mongodb symfony2 bundle symfony3 mongo php7 php5 php-mongo
dev-develop
dev-develop
MIT
The Requires
by Olaf Gałązka
mongodb symfony2 bundle symfony3 mongo php7 php5 php-mongo
Wallogit.com
2017 © Pedro Peláez
A Symfony bundle for MongoDB. Compatible with new mongodb driver, unlike the doctrine/mongodb which is compatible only with deprecated and no longer supported mongo driver., (*1)
See: https://docs.mongodb.com/ecosystem/drivers/php/#compatibility, (*2)
Install bundle using composer:, (*3)
php composer.phar require "ulff/php-mongodb-client-bundle:dev-master"
Enable the bundle in AppKernel.php:, (*4)
// app/AppKernel.php
public function registerBundles()
{
$bundles = [
// ...
new Ulff\PhpMongodbClientBundle\UlffPhpMongodbClientBundle(),
];
// ...
}
Add configuration to config.yml. Minimal required is:, (*5)
# app/config/config.yml
ulff_php_mongodb_client:
connection:
host: hostname-here
There are also other configuration options, like:, (*6)
# app/config/config.yml
ulff_php_mongodb_client:
connection:
host: hostname-here
port: 27017 # optional, default 27017
username: username-here # optional, default not set
password: password-here # optional, default not set
options: { }
# any custom connection options here, passed as assoc array
Replace values with proper ones., (*7)
Mongodb client is available as a service:, (*8)
$client = $this->get('ulff_php_mongodb_client.client');
Service provides access to the mongodb manager:, (*9)
$manager = $this->get('ulff_php_mongodb_client.client')->getManger();
MIT
mongodb symfony2 bundle symfony3 mongo php7 php5 php-mongo
MIT
mongodb symfony2 bundle symfony3 mongo php7 php5 php-mongo