* mailbox.
*
* @return boolean Returns true if caching is enabled.
- * @throws Horde_Imap_Client_Exception
*/
protected function _initCache($current = false)
{
if (is_null($this->cache)) {
$p = $this->_params;
- $this->cache = Horde_Imap_Client_Cache::singleton(array_merge($p['cache'], array(
- 'debug' => $this->_debug,
- 'hostspec' => $p['hostspec'],
- 'port' => $p['port'],
- 'username' => $p['username']
- )));
+ try {
+ $this->cache = Horde_Imap_Client_Cache::singleton(array_merge($p['cache'], array(
+ 'debug' => $this->_debug,
+ 'hostspec' => $p['hostspec'],
+ 'port' => $p['port'],
+ 'username' => $p['username']
+ )));
+ } catch (InvalidArgumentException $e) {
+ return false;
+ }
}
if (!$current) {
*
* @param array $params The configuration parameters.
*
- * @throws Horde_Imap_Client_Exception
* @throws InvalidArgumentException
*/
- public function __construct($params = array())
+ public function __construct(array $params = array())
{
if (empty($params['cacheob']) ||
empty($params['hostspec']) ||
}
if (is_null($compress)) {
- throw new Horde_Imap_Client_Exception('Horde_Cache does not support the compression type given.');
+ throw new InvalidArgumentException('Horde_Cache does not support the compression type given.');
}
}