Author: Michael Slusarz (slusarz@horde.org)
Example #1
0
 /**
  * Loads basic mailbox information.
  *
  * @param string $mailbox    The mailbox to load.
  * @param integer $uidvalid  The IMAP uidvalidity value of the mailbox.
  */
 protected function _loadMailbox($mailbox, $uidvalid = null)
 {
     if (!isset($this->_mbox[$mailbox]) && ($ob = $this->_hash->get($this->_getCid($mailbox)))) {
         try {
             $this->_mbox[$mailbox] = $this->_pack->unpack($ob);
         } catch (Horde_Pack_Exception $e) {
         }
     }
     if (isset($this->_mbox[$mailbox])) {
         if (is_null($uidvalid) || $uidvalid == $this->_mbox[$mailbox]['d']['uidvalid']) {
             return;
         }
         $this->deleteMailbox($mailbox);
     }
     $this->_mbox[$mailbox] = array('d' => array('uidvalid' => $uidvalid), 'u' => new Horde_Imap_Client_Ids());
 }
Example #2
0
 /**
  * Constructor.
  */
 public function __construct()
 {
     if (empty(self::$_drivers)) {
         $fi = new FilesystemIterator(__DIR__ . '/Pack/Driver');
         $class_prefix = __CLASS__ . '_Driver_';
         foreach ($fi as $val) {
             if ($val->isFile()) {
                 $cname = $class_prefix . $val->getBasename('.php');
                 if (class_exists($cname) && $cname::supported()) {
                     $ob = new $cname();
                     self::$_drivers[$ob->id] = $ob;
                 }
             }
         }
         krsort(self::$_drivers, SORT_NUMERIC);
         self::$_compress = new Horde_Compress_Fast();
     }
 }
Example #3
0
 /**
  * @dataProvider buggyDriverBackendsProvider
  */
 public function testBuggyDriverBackends($data)
 {
     $pack = new Horde_Pack();
     $p = $pack->pack($data, array('drivers' => array('Horde_Pack_Driver_Json', 'Horde_Pack_Driver_Serialize')));
     $this->assertEquals($data, $pack->unpack($p));
 }