From b15f8398b3a21a7feb96c3fe9db2a645d9a08401 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 4 Dec 2009 01:56:41 -0700 Subject: [PATCH] phpdoc, make header caching configurable --- framework/Imap_Client/lib/Horde/Imap/Client.php | 16 ++++++++-------- framework/Imap_Client/lib/Horde/Imap/Client/Base.php | 5 +++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/framework/Imap_Client/lib/Horde/Imap/Client.php b/framework/Imap_Client/lib/Horde/Imap/Client.php index 4bbbf1491..856b86927 100644 --- a/framework/Imap_Client/lib/Horde/Imap/Client.php +++ b/framework/Imap_Client/lib/Horde/Imap/Client.php @@ -21,14 +21,14 @@ * 'fields' - [OPTIONAL] (array) The fetch criteria to cache. If not defined, * all cacheable data is cached. The following is a list of * criteria that can be cached: - *
- * Horde_Imap_Client::FETCH_STRUCTURE
- * Horde_Imap_Client::FETCH_ENVELOPE
- * Horde_Imap_Client::FETCH_FLAGS (only if server supports CONDSTORE IMAP
- *                                 extension)
- * Horde_Imap_Client::FETCH_DATE
- * Horde_Imap_Client::FETCH_SIZE
- * 
+ * + Horde_Imap_Client::FETCH_DATE + * + Horde_Imap_Client::FETCH_ENVELOPE + * + Horde_Imap_Client::FETCH_FLAGS + * Only if server supports CONDSTORE extension + * + Horde_Imap_Client::FETCH_HEADERS + * Only for queries that specifically request caching + * + Horde_Imap_Client::FETCH_SIZE + * + Horde_Imap_Client::FETCH_STRUCTURE * 'lifetime' - [OPTIONAL] (integer) The lifetime of the cache data (in secs). * 'slicesize' - [OPTIONAL] (integer) The slicesize to use. * diff --git a/framework/Imap_Client/lib/Horde/Imap/Client/Base.php b/framework/Imap_Client/lib/Horde/Imap/Client/Base.php index 850987c12..ff9d41a0e 100644 --- a/framework/Imap_Client/lib/Horde/Imap/Client/Base.php +++ b/framework/Imap_Client/lib/Horde/Imap/Client/Base.php @@ -123,7 +123,8 @@ abstract class Horde_Imap_Client_Base Horde_Imap_Client::FETCH_ENVELOPE => 1, Horde_Imap_Client::FETCH_FLAGS => 1, Horde_Imap_Client::FETCH_DATE => 1, - Horde_Imap_Client::FETCH_SIZE => 1 + Horde_Imap_Client::FETCH_SIZE => 1, + Horde_Imap_Client::FETCH_HEADERS => 1 ); } else { $params['cache']['fields'] = array_flip($params['cache']['fields']); @@ -2034,7 +2035,7 @@ abstract class Horde_Imap_Client_Base $this->_temp['headers_caching'] = array(); /* Only cache if directly requested. */ - if ($cache_avail) { + if (isset($cf[$k]) && $cache_avail) { $fetch_field = 'headers'; foreach ($v as $key => $val) { -- 2.11.0