| | |
| | | public $error; |
| | | public $errornum; |
| | | public $message; |
| | | public $rootdir; |
| | | public $delimiter; |
| | | public $data = array(); |
| | | public $flags = array( |
| | | 'SEEN' => '\\Seen', |
| | |
| | | { |
| | | } |
| | | |
| | | /** |
| | | * Send simple (one line) command to the connection stream |
| | | * |
| | | * @param string $string Command string |
| | | * @param bool $endln True if CRLF need to be added at the end of command |
| | | * |
| | | * @param int Number of bytes sent, False on error |
| | | */ |
| | | function putLine($string, $endln=true) |
| | | { |
| | | if (!$this->fp) |
| | |
| | | return $res; |
| | | } |
| | | |
| | | // $this->putLine replacement with Command Continuation Requests (RFC3501 7.5) support |
| | | /** |
| | | * Send command to the connection stream with Command Continuation |
| | | * Requests (RFC3501 7.5) and LITERAL+ (RFC2088) support |
| | | * |
| | | * @param string $string Command string |
| | | * @param bool $endln True if CRLF need to be added at the end of command |
| | | * |
| | | * @param int Number of bytes sent, False on error |
| | | */ |
| | | function putLineC($string, $endln=true) |
| | | { |
| | | if (!$this->fp) |
| | |
| | | return $code; |
| | | } |
| | | |
| | | /** |
| | | * Gets the root directory and delimiter (of personal namespace) |
| | | * |
| | | * @return mixed A root directory name, or false. |
| | | */ |
| | | function getRootDir() |
| | | { |
| | | if (isset($this->prefs['rootdir']) && is_string($this->prefs['rootdir'])) { |
| | | $this->rootdir = $this->prefs['rootdir']; |
| | | return true; |
| | | return $this->prefs['rootdir']; |
| | | } |
| | | |
| | | if (!is_array($data = $this->getNamespace())) { |
| | |
| | | return false; |
| | | } |
| | | |
| | | $this->rootdir = $first_userspace[0]; |
| | | $this->delimiter = $first_userspace[1]; |
| | | $this->prefs['rootdir'] = substr($this->rootdir, 0, -1); |
| | | $this->prefs['delimiter'] = $this->delimiter; |
| | | $rootdir = $first_userspace[0]; |
| | | $this->prefs['delimiter'] = $first_userspace[1]; |
| | | $this->prefs['rootdir'] = $rootdir ? substr($rootdir, 0, -1) : ''; |
| | | |
| | | return true; |
| | | return $this->prefs['rootdir']; |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | function getHierarchyDelimiter() |
| | | { |
| | | if ($this->delimiter) { |
| | | return $this->delimiter; |
| | | if ($this->prefs['delimiter']) { |
| | | return $this->prefs['delimiter']; |
| | | } |
| | | if (!empty($this->prefs['delimiter'])) { |
| | | return ($this->delimiter = $this->prefs['delimiter']); |
| | | return $this->prefs['delimiter']; |
| | | } |
| | | |
| | | // try (LIST "" ""), should return delimiter (RFC2060 Sec 6.3.8) |
| | |
| | | $delimiter = $args[3]; |
| | | |
| | | if (strlen($delimiter) > 0) { |
| | | $this->delimiter = $delimiter; |
| | | return $delimiter; |
| | | return ($this->prefs['delimiter'] = $delimiter); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | // extract delimiter |
| | | return $this->delimiter = $first_userspace[1]; |
| | | return $this->prefs['delimiter'] = $first_userspace[1]; |
| | | } |
| | | |
| | | /** |
| | |
| | | if (empty($mailbox)) { |
| | | $mailbox = '*'; |
| | | } |
| | | |
| | | if (empty($ref) && $this->rootdir) { |
| | | $ref = $this->rootdir; |
| | | /* |
| | | if (empty($ref) && $this->prefs['rootdir']) { |
| | | $ref = $this->prefs['rootdir']; |
| | | } |
| | | |
| | | */ |
| | | $args = array($this->escape($ref), $this->escape($mailbox)); |
| | | |
| | | if (!empty($status_opts) && $this->getCapability('LIST-STATUS')) { |