Only save the IMAP object once per session
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 7 Sep 2010 07:24:58 +0000 (01:24 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 7 Sep 2010 07:24:58 +0000 (01:24 -0600)
imp/lib/Imap.php

index 8fafb2c..bcdbdd8 100644 (file)
@@ -62,9 +62,9 @@ class IMP_Imap
         $this->_serverkey = $serverkey;
 
         /* Rebuild the Horde_Imap_Client object. */
-        $this->_loadImapObject();
-
-        register_shutdown_function(array($this, 'shutdown'));
+        if (!$this->_loadImapObject()) {
+            register_shutdown_function(array($this, 'shutdown'));
+        }
     }
 
     /**