PHP Class Horde_Imap_Client_Cache, horde

Author: Michael Slusarz ([email protected])
Show file Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_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 The configuration params.

Public Methods

Method Description
__construct ( array $params = [] ) Constructor.
clear ( integer $lifetime = null ) Clear the cache.
deleteMailbox ( string $mbox ) Delete a mailbox from the cache.
deleteMsgs ( string $mailbox, array $uids ) Delete messages in the cache.
get ( string $mailbox, array $uids = [], array $fields = [], integer $uidvalid = null ) : array Get information from the cache.
getMetaData ( string $mailbox, integer $uidvalid = null, array $entries = [] ) : array Get metadata information for a mailbox.
set ( string $mailbox, array $data, integer $uidvalid ) Store information in cache.
setMetaData ( string $mailbox, integer $uidvalid, array $data = [] ) Set metadata information for a mailbox.

Method Details

__construct() public method

Constructor.
public __construct ( array $params = [] )
$params 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

clear() public method

Clear the cache.
Since: 2.9.0
public clear ( integer $lifetime = null )
$lifetime integer Only delete entries older than this (in seconds). If null, deletes all entries.

deleteMailbox() public method

Delete a mailbox from the cache.
public deleteMailbox ( string $mbox )
$mbox string The mailbox to delete.

deleteMsgs() public method

Delete messages in the cache.
public deleteMsgs ( string $mailbox, array $uids )
$mailbox string An IMAP mailbox string.
$uids array The list of message UIDs to delete.

get() public method

Get information from the cache.
public get ( string $mailbox, array $uids = [], array $fields = [], integer $uidvalid = null ) : array
$mailbox string An IMAP mailbox string.
$uids array The list of message UIDs to retrieve information for. If empty, returns the list of cached UIDs.
$fields array An array of fields to retrieve. If empty, returns all cached fields.
$uidvalid integer The IMAP uidvalidity value of the mailbox.
return 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.

getMetaData() public method

Get metadata information for a mailbox.
public getMetaData ( string $mailbox, integer $uidvalid = null, array $entries = [] ) : array
$mailbox string An IMAP mailbox string.
$uidvalid integer The IMAP uidvalidity value of the mailbox.
$entries array An array of entries to return. If empty, returns all metadata.
return 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.

set() public method

Store information in cache.
public set ( string $mailbox, array $data, integer $uidvalid )
$mailbox string An IMAP mailbox string.
$data array 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 integer The IMAP uidvalidity value of the mailbox.

setMetaData() public method

Set metadata information for a mailbox.
public setMetaData ( string $mailbox, integer $uidvalid, array $data = [] )
$mailbox string An IMAP mailbox string.
$uidvalid integer The IMAP uidvalidity value of the mailbox.
$data 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'.

Property Details

$_backend protected property

Storage backend.
protected Horde_Imap_Client_Cache_Backend $_backend
return Horde_Imap_Client_Cache_Backend

$_baseob protected property

Base client object.
protected Horde_Imap_Client_Base $_baseob
return Horde_Imap_Client_Base

$_debug protected property

Debug output.
protected Horde_Imap_Client_Base_Debug $_debug
return Horde_Imap_Client_Base_Debug

$_params protected property

The configuration params.
protected array $_params
return array