mirror of
https://github.com/cytopia/devilbox.git
synced 2025-04-16 15:09:01 +00:00
Do not load MongoDB driver if no connection exists
This commit is contained in:
parent
42630ab62e
commit
788cea98a1
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user