PHP Class Horde_Imap_Client_Cache_Backend_Cache, horde

Requires the Horde_Cache package.
Author: Michael Slusarz ([email protected])
Inheritance: extends Horde_Imap_Client_Cache_Backend
Datei anzeigen Open project: horde/horde

Protected Properties

Property Type Description
$_cache Horde_Cache The cache object.
$_data array The working data for the current pageload. All changes take place to this data.
$_loaded array The list of cache slices loaded.
$_slicemap array The mapping of UIDs to slices.
$_update array - slice: (array) List of slices that were modified. - slicemap: (boolean) Was slicemap info changed?

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.
serialize ( )
set ( $mailbox, $data, $uidvalid )
setMetaData ( $mailbox, $data )

Protected Methods

Method Description
_deleteMailbox ( string $mbox ) Delete a mailbox from the cache.
_getCid ( string $mailbox, string $slice ) : string Create the unique ID used to store the data in the cache.
_initOb ( ) Initialization tasks.
_loadSlice ( string $mailbox, integer $slice ) Load UIDs from a cache slice.
_loadSliceMap ( string $mailbox, integer $uidvalid = null ) Load the slicemap for a given mailbox. The slicemap contains the uidvalidity information, the UIDs->slice lookup table, and any metadata that needs to be saved for the mailbox.
_loadUids ( string $mailbox, array $uids, integer $uidvalid = null ) Load UIDs by regenerating from the cache.
_toUpdate ( string $mailbox, string $type, mixed $data ) Add update entry for a mailbox.

Method Details

__construct() public method

Constructor.
public __construct ( array $params = [] )
$params array Configuration parameters:
  - REQUIRED Parameters:
    - cacheob: (Horde_Cache) The cache object to use.

  - Optional Parameters:
    - lifetime: (integer) The lifetime of the cache data (in seconds).
                DEFAULT: 1 week (604800 seconds)
    - slicesize: (integer) The slicesize to use.
                 DEFAULT: 50

_deleteMailbox() protected method

Delete a mailbox from the cache.
protected _deleteMailbox ( string $mbox )
$mbox string The mailbox to delete.

_getCid() protected method

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

_initOb() protected method

Initialization tasks.
protected _initOb ( )

_loadSlice() protected method

Load UIDs from a cache slice.
protected _loadSlice ( string $mailbox, integer $slice )
$mailbox string The mailbox to load.
$slice integer The slice to load.

_loadSliceMap() protected method

Load the slicemap for a given mailbox. The slicemap contains the uidvalidity information, the UIDs->slice lookup table, and any metadata that needs to be saved for the mailbox.
protected _loadSliceMap ( string $mailbox, integer $uidvalid = null )
$mailbox string The mailbox.
$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.

_toUpdate() protected method

Add update entry for a mailbox.
protected _toUpdate ( string $mailbox, string $type, mixed $data )
$mailbox string The mailbox.
$type string 'add', 'slice', or 'slicemap'.
$data mixed The data to update.

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 ( )

serialize() public method

public serialize ( )

set() public method

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

setMetaData() public method

public setMetaData ( $mailbox, $data )

Property Details

$_cache protected_oe property

The cache object.
protected Horde_Cache $_cache
return Horde_Cache

$_data protected_oe property

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

$_loaded protected_oe property

The list of cache slices loaded.
protected array $_loaded
return array

$_slicemap protected_oe property

The mapping of UIDs to slices.
protected array $_slicemap
return array

$_update protected_oe property

- slice: (array) List of slices that were modified. - slicemap: (boolean) Was slicemap info changed?
protected array $_update
return array