Class IMP_IMAP_Cache

Description

The IMP_IMAP_Cache:: class extends Horde's IMAP_Cache:: class to add extra IMP-specific functionality.

$Horde: imp/lib/IMAP/Cache.php,v 1.36.2.6 2009/03/10 05:46:40 slusarz Exp $

Copyright 2006-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.fsf.org/copyleft/gpl.html.

Located in /lib/IMAP/Cache.php (line 20)

IMAP_Cache
   |
   --IMP_IMAP_Cache
Variable Summary
 $_arrival $_arrival
 mixed $_tosave
 boolean $_usecache
Method Summary
 IMP_IMAP_Cache IMP_IMAP_Cache ()
 void expireCache (string $mailbox, [integer $mask = 0])
 mixed getCache (resource $imap, string $mailbox, [string $key = null], [boolean $check = true])
 string getCacheID (string $mailbox)
 array getMailboxArrival (string $mailbox, [boolean $delhide = null], [string $base = 'ALL'])
 stdClass getStatus (resource $imap, string $mailbox)
 void storeCache (resource $imap, string $mailbox, [array $values = array()])
 void updateCache (resource $imap, string $mailbox, [array $values = array()])
Variables
$_arrival $_arrival = array() (line 34)

Cached results for the imap_search() call to determine arrival time.

array $_statuscache = array() (line 27)

The cached results of imap_status() calls.

mixed $_tosave = false (line 41)

Has the shutdown function been registered?

boolean $_usecache = false (line 48)

Use Horde_Cache?

Methods
Constructor IMP_IMAP_Cache (line 73)

Constructor

IMP_IMAP_Cache IMP_IMAP_Cache ()
expireCache (line 159)

Flag cached entries as expired.

void expireCache (string $mailbox, [integer $mask = 0])
  • string $mailbox: A mailbox name.
  • integer $mask: A bitmask for the following updates:
     1 = Expire cache entries
     2 = Expire imap_status() entries
     4 = Expire getMailboxArrival() entries
getCache (line 91)

Get data from the cache.

  • return: The data requested, or false if not available.
mixed getCache (resource $imap, string $mailbox, [string $key = null], [boolean $check = true])
  • resource $imap: The IMAP resource stream (not needed).
  • string $mailbox: The full ({hostname}mailbox) mailbox name.
  • string $key: The name of a specific entry to return.
  • boolean $check: Check for updated mailbox?
getCacheID (line 276)

Get the unique mailbox ID for the current mailbox status. Needed because some applications (such as DIMP) may be keeping more than 1 copy of IMAP data (i.e. on the browser, on the server).

  • return: A unique string for the current state of the mailbox.
  • since: IMP 4.2
string getCacheID (string $mailbox)
  • string $mailbox: The full ({hostname}mailbox) mailbox name.
getMailboxArrival (line 235)

Returns the list of message UIDs in arrival order.

  • return: See imap_search().
array getMailboxArrival (string $mailbox, [boolean $delhide = null], [string $base = 'ALL'])
  • string $mailbox: The mailbox to query.
  • boolean $delhide: Use this value instead of the value from IMP::hideDeleteMsgs().
  • string $base: The base IMAP search string - defaults to all.
getStatus (line 185)

Returns and caches the results of an imap_status() call.

  • return: The imap_status() object or the empty string.
stdClass getStatus (resource $imap, string $mailbox)
  • resource $imap: The IMAP resource stream (not needed).
  • string $mailbox: A mailbox name.
singleton (line 59)

Returns a reference to the global IMP_IMAP_Cache object, only creating it if it doesn't already exist.

This method must be invoked as: $imap_cache = &IMP_IMAP_Cache::singleton();

  • return: The global IMP_IMAP_Cache instance.
IMP_IMAP_Cache &singleton ()
storeCache (line 120)

Store data in the cache.

void storeCache (resource $imap, string $mailbox, [array $values = array()])
  • resource $imap: The IMAP resource stream (not needed).
  • string $mailbox: The full ({hostname}mailbox) mailbox name.
  • array $values: The data to add to the cache.
updateCache (line 137)

Store data in the cache, preserving any data already in the cache entry and not altering the current cache key.

void updateCache (resource $imap, string $mailbox, [array $values = array()])
  • resource $imap: The IMAP resource stream (not needed).
  • string $mailbox: The full ({hostname}mailbox) mailbox name.
  • array $values: The data to add to the cache.

Documentation generated on Sun, 30 Jan 2011 05:28:09 +0000 by phpDocumentor 1.4.3