Skip to content

Commit

Permalink
Correctly receive and catch NoSQL backends here too.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Jun 20, 2014
1 parent edb3056 commit bf0a88d
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions imp/lib/Application.php
Expand Up @@ -486,13 +486,28 @@ public function nosqlDrivers()
$out = array();

$backends = array(
'Horde_Imap_Client_Cache_Backend_Mongo' => $injector->getInstance('IMP_Factory_Imap')->create()->config->cache_params['backend']->backend,
'IMP_Sentmail_Mongo' => $injector->getInstance('IMP_Sentmail')
'Horde_Imap_Client_Cache_Backend_Mongo' => function() use ($injector) {
$backend = $injector
->getInstance('IMP_Factory_Imap')
->create()
->config
->cache_params['backend'];
if (isset($backend->backend)) {
return $backend->backend;
}
},
'IMP_Sentmail_Mongo' => function() use ($injector) {
return $injector->getInstance('IMP_Sentmail');
},
);

foreach ($backends as $key => $val) {
if ($val instanceof $key) {
$out[] = $val;
foreach ($backends as $key => $func) {
try {
$val = $func();
if ($val instanceof $key) {
$drivers[] = $val;
}
} catch (Horde_Exception $e) {
}
}

Expand Down

0 comments on commit bf0a88d

Please sign in to comment.