Documentation

Horde_Imap_Client_Cache
in package

An interface to cache data retrieved from the IMAP server.

Tags
author

Michael Slusarz slusarz@horde.org

category

Horde

copyright

2005-2017 Horde LLC

license

http://www.horde.org/licenses/lgpl21 LGPL 2.1

Table of Contents

$_backend  : Horde_Imap_Client_Cache_Backend
Storage backend.
$_baseob  : Horde_Imap_Client_Base
Base client object.
$_debug  : Horde_Imap_Client_Base_Debug
Debug output.
$_params  : array<string|int, mixed>
The configuration params.
__construct()  : mixed
Constructor.
clear()  : mixed
Clear the cache.
deleteMailbox()  : mixed
Delete a mailbox from the cache.
deleteMsgs()  : mixed
Delete messages in the cache.
get()  : array<string|int, mixed>
Get information from the cache.
getMetaData()  : array<string|int, mixed>
Get metadata information for a mailbox.
set()  : mixed
Store information in cache.
setMetaData()  : mixed
Set metadata information for a mailbox.

Properties

$_debug

Debug output.

protected Horde_Imap_Client_Base_Debug $_debug = \false

$_params

The configuration params.

protected array<string|int, mixed> $_params = array()

Methods

__construct()

Constructor.

public __construct([array<string|int, mixed> $params = array() ]) : mixed
Parameters
$params : array<string|int, mixed> = array()

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
Return values
mixed

clear()

Clear the cache.

public clear([int $lifetime = null ]) : mixed
Parameters
$lifetime : int = null

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

Tags
since
2.9.0
Return values
mixed

deleteMailbox()

Delete a mailbox from the cache.

public deleteMailbox(string $mbox) : mixed
Parameters
$mbox : string

The mailbox to delete.

Return values
mixed

deleteMsgs()

Delete messages in the cache.

public deleteMsgs(string $mailbox, array<string|int, mixed> $uids) : mixed
Parameters
$mailbox : string

An IMAP mailbox string.

$uids : array<string|int, mixed>

The list of message UIDs to delete.

Return values
mixed

get()

Get information from the cache.

public get(string $mailbox[, array<string|int, mixed> $uids = array() ][, array<string|int, mixed> $fields = array() ][, int $uidvalid = null ]) : array<string|int, mixed>
Parameters
$mailbox : string

An IMAP mailbox string.

$uids : array<string|int, mixed> = array()

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

$fields : array<string|int, mixed> = array()

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

$uidvalid : int = null

The IMAP uidvalidity value of the mailbox.

Return values
array<string|int, mixed>

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.

getMetaData()

Get metadata information for a mailbox.

public getMetaData(string $mailbox[, int $uidvalid = null ][, array<string|int, mixed> $entries = array() ]) : array<string|int, mixed>
Parameters
$mailbox : string

An IMAP mailbox string.

$uidvalid : int = null

The IMAP uidvalidity value of the mailbox.

$entries : array<string|int, mixed> = array()

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

Return values
array<string|int, mixed>

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.

set()

Store information in cache.

public set(string $mailbox, array<string|int, mixed> $data, int $uidvalid) : mixed
Parameters
$mailbox : string

An IMAP mailbox string.

$data : array<string|int, mixed>

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.

$uidvalid : int

The IMAP uidvalidity value of the mailbox.

Return values
mixed

setMetaData()

Set metadata information for a mailbox.

public setMetaData(string $mailbox, int $uidvalid[, array<string|int, mixed> $data = array() ]) : mixed
Parameters
$mailbox : string

An IMAP mailbox string.

$uidvalid : int

The IMAP uidvalidity value of the mailbox.

$data : array<string|int, mixed> = array()

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

Return values
mixed

Search results