PHP Class Horde_Imap_Client_Cache_Backend_Hashtable, horde

Requires the Horde_HashTable and Horde_Pack packages.
Since: 2.17.0
Author: Michael Slusarz ([email protected])
Inheritance: extends Horde_Imap_Client_Cache_Backend
Show file Open project: horde/horde

Protected Properties

Property Type Description
$_data array The working data for the current pageload. All changes take place to this data.
$_hash Horde_HashTable HashTable object.
$_mbox array Mailbox level data.
$_pack Horde_Pack Horde_Pack singleton object.
$_update array Keys are mailboxes. Values are arrays with three possible keys:
  - d: UIDs to delete
  - m: Was metadata updated?
  - u: UIDs to update

Public Methods

Method Description
__construct ( array $params = [] ) Constructor.
clear ( $lifetime )
deleteMailbox ( $mailbox )
deleteMsgs ( $mailbox, $uids )
get ( $mailbox, $uids, $fields, $uidvalid )
getCachedUids ( $mailbox, $uidvalid )
getMetaData ( $mailbox, $uidvalid, $entries )
save ( ) Updates the cache.
set ( $mailbox, $data, $uidvalid )
setMetaData ( $mailbox, $data )

Protected Methods

Method Description
_getCid ( string $mailbox ) : string Create the unique ID used to store the mailbox data in the cache.
_getMsgCids ( string $mailbox, array $ids ) : array Return a list of cache IDs for mailbox/UID pairs.
_initOb ( )
_loadMailbox ( string $mailbox, integer $uidvalid = null ) Loads basic mailbox information.
_loadUids ( string $mailbox, array $uids, integer $uidvalid = null ) Load UIDs by regenerating from the cache.

Method Details

__construct() public method

Constructor.
public __construct ( array $params = [] )
$params array Configuration parameters:
  - REQUIRED parameters:
    - hashtable: (Horde_HashTable) A HashTable object.

  - Optional Parameters:
    - lifetime: (integer) The lifetime of the cache data (in seconds).
                DEFAULT: 604800 seconds (1 week) [@since 2.19.0]

_getCid() protected method

Create the unique ID used to store the mailbox data in the cache.
protected _getCid ( string $mailbox ) : string
$mailbox string The mailbox to cache.
return string The cache ID.

_getMsgCids() protected method

Return a list of cache IDs for mailbox/UID pairs.
protected _getMsgCids ( string $mailbox, array $ids ) : array
$mailbox string The mailbox to cache.
$ids array The UID list.
return array List of UIDs => cache IDs.

_initOb() protected method

protected _initOb ( )

_loadMailbox() protected method

Loads basic mailbox information.
protected _loadMailbox ( string $mailbox, integer $uidvalid = null )
$mailbox string The mailbox to load.
$uidvalid integer The IMAP uidvalidity value of the mailbox.

_loadUids() protected method

Load UIDs by regenerating from the cache.
protected _loadUids ( string $mailbox, array $uids, integer $uidvalid = null )
$mailbox string The mailbox to load.
$uids array The UIDs to load.
$uidvalid integer The IMAP uidvalidity value of the mailbox.

clear() public method

public clear ( $lifetime )

deleteMailbox() public method

public deleteMailbox ( $mailbox )

deleteMsgs() public method

public deleteMsgs ( $mailbox, $uids )

get() public method

public get ( $mailbox, $uids, $fields, $uidvalid )

getCachedUids() public method

public getCachedUids ( $mailbox, $uidvalid )

getMetaData() public method

public getMetaData ( $mailbox, $uidvalid, $entries )

save() public method

Updates the cache.
public save ( )

set() public method

public set ( $mailbox, $data, $uidvalid )

setMetaData() public method

public setMetaData ( $mailbox, $data )

Property Details

$_data protected property

The working data for the current pageload. All changes take place to this data.
protected array $_data
return array

$_hash protected property

HashTable object.
protected Horde_HashTable $_hash
return Horde_HashTable

$_mbox protected property

Mailbox level data.
protected array $_mbox
return array

$_pack protected property

Horde_Pack singleton object.
protected Horde_Pack $_pack
return Horde_Pack

$_update protected property

Keys are mailboxes. Values are arrays with three possible keys:
  - d: UIDs to delete
  - m: Was metadata updated?
  - u: UIDs to update
protected array $_update
return array