Skip to content
Browse files

Merge branch 'PullReq-37'

  • Loading branch information...
2 parents f07a3c3 + 01e1ad3 commit 3d2a027b7cc8534102e995fbba5b3e4b251469fb @ichikaway committed
Showing with 5 additions and 4 deletions.
  1. +5 −4 models/datasources/mongodb_source.php
View
9 models/datasources/mongodb_source.php 100644 → 100755
@@ -180,15 +180,16 @@ public function connect() {
if (isset($this->config['replicaset']) && count($this->config['replicaset']) === 2) {
$this->connection = new Mongo($this->config['replicaset']['host'], $this->config['replicaset']['options']);
- if (isset($this->config['slaveok'])) {
- $this->connection->setSlaveOkay($this->config['slaveok']);
- }
} else if ($this->_driverVersion >= '1.2.0') {
$this->connection = new Mongo($host, array("persist" => $this->config['persistent']));
} else {
$this->connection = new Mongo($host, true, $this->config['persistent']);
}
-
+
+ if (isset($this->config['slaveok'])) {
+ $this->connection->setSlaveOkay($this->config['slaveok']);
+ }
+
if ($this->_db = $this->connection->selectDB($this->config['database'])) {
if (!empty($this->config['login']) && $this->_driverVersion < '1.2.0') {
$return = $this->_db->authenticate($this->config['login'], $this->config['password']);

0 comments on commit 3d2a027

Please sign in to comment.
Something went wrong with that request. Please try again.