Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jan 8, 2020. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions library/Zend/Log/Writer/MongoDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function __construct($mongo, $database = null, $collection = null, array
}
if (is_array($mongo)) {
parent::__construct($mongo);
$saveOptions = isset($mongo['save_options']) ? $mongo['save_options'] : null;
$saveOptions = isset($mongo['save_options']) ? $mongo['save_options'] : array();
$collection = isset($mongo['collection']) ? $mongo['collection'] : null;
$database = isset($mongo['database']) ? $mongo['database'] : null;
$mongo = isset($mongo['mongo']) ? $mongo['mongo'] : null;
Expand All @@ -74,10 +74,10 @@ public function __construct($mongo, $database = null, $collection = null, array
}

if (!($mongo instanceof MongoClient || $mongo instanceof Mongo)) {
throw new Exception\InvalidArgumentException(
throw new Exception\InvalidArgumentException(sprintf(
'Parameter of type %s is invalid; must be MongoClient or Mongo',
(is_object($mongo) ? get_class($mongo) : gettype($mongo))
);
));
}

$this->mongoCollection = $mongo->selectCollection($database, $collection);
Expand Down