\Horde_Imap_Client_Cache

An interface to cache data retrieved from the IMAP server.

Summary

Methods
Properties
Constants
__construct()
get()
set()
getMetaData()
setMetaData()
deleteMsgs()
deleteMailbox()
clear()
No public properties found
No constants found
No protected methods found
$_baseob
$_backend
$_debug
$_params
N/A
No private methods found
No private properties found
N/A

Properties

$_params

$_params : array

The configuration params.

Type

array

Methods

__construct()

__construct(array  $params = array()) 

Constructor.

Parameters

array $params

Configuration parameters:

  - REQUIRED Parameters:
    - backend: (Horde_Imap_Client_Cache_Backend) The cache backend.
    - baseob: (Horde_Imap_Client_Base) The base client object.

  - Optional Parameters:
    - debug: (Horde_Imap_Client_Base_Debug) Debug object.
             DEFAULT: No debug output

get()

get(string  $mailbox, array  $uids = array(), array  $fields = array(), integer  $uidvalid = null) : array

Get information from the cache.

Parameters

string $mailbox

An IMAP mailbox string.

array $uids

The list of message UIDs to retrieve information for. If empty, returns the list of cached UIDs.

array $fields

An array of fields to retrieve. If empty, returns all cached fields.

integer $uidvalid

The IMAP uidvalidity value of the mailbox.

Returns

array —

An array of arrays with the UID of the message as the key (if found) and the fields as values (will be undefined if not found). If $uids is empty, returns the full (unsorted) list of cached UIDs.

set()

set(string  $mailbox, array  $data, integer  $uidvalid) 

Store information in cache.

Parameters

string $mailbox

An IMAP mailbox string.

array $data

The list of data to save. The keys are the UIDs, the values are an array of information to save. If empty, do a check to make sure the uidvalidity is still valid.

integer $uidvalid

The IMAP uidvalidity value of the mailbox.

getMetaData()

getMetaData(string  $mailbox, integer  $uidvalid = null, array  $entries = array()) : array

Get metadata information for a mailbox.

Parameters

string $mailbox

An IMAP mailbox string.

integer $uidvalid

The IMAP uidvalidity value of the mailbox.

array $entries

An array of entries to return. If empty, returns all metadata.

Returns

array —

The requested metadata. Requested entries that do not exist will be undefined. The following entries are defaults and always present:

  • uidvalid: (integer) The UIDVALIDITY of the mailbox.

setMetaData()

setMetaData(string  $mailbox, integer  $uidvalid, array  $data = array()) 

Set metadata information for a mailbox.

Parameters

string $mailbox

An IMAP mailbox string.

integer $uidvalid

The IMAP uidvalidity value of the mailbox.

array $data

The list of data to save. The keys are the metadata IDs, the values are the associated data. The following labels are reserved: 'uidvalid'.

deleteMsgs()

deleteMsgs(string  $mailbox, array  $uids) 

Delete messages in the cache.

Parameters

string $mailbox

An IMAP mailbox string.

array $uids

The list of message UIDs to delete.

deleteMailbox()

deleteMailbox(string  $mbox) 

Delete a mailbox from the cache.

Parameters

string $mbox

The mailbox to delete.

clear()

clear(integer  $lifetime = null) 

Clear the cache.

Parameters

integer $lifetime

Only delete entries older than this (in seconds). If null, deletes all entries.