Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
Driver options for Mongo.
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfy-j committed Nov 28, 2016
1 parent dd5a4fa commit e459db1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions source/Spiral/ODM/Entities/MongoDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class MongoDatabase extends \MongoDB implements InjectableInterface
* Profiling levels. Not identical to MongoDB profiling levels.
*/
const PROFILE_DISABLED = false;
const PROFILE_SIMPLE = 1;
const PROFILE_EXPLAIN = 2;
const PROFILE_SIMPLE = 1;
const PROFILE_EXPLAIN = 2;

/**
* @var array
Expand All @@ -53,7 +53,11 @@ public function __construct(ODM $odm, $name, array $config)
$this->config = $config + $this->config;

//Selecting client
$client = new \MongoClient($this->config['server'], $this->config['options']);
$client = new \MongoClient(
$this->config['server'],
$this->config['options'],
isset($this->config['driverOptions']) ? $this->config['driverOptions'] : []
);

parent::__construct($client, $this->config['database']);
}
Expand Down

0 comments on commit e459db1

Please sign in to comment.