From d3026003f090aa705136073edfd331d6d350398c Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Mon, 30 Mar 2009 01:31:31 -0600 Subject: [PATCH] Add 'nocache' parameter; documentation. --- framework/Imap_Client/lib/Horde/Imap/Client/Base.php | 9 ++++++--- framework/Imap_Client/lib/Horde/Imap/Client/Socket.php | 6 +++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/framework/Imap_Client/lib/Horde/Imap/Client/Base.php b/framework/Imap_Client/lib/Horde/Imap/Client/Base.php index 1417a0805..5cf905cc3 100644 --- a/framework/Imap_Client/lib/Horde/Imap/Client/Base.php +++ b/framework/Imap_Client/lib/Horde/Imap/Client/Base.php @@ -1228,6 +1228,8 @@ abstract class Horde_Imap_Client_Base * Defaults to an ALL search. * @param array $options Additional options: *
+     * 'nocache' - (boolean) Don't cache the results.
+     *             DEFAULT: false (results cached, if possible)
      * 'results' - (array) The data to return. Consists of zero or more of the
      *                     following flags:
      * 
@@ -1340,7 +1342,8 @@ abstract class Horde_Imap_Client_Base
          * array - the generated query is already added to '_query' key
          * above. */
         $cache = null;
-        if ($this->_initCache(true) &&
+        if (empty($options['nocache']) &&
+            $this->_initCache(true) &&
             (isset($this->_init['enabled']['CONDSTORE']) ||
              !$query->flagSearch())) {
             $cache = $this->_getSearchCache('search', $mailbox, $options);
@@ -2472,8 +2475,8 @@ abstract class Horde_Imap_Client_Base
     /**
      * Store FETCH data in cache.
      *
-     * @param array $data      The data array.
-     * @param array $options   Additional options:
+     * @param array $data     The data array.
+     * @param array $options  Additional options:
      * 
      * 'mailbox' - (string) The mailbox to update.
      *             DEFAULT: The selected mailbox.
diff --git a/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php b/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php
index a08d99563..df50df9e1 100644
--- a/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php
+++ b/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php
@@ -1346,9 +1346,9 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base
             }
         }
 
-        /* We need to get Msgno -> UID lookup table if we are caching.
-         * Apparently, there is no guarantee that if we are using QRESYNC that
-         * we will get VANISHED responses, so we need to do this. */
+        /* We need to get sequence num -> UID lookup table if we are caching.
+         * There is no guarantee that if we are using QRESYNC that we will get
+         * VANISHED responses, so this is necessary. */
         if ($use_cache && is_null($s_res)) {
             /* Keys in $s_res['sort'] start at 0, not 1. */
             $s_res = $this->_getSeqUIDLookup(null, false);
-- 
2.11.0