Add 'nocache' parameter; documentation.
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 30 Mar 2009 07:31:31 +0000 (01:31 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 30 Mar 2009 17:17:48 +0000 (11:17 -0600)
framework/Imap_Client/lib/Horde/Imap/Client/Base.php
framework/Imap_Client/lib/Horde/Imap/Client/Socket.php

index 1417a08..5cf905c 100644 (file)
@@ -1228,6 +1228,8 @@ abstract class Horde_Imap_Client_Base
      *                         Defaults to an ALL search.
      * @param array $options   Additional options:
      * <pre>
+     * '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:
      * <pre>
@@ -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:
      * <pre>
      * 'mailbox' - (string) The mailbox to update.
      *             DEFAULT: The selected mailbox.
index a08d995..df50df9 100644 (file)
@@ -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);