Class Horde_Imap_Client_Cache
An interface to cache various data retrieved from the IMAP server.
Requires the Horde_Cache package.
Copyright 2005-2012 Horde LLC (http://www.horde.org/)
See the enclosed file COPYING for license information (LGPL). If you
did not receive this file, see http://www.horde.org/licenses/lgpl21.
Methods summary
public
|
#
__construct( array $params = array() )
Constructor.
Parameters
- $params
- Configuration parameters:
<ul>
<li>
REQUIRED Parameters:
<ul>
<li>
baseob: (Horde_Imap_Client_Base) The driver object (@since 1.2.0).
</li>
<li>
cacheob: (Horde_Cache) The cache object to use.
</li>
</ul>
</li>
<li>
DEPRECATED Parameters (as of 1.2.0; replaced by 'baseob'):
<ul>
<li>
hostspec: (string) The IMAP hostspec.
</li>
<li>
port: (string) The IMAP port.
</li>
<li>
username: (string) The IMAP username.
</li>
</ul>
</li>
<li>
Optional Parameters:
<ul>
<li>
debug: (boolean) If true, will output debug information.
DEFAULT: No debug output
</li>
<li>
lifetime: (integer) The lifetime of the cache data (in seconds).
DEFAULT: 1 week (604800 seconds)
</li>
<li>
slicesize: (integer) The slicesize to use.
DEFAULT: 50
</li>
</ul>
</li>
</ul>
|
public
|
#
shutdown( )
Updates the cache on shutdown.
Updates the cache on shutdown.
|
public
array
|
#
get( string $mailbox, array $uids = array(), array $fields = array(), integer $uidvalid = null )
Get information from the cache.
Get information from the cache.
Parameters
- $mailbox
- An IMAP mailbox string.
- $uids
- <p>The list of message UIDs to retrieve
information for. If empty, returns the list
of cached UIDs.</p>
- $fields
- <p>An array of fields to retrieve. If null,
returns all cached fields.</p>
- $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.
|
public
|
#
set( string $mailbox, array $data, integer $uidvalid )
Store information in cache.
Store information in cache.
Parameters
- $mailbox
- An IMAP mailbox string.
- $data
- <p>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.</p>
- $uidvalid
- The IMAP uidvalidity value of the mailbox.
|
public
array
|
#
getMetaData( string $mailbox, integer $uidvalid = null, array $entries = array() )
Get metadata information for a mailbox.
Get metadata information for a mailbox.
Parameters
- $mailbox
- An IMAP mailbox string.
- $uidvalid
- The IMAP uidvalidity value of the mailbox.
- $entries
- <p>An array of entries to return. If empty,
returns all metadata.</p>
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.
|
public
|
#
setMetaData( string $mailbox, integer $uidvalid, array $data = array() )
Set metadata information for a mailbox.
Set metadata information for a mailbox.
Parameters
- $mailbox
- An IMAP mailbox string.
- $uidvalid
- The IMAP uidvalidity value of the mailbox.
- $data
- <p>The list of data to save. The keys are the
metadata IDs, the values are the associated
data. The following labels are reserved:
'uidvalid'.</p>
|
public
|
#
deleteMsgs( string $mailbox, array $uids )
Delete messages in the cache.
Delete messages in the cache.
Parameters
- $mailbox
- An IMAP mailbox string.
- $uids
- The list of message UIDs to delete.
|
public
|
#
deleteMailbox( string $mbox )
Delete a mailbox from the cache.
Delete a mailbox from the cache.
Parameters
- $mbox
- The mailbox to delete.
|