mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-18 04:31:06 +01:00
allow to switch caching in Horde_Imap_Client off globally via unset(emailadmin_imap::$default_params["cache"]); and do that by default for profiling
This commit is contained in:
parent
0f498492b4
commit
fff55a9eeb
@ -49,6 +49,17 @@ require_once EGW_INCLUDE_ROOT.'/emailadmin/inc/class.defaultimap.inc.php';
|
||||
*/
|
||||
class emailadmin_imap extends Horde_Imap_Client_Socket implements defaultimap
|
||||
{
|
||||
/**
|
||||
* Default parameters for Horde_Imap_Client constructor
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
static public $default_params = array(
|
||||
//'debug' => '/tmp/imap.log', // uncomment to log communitcation with IMAP server
|
||||
//'debug_literal' => true, // uncomment to log mail contents returned by IMAP server
|
||||
'cache' => true, // default caching via emailadmin_horde_cache / egw_cache
|
||||
);
|
||||
|
||||
/**
|
||||
* Label shown in EMailAdmin
|
||||
*/
|
||||
@ -161,21 +172,24 @@ class emailadmin_imap extends Horde_Imap_Client_Socket implements defaultimap
|
||||
}
|
||||
if ($_adminConnection) $this->adminConnection($username);
|
||||
|
||||
parent::__construct(array(
|
||||
$parent_params = array(
|
||||
'username' => $this->params[$_adminConnection ? 'acc_imap_admin_username' : 'acc_imap_username'],
|
||||
'password' => $this->params[$_adminConnection ? 'acc_imap_admin_password' : 'acc_imap_password'],
|
||||
'hostspec' => $this->params['acc_imap_host'],
|
||||
'port' => $this->params['acc_imap_port'],
|
||||
'secure' => $secure,
|
||||
'timeout' => $_timeout,
|
||||
//'debug_literal' => true,
|
||||
//'debug' => '/tmp/imap.log',
|
||||
'cache' => array(
|
||||
)+self::$default_params;
|
||||
|
||||
if ($parent_params['cache'] === true)
|
||||
{
|
||||
$parent_params['cache'] = array(
|
||||
'backend' => new Horde_Imap_Client_Cache_Backend_Cache(array(
|
||||
'cacheob' => new emailadmin_horde_cache(),
|
||||
)),
|
||||
),
|
||||
));
|
||||
);
|
||||
}
|
||||
parent::__construct($parent_params);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user