Class rcube_imap_cache

Description

Interface class for accessing Roundcube messages cache

Located in /lib/Roundcube/rcube_imap_cache.php (line 28)


	
			
Variable Summary
 mixed $flags
Method Summary
 rcube_imap_cache __construct ( $db,  $imap,  $userid,  $skip_deleted)
 void add_message (string $mailbox, rcube_message_header $message, [bool $force = false])
 void change_flag (string $mailbox, array $uids, string $flag, [bool $enabled = false])
 void clear ([string $mailbox = null], [array $uids = null])
 void close ()
 void expunge (string $ttl)
 array get_index (string $mailbox, [string $sort_field = null], [string $sort_order = null], [ $existing = false], bool $exiting)
 rcube_message_header get_message (string $mailbox, int $uid, [bool $update = true], [ $cache = true], bool $no_cache)
 array get_messages (string $mailbox, [array $msgs = array()])
 array get_thread (string $mailbox, string $sort_field, string $sort_order)
 void remove_index ([string $mailbox = null], [bool $remove = false])
 void remove_message ([string $mailbox = null], [array $uids = null])
 void remove_thread ([string $mailbox = null])
 void synchronize (string $mailbox)
Variables
mixed $flags = array(
1 => 'SEEN', // RFC3501
2 => 'DELETED', // RFC3501
4 => 'ANSWERED', // RFC3501
8 => 'FLAGGED', // RFC3501
16 => 'DRAFT', // RFC3501
32 => 'MDNSENT', // RFC3503
64 => 'FORWARDED', // RFC5550
128 => 'SUBMITPENDING', // RFC5550
256 => 'SUBMITTED', // RFC5550
512 => 'JUNK',
1024 => 'NONJUNK',
2048 => 'LABEL1',
4096 => 'LABEL2',
8192 => 'LABEL3',
16384 => 'LABEL4',
32768 => 'LABEL5',
)
(line 64)

List of known flags. Thanks to this we can handle flag changes with good performance. Bad thing is we need to know used flags.

  • access: public
Methods
Constructor __construct (line 87)

Object constructor.

rcube_imap_cache __construct ( $db,  $imap,  $userid,  $skip_deleted)
  • $db
  • $imap
  • $userid
  • $skip_deleted
add_message (line 404)

Saves the message in cache.

void add_message (string $mailbox, rcube_message_header $message, [bool $force = false])
  • string $mailbox: Folder name
  • rcube_message_header $message: Message data
  • bool $force: Skips message in-cache existance check
change_flag (line 456)

Sets the flag for specified message.

void change_flag (string $mailbox, array $uids, string $flag, [bool $enabled = false])
  • string $mailbox: Folder name
  • array $uids: Message UIDs or null to change flag of all messages in a folder
  • string $flag: The name of the flag
  • bool $enabled: Flag state
clear (line 598)

Clears the cache.

void clear ([string $mailbox = null], [array $uids = null])
  • string $mailbox: Folder name
  • array $uids: Message UIDs, NULL removes all messages in a folder
close (line 99)

Cleanup actions (on shutdown).

  • access: public
void close ()
expunge (line 611)

Delete cache entries older than TTL

void expunge (string $ttl)
  • string $ttl: Lifetime of message cache entries
get_index (line 117)

Return (sorted) messages index (UIDs).

If index doesn't exist or is invalid, will be updated.

  • return: Messages index
array get_index (string $mailbox, [string $sort_field = null], [string $sort_order = null], [ $existing = false], bool $exiting)
  • string $mailbox: Folder name
  • string $sort_field: Sorting column
  • string $sort_order: Sorting order (ASC|DESC)
  • bool $exiting: Skip index initialization if it doesn't exist in DB
  • $existing
get_message (line 346)

Returns message data.

  • return: Message data
rcube_message_header get_message (string $mailbox, int $uid, [bool $update = true], [ $cache = true], bool $no_cache)
  • string $mailbox: Folder name
  • int $uid: Message UID
  • bool $update: If message doesn't exists in cache it will be fetched from IMAP server
  • bool $no_cache: Enables internal cache usage
  • $cache
get_messages (line 288)

Returns list of messages (headers). See rcube_imap::fetch_headers().

  • return: The list of messages (rcube_message_header) indexed by UID
array get_messages (string $mailbox, [array $msgs = array()])
  • string $mailbox: Folder name
  • array $msgs: Message UIDs
get_thread (line 224)

Return messages thread.

If threaded index doesn't exist or is invalid, will be updated.

  • return: Messages threaded index
array get_thread (string $mailbox, string $sort_field, string $sort_order)
  • string $mailbox: Folder name
  • string $sort_field: Sorting column
  • string $sort_order: Sorting order (ASC|DESC)
remove_index (line 533)

Clears index cache.

void remove_index ([string $mailbox = null], [bool $remove = false])
  • string $mailbox: Folder name
  • bool $remove: Enable to remove the DB row
remove_message (line 500)

Removes message(s) from cache.

void remove_message ([string $mailbox = null], [array $uids = null])
  • string $mailbox: Folder name
  • array $uids: Message UIDs, NULL removes all messages
remove_thread (line 572)

Clears thread cache.

void remove_thread ([string $mailbox = null])
  • string $mailbox: Folder name
synchronize (line 892)

Synchronizes the mailbox.

void synchronize (string $mailbox)
  • string $mailbox: Folder name

Documentation generated on Fri, 03 May 2013 12:45:02 +0200 by phpDocumentor 1.4.4