public $utils;
/**
+ * The Horde_Imap_Client_Cache object.
+ *
+ * @var Horde_Imap_Client_Cache
+ */
+ public $cache = null;
+
+ /**
* Hash containing connection parameters.
*
* @var array
);
/**
- * The Horde_Imap_Client_Cache object.
- *
- * @var Horde_Imap_Client_Cache
- */
- protected $_cache = null;
-
- /**
* The debug stream.
*
* @var resource
$this->_closeDebug();
// Don't store Horde_Imap_Client_Cache object or temp data.
- $this->_cache = null;
+ $this->cache = null;
$this->_temp = array();
// Encrypt password in serialized object.
return false;
}
- if (is_null($this->_cache)) {
+ if (is_null($this->cache)) {
$p = $this->_params;
- $this->_cache = Horde_Imap_Client_Cache::singleton(array_merge($p['cache'], array(
+ $this->cache = Horde_Imap_Client_Cache::singleton(array_merge($p['cache'], array(
'debug' => $this->_debug,
'hostspec' => $p['hostspec'],
'port' => $p['port'],
public function getCache()
{
$this->_initCache();
- return $this->_cache;
+ return $this->cache;
}
/**
/* Delete mailbox caches. */
if ($this->_initCache()) {
- $this->_cache->deleteMailbox($mailbox);
+ $this->cache->deleteMailbox($mailbox);
}
unset($this->_temp['statuscache'][$mailbox]);
/* Delete mailbox caches. */
if ($this->_initCache()) {
- $this->_cache->deleteMailbox($old);
+ $this->cache->deleteMailbox($old);
}
unset($this->_temp['statuscache'][$old]);
$this->_mode = 0;
if (!is_null($search_res)) {
- $this->_cache->deleteMsgs($mbox, $search_res['match']);
+ $this->cache->deleteMsgs($mbox, $search_res['match']);
}
}
if (!$qresync) {
/* Grab all flags updated since the cached modseq
* val. */
- $metadata = $this->_cache->getMetaData($this->_selected, $status_res['uidvalidity'], array('HICmodseq'));
+ $metadata = $this->cache->getMetaData($this->_selected, $status_res['uidvalidity'], array('HICmodseq'));
if (isset($metadata['HICmodseq']) &&
($metadata['HICmodseq'] != $status_res['highestmodseq'])) {
- $uids = $this->_cache->get($this->_selected, array(), array(), $status_res['uidvalidity']);
+ $uids = $this->cache->get($this->_selected, array(), array(), $status_res['uidvalidity']);
if (!empty($uids)) {
$this->_fetch(array(Horde_Imap_Client::FETCH_FLAGS => true), array('changedsince' => $metadata['HICmodseq'], 'ids' => $uids));
}
/* Get the cached values. */
if (!empty($cache_array)) {
- $data = $this->_cache->get($this->_selected, $uids, $get_fields, $status_res['uidvalidity']);
+ $data = $this->cache->get($this->_selected, $uids, $get_fields, $status_res['uidvalidity']);
}
// Build a list of what we still need.
}
}
- $this->_cache->set($mailbox, $tocache, $uidvalid);
+ $this->cache->set($mailbox, $tocache, $uidvalid);
if (!empty($highestmodseq)) {
$modseq = max($highestmodseq);
- $metadata = $this->_cache->getMetaData($mailbox, $uidvalid, array('HICmodseq'));
+ $metadata = $this->cache->getMetaData($mailbox, $uidvalid, array('HICmodseq'));
if (!isset($metadata['HICmodseq']) ||
($metadata['HICmodseq'] != $modseq)) {
$this->_temp['lastmodseq'][$mailbox] = $metadata['HICmodseq'];
$cache = hash('md5', $type . serialize($options));
$status = $this->status($mailbox, Horde_Imap_Client::STATUS_UIDVALIDITY);
- $metadata = $this->_cache->getMetaData($mailbox, $status['uidvalidity'], array('HICsearch'));
+ $metadata = $this->cache->getMetaData($mailbox, $status['uidvalidity'], array('HICsearch'));
$cacheid = $this->getCacheId($mailbox);
if (isset($metadata['HICsearch']['cacheid']) &&
$status = $this->status($mailbox, Horde_Imap_Client::STATUS_UIDVALIDITY);
$uidvalid = $status['uidvalidity'];
}
- $this->_cache->setMetaData($mailbox, $uidvalid, $data);
+ $this->cache->setMetaData($mailbox, $uidvalid, $data);
}
}
/* If QRESYNC is available, synchronize the mailbox. */
if ($qresync) {
$this->_initCache();
- $metadata = $this->_cache->getMetaData($mailbox, null, array('HICmodseq', 'uidvalid'));
+ $metadata = $this->cache->getMetaData($mailbox, null, array('HICmodseq', 'uidvalid'));
if (isset($metadata['HICmodseq'])) {
- $uids = $this->_cache->get($mailbox);
+ $uids = $this->cache->get($mailbox);
if (!empty($uids)) {
/* This command may cause several things to happen.
* 1. UIDVALIDITY may have changed. If so, we need
if (!empty($expunged)) {
if ($use_cache) {
- $this->_cache->deleteMsgs($mailbox, $expunged);
+ $this->cache->deleteMsgs($mailbox, $expunged);
}
$tmp['mailbox']['messages'] -= $i;
if (strtoupper(reset($data[0])) == 'EARLIER') {
/* Caching is guaranteed to be active if we are using
* QRESYNC. */
- $this->_cache->deleteMsgs($this->_temp['mailbox']['name'], $this->utils->fromSequenceString($data[1]));
+ $this->cache->deleteMsgs($this->_temp['mailbox']['name'], $this->utils->fromSequenceString($data[1]));
}
} else {
/* The second form is just VANISHED. This is returned from an
if (empty($options['replace'])) {
/* Caching is guaranteed to be active if CONDSTORE is
* active. */
- $data = $this->_cache->get($this->_selected, array_keys($uids), array('HICflags'), $this->_temp['mailbox']['uidvalidity']);
+ $data = $this->cache->get($this->_selected, array_keys($uids), array('HICflags'), $this->_temp['mailbox']['uidvalidity']);
foreach ($uids as $uid => $modseq) {
$flags = isset($data[$uid]['HICflags']) ? $data[$uid]['HICflags'] : array();
// Delete cache for mailbox, if it exists.
if ($this->_initCache()) {
- $this->_cache->deleteMailbox($this->_selected);
+ $this->cache->deleteMailbox($this->_selected);
}
break;