Skip to content

Commit bfa69d5

Browse files
authored
Merge pull request #438 from php-enqueue/makasim-patch-1
[mongodb] Parse DSN if array
2 parents 53635ce + 7e85b4b commit bfa69d5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: pkg/mongodb/MongodbConnectionFactory.php

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public function __construct($config = 'mongodb:')
3535
} elseif (is_string($config)) {
3636
$config = $this->parseDsn($config);
3737
} elseif (is_array($config)) {
38+
$config = $this->parseDsn(empty($config['dsn']) ? 'mongodb:' : $config['dsn']);
3839
} else {
3940
throw new \LogicException('The config must be either an array of options, a DSN string or null');
4041
}

0 commit comments

Comments
 (0)