Class Zend_Mail_Protocol_Imap

Description

Located in /Zend/Mail/Protocol/Imap.php (line 30)


	
			
Variable Summary
 resource|null $_socket
Method Summary
 Zend_Mail_Protocol_Imap __construct ([string $host = ''], [int|null $port = null], [bool $ssl = false])
 void __destruct ()
 array capability ()
 string connect (string $host, [int|null $port = null], [string|bool $ssl = false])
 string escapeList (array $list)
 string|array escapeString (string|array $string)
 bool|array examine ([string $box = 'INBOX'])
 bool|array examineOrSelect ([string $command = 'EXAMINE'], [string $box = 'INBOX'])
 string|array fetch (string|array $items, int $from, [int|null $to = null])
 array listMailbox ([string $reference = ''], [string $mailbox = '*'])
 bool login (string $user, string $password)
 bool logout ()
 bool readLine ([ &$tokens = array()], [string $wantedTag = '*'], [bool $dontParse = false], array|string $tokens)
 null|bool|array readResponse (string $tag, [bool $dontParse = false], string|array $filter)
 mixed requestAndResponse (string $command, [array $tokens = array()], [bool $dontParse = false])
 bool|array select ([string $box = 'INBOX'])
 null sendRequest (string $command, [array $tokens = array()], [ &$tag = null], string $tag)
 bool _assumedNextLine (string $start)
 array _decodeLine (string $line)
 string _nextLine ()
 string _nextTaggedLine ( &$tag, string $tag)
Variables
resource|null $_socket (line 36)

socket to imap server

  • access: protected
Methods
Constructor __construct (line 47)

Public constructor

  • throws: Zend_Mail_Protocol_Exception
Zend_Mail_Protocol_Imap __construct ([string $host = ''], [int|null $port = null], [bool $ssl = false])
  • string $host: hostname of IP address of IMAP server, if given connect() is called
  • int|null $port: port of IMAP server, null for default (143 or 993 for ssl)
  • bool $ssl: use ssl? 'SSL', 'TLS' or false
Destructor __destruct (line 57)

Public destructor

  • access: public
void __destruct ()
capability (line 431)

Get capabilities from IMAP server

  • return: list of capabilities
  • access: public
  • throws: Zend_Mail_Protocol_Exception
array capability ()
connect (line 71)

Open connection to POP3 server

  • return: welcome message
  • access: public
  • throws: Zend_Mail_Protocol_Exception
string connect (string $host, [int|null $port = null], [string|bool $ssl = false])
  • string $host: hostname of IP address of POP3 server
  • int|null $port: of IMAP server, default is 143 (993 for ssl)
  • string|bool $ssl: use 'SSL', 'TLS' or false
escapeList (line 377)

escape a list with literals or lists

  • return: escaped list for imap
  • access: public
string escapeList (array $list)
  • array $list: list with literals or lists as PHP array
escapeString (line 355)

escape one or more literals i.e. for sendRequest

  • return: escape literals, literals with newline ar returned as array('{size}', 'string');
  • access: public
string|array escapeString (string|array $string)
  • string|array $string: the literal/-s
examine (line 505)

examine folder

  • return: see examineOrselect()
  • access: public
  • throws: Zend_Mail_Protocol_Exception
bool|array examine ([string $box = 'INBOX'])
  • string $box: examine this folder
examineOrSelect (line 456)

Examine and select have the same response. The common code for both is in this method

  • return: false if error, array with returned information otherwise (flags, exists, recent, uidvalidity)
  • access: public
  • throws: Zend_Mail_Protocol_Exception
bool|array examineOrSelect ([string $command = 'EXAMINE'], [string $box = 'INBOX'])
  • string $command: can be 'EXAMINE' or 'SELECT' and this is used as command
  • string $box: which folder to change to or examine
fetch (line 524)

fetch one or more items of one or more messages

  • return: if only one item of one message is fetched it's returned as string if items of one message are fetched it's returned as (name => value) if one items of messages are fetched it's returned as (msgno => value) if items of messages are fetchted it's returned as (msgno => (name => value))
  • access: public
  • throws: Zend_Mail_Protocol_Exception
string|array fetch (string|array $items, int $from, [int|null $to = null])
  • string|array $items: items to fetch from message(s) as string (if only one item) or array of strings
  • int $from: message for items or start message if $to !== null
  • int|null $to: if null only one message ($from) is fetched, else it's the last message, INF means last message avaible
listMailbox (line 581)

get mailbox list

this method can't be named after the IMAP command 'LIST', as list is a reserved keyword

  • return: mailboxes that matched $mailbox as array(globalName => array('delim' => .., 'flags' => ..))
  • access: public
  • throws: Zend_Mail_Protocol_Exception
array listMailbox ([string $reference = ''], [string $mailbox = '*'])
  • string $reference: mailbox reference for list
  • string $mailbox: mailbox name match with wildcards
login (line 399)

Login to IMAP server.

  • return: success
  • access: public
  • throws: Zend_Mail_Protocol_Exception
bool login (string $user, string $password)
  • string $user: username
  • string $password: password
logout (line 409)

logout of imap server

  • return: success
  • access: public
bool logout ()
readLine (line 251)

read a response "line" (could also be more than one real line if response has {..}<NL>) and do a simple decode

  • return: if returned tag matches wanted tag
  • access: public
  • throws: Zend_Mail_Protocol_Exception
bool readLine ([ &$tokens = array()], [string $wantedTag = '*'], [bool $dontParse = false], array|string $tokens)
  • array|string $tokens: decoded tokens are returned by reference, if $dontParse is true the unparsed line is returned here
  • string $wantedTag: check for this tag for response code. Default '*' is continuation tag.
  • bool $dontParse: if true only the unparsed line is returned $tokens
  • &$tokens
readResponse (line 275)

read all lines of response until given tag is found (last line of response)

  • return: tokens if success, false if error, null if bad request
  • access: public
  • throws: Zend_Mail_Protocol_Exception
null|bool|array readResponse (string $tag, [bool $dontParse = false], string|array $filter)
  • string $tag: the tag of your request
  • string|array $filter: you can filter the response so you get only the given response lines
  • bool $dontParse: if true every line is returned unparsed instead of the decoded tokens
requestAndResponse (line 340)

send a request and get response at once

  • return: response as in readResponse()
  • access: public
  • throws: Zend_Mail_Protocol_Exception
mixed requestAndResponse (string $command, [array $tokens = array()], [bool $dontParse = false])
  • string $command: command as in sendRequest()
  • array $tokens: parameters as in sendRequest()
  • bool $dontParse: if true unparsed lines are returned instead of tokens
select (line 493)

change folder

  • return: see examineOrselect()
  • access: public
  • throws: Zend_Mail_Protocol_Exception
bool|array select ([string $box = 'INBOX'])
  • string $box: change to this folder
sendRequest (line 304)

send a request

  • access: public
  • throws: Zend_Mail_Protocol_Exception
null sendRequest (string $command, [array $tokens = array()], [ &$tag = null], string $tag)
  • string $command: your request command
  • array $tokens: additional parameters to command, use escapeString() to prepare
  • string $tag: provide a tag otherwise an autogenerated is returned
  • &$tag
_assumedNextLine (line 123)

get next line and assume it starts with $start. some requests give a simple feedback so we can quickly check if we can go on.

  • return: line starts with $start
  • access: protected
  • throws: Zend_Mail_Protocol_Exception
bool _assumedNextLine (string $start)
  • string $start: the first bytes we assume to be in the next line
_decodeLine (line 153)

split a given line in tokens. a token is literal of any form or a list

  • return: tokens, literals are returned as string, lists as array
  • access: protected
  • throws: Zend_Mail_Protocol_Exception
array _decodeLine (string $line)
  • string $line: line to decode
_nextLine (line 105)

get the next line from socket with error checking, but nothing else

  • return: next line
  • access: protected
  • throws: Zend_Mail_Protocol_Exception
string _nextLine ()
_nextTaggedLine (line 136)

get next line and split the tag. that's the normal case for a response line

  • return: next line
  • access: protected
  • throws: Zend_Mail_Protocol_Exception
string _nextTaggedLine ( &$tag, string $tag)
  • string $tag: tag of line is returned by reference
  • &$tag

Documentation generated on Wed, 21 Feb 2007 11:51:32 -0800 by phpDocumentor 1.3.1