Example #1
0
 /**
  * Find UID of the specified message sequence ID
  *
  * @param int    $id     Message (sequence) ID
  * @param string $folder Folder name
  *
  * @return int Message UID
  */
 public function id2uid($id, $folder = null)
 {
     if (!strlen($folder)) {
         $folder = $this->folder;
     }
     if (!$this->check_connection()) {
         return null;
     }
     return $this->conn->ID2UID($folder, $id);
 }
Example #2
0
 /**
  * @param int    $id        Message (sequence) ID
  * @param string $mbox_name Mailbox name
  * @return int Message UID
  * @access private
  */
 private function _id2uid($id, $mbox_name = NULL)
 {
     if (!strlen($mbox_name)) {
         $mbox_name = $this->mailbox;
     }
     if ($uid = array_search($id, (array) $this->uid_id_map[$mbox_name])) {
         return $uid;
     }
     if (!($uid = $this->get_cache_id2uid($mbox_name . '.msg', $id))) {
         $uid = $this->conn->ID2UID($mbox_name, $id);
     }
     $this->uid_id_map[$mbox_name][$uid] = $id;
     return $uid;
 }
Example #3
0
 /**
  * Find UID of the specified message sequence ID
  *
  * @param int    $id     Message (sequence) ID
  * @param string $folder Folder name
  *
  * @return int Message UID
  */
 public function id2uid($id, $folder = null)
 {
     if (!strlen($folder)) {
         $folder = $this->folder;
     }
     if ($uid = array_search($id, (array) $this->uid_id_map[$folder])) {
         return $uid;
     }
     if (!$this->check_connection()) {
         return null;
     }
     $uid = $this->conn->ID2UID($folder, $id);
     $this->uid_id_map[$folder][$uid] = $id;
     return $uid;
 }
Example #4
0
 /**
  * Find UID of the specified message sequence ID
  *
  * @param int    $id       Message (sequence) ID
  * @param string $mailbox  Mailbox name
  * @param bool   $force    True to skip cache
  *
  * @return int Message UID
  */
 function id2uid($id, $mailbox = null, $force = false)
 {
     if (!strlen($mailbox)) {
         $mailbox = $this->mailbox;
     }
     if ($uid = array_search($id, (array) $this->uid_id_map[$mailbox])) {
         return $uid;
     }
     if (!$force && ($mcache = $this->get_mcache_engine())) {
         $uid = $mcache->id2uid($mailbox, $id);
     }
     if (empty($uid)) {
         $uid = $this->conn->ID2UID($mailbox, $id);
     }
     $this->uid_id_map[$mailbox][$uid] = $id;
     return $uid;
 }