/** */ public function get($key, $lifetime = 0) { $dkey = $this->_getKey($key); $query = array($dkey); if ($lifetime) { $query[] = $lkey = $this->_getKey($key, true); } $res = $this->_hash->get($query); if ($lifetime && (!$res[$lkey] || $lifetime + $res[$lkey] < time())) { return false; } return $res[$dkey]; }
/** * Get the tracking IDs. * * @return array Tracking IDs. */ protected function _getTrackIds() { if (($ids = $this->_hash->get($this->_trackID)) === false || !($ids = json_decode($ids, true))) { $ids = array(); } return $ids; }
/** * Load UIDs by regenerating from the cache. * * @param string $mailbox The mailbox to load. * @param array $uids The UIDs to load. * @param integer $uidvalid The IMAP uidvalidity value of the mailbox. */ protected function _loadUids($mailbox, $uids, $uidvalid = null) { if (!isset($this->_data[$mailbox])) { $this->_data[$mailbox] = array(); } $this->_loadMailbox($mailbox, $uidvalid); if (empty($uids)) { return; } $ptr =& $this->_data[$mailbox]; $load = array_flip(array_diff_key($this->_getMsgCids($mailbox, array_unique(array_intersect($this->_mbox[$mailbox]['u']->ids, $uids))), $this->_data[$mailbox])); foreach (array_filter($this->_hash->get(array_keys($load))) as $key => $val) { $ptr[$load[$key]] = $val; } }