Skip to content

Commit

Permalink
[jan] Avoid notice with Horde_Mongo on PHP 7.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Jun 30, 2016
1 parent fefb20a commit cbebe40
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,12 @@ public function set($mailbox, $data, $uidvalid)
self::MSG_UID => $uid
));
} else {
$coll->insert(array(
$doc = array(
self::MSG_DATA => $this->_value($val),
self::MSG_MSGUID => strval($key),
self::MSG_UID => $uid
));
);
$coll->insert($doc);
}
} catch (MongoException $e) {}
}
Expand Down Expand Up @@ -387,12 +388,13 @@ protected function _getUid($mailbox)
*/
protected function _createUid($mailbox)
{
$this->_db->selectCollection(self::BASE)->insert(array(
$doc = array(
self::BASE_HOSTSPEC => $this->_params['hostspec'],
self::BASE_MAILBOX => $mailbox,
self::BASE_PORT => $this->_params['port'],
self::BASE_USERNAME => $this->_params['username']
));
);
$this->_db->selectCollection(self::BASE)->insert($doc);

return $this->_getUid($mailbox);
}
Expand Down
2 changes: 2 additions & 0 deletions framework/Imap_Client/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [jan] Avoid notice with Horde_Mongo on PHP 7.
* [mjr] Catch incorrectly localized Date headers.
</notes>
<contents>
Expand Down Expand Up @@ -3023,6 +3024,7 @@
<date>2016-05-31</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [jan] Avoid notice with Horde_Mongo on PHP 7.
* [mjr] Catch incorrectly localized Date headers.
</notes>
</release>
Expand Down
5 changes: 3 additions & 2 deletions framework/Lock/lib/Horde/Lock/Mongo.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public function setLock($requestor, $scope, $principal,
: ($now + $lifetime);

try {
$this->_db->insert(array(
$doc = array(
self::EXPIRY_TS => $expiration,
self::LID => $lockid,
self::ORIGIN_TS => $now,
Expand All @@ -223,7 +223,8 @@ public function setLock($requestor, $scope, $principal,
self::SCOPE => $scope,
self::TYPE => $type,
self::UPDATE_TS => $now
));
);
$this->_db->insert($doc);
} catch (MongoException $e) {
throw new Horde_Lock_Exception($e);
}
Expand Down
4 changes: 2 additions & 2 deletions framework/Lock/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
*
* [jan] Avoid notice with Horde_Mongo on PHP 7.
</notes>
<contents>
<dir baseinstalldir="/" name="/">
Expand Down Expand Up @@ -347,7 +347,7 @@
<date>2016-02-01</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
*
* [jan] Avoid notice with Horde_Mongo on PHP 7.
</notes>
</release>
</changelog>
Expand Down

0 comments on commit cbebe40

Please sign in to comment.