Do not load MongoDB driver if no connection exists

This commit is contained in:
cytopia 2018-12-15 17:03:45 +01:00
parent 42630ab62e
commit 788cea98a1
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2

View File

@ -91,10 +91,9 @@ class Mongo extends BaseClass implements BaseInterface
*/
private function command($command)
{
$cmd = new \MongoDB\Driver\Command($command);
if ($this->_mongo) {
try {
$cmd = new \MongoDB\Driver\Command($command);
$cursor = $this->_mongo->executeCommand('admin', $cmd);
return $cursor->toArray();
} catch(\MongoDB\Driver\Exception $e) {