Skip to content

Commit

Permalink
[jan] Catch errors from NoSQL preference backend.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Nov 25, 2016
1 parent 72a6340 commit 6df8309
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
22 changes: 14 additions & 8 deletions framework/Core/lib/Horde/Core/Factory/Prefs.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,22 @@ public function create($scope = 'horde', array $opts = array())
$params = array();
$opts['cache'] = $conf['prefs']['driver'] == 'Session';
} else {
$driver = $conf['prefs']['driver'];
switch (Horde_String::lower($driver)) {
case 'nosql':
$nosql = $this->_injector->getInstance('Horde_Core_Factory_Nosql')->create('horde', 'prefs');
if ($nosql instanceof Horde_Mongo_Client) {
$driver = 'mongo';
try {
$driver = $conf['prefs']['driver'];
switch (Horde_String::lower($driver)) {
case 'nosql':
$nosql = $this->_injector->getInstance('Horde_Core_Factory_Nosql')->create('horde', 'prefs');
if ($nosql instanceof Horde_Mongo_Client) {
$driver = 'mongo';
}
break;
}
break;
$driver = $this->_getDriverName($driver, 'Horde_Prefs_Storage');
} catch (Horde_Exception $e) {
$this->_notifyError($e);
$driver = 'Horde_Prefs_Storage_Null';
$opts['cache'] = false;
}
$driver = $this->_getDriverName($driver, 'Horde_Prefs_Storage');
$params = Horde::getDriverConfig('prefs', $driver);
}

Expand Down
2 changes: 2 additions & 0 deletions framework/Core/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [jan] Catch errors from NoSQL preference backend.
* [jan] Make &apos;hostspec&apos; parameter for MongoDB configuration optional again on PHP 7.
* [jan] Fix session preference driver.
* [jan] Don&apos;t pollute DB DSN with unknown parameters when using Cyrsql authentication driver.
Expand Down Expand Up @@ -4321,6 +4322,7 @@
<date>2016-11-14</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [jan] Catch errors from NoSQL preference backend.
* [jan] Make &apos;hostspec&apos; parameter for MongoDB configuration optional again on PHP 7.
* [jan] Fix session preference driver.
* [jan] Don&apos;t pollute DB DSN with unknown parameters when using Cyrsql authentication driver.
Expand Down

0 comments on commit 6df8309

Please sign in to comment.