Public Member Functions | Protected Member Functions | Protected Attributes

Zend_Mail_Storage_Mbox Class Reference

Inheritance diagram for Zend_Mail_Storage_Mbox:
Zend_Mail_Storage_Abstract Zend_Mail_Storage_Folder_Mbox

Public Member Functions

 countMessages ()
 getSize ($id=0)
 getMessage ($id)
 getRawHeader ($id, $part=null, $topLines=0)
 getRawContent ($id, $part=null)
 __construct ($params)
 close ()
 noop ()
 removeMessage ($id)
 getUniqueId ($id=null)
 getNumberByUniqueId ($id)
 __sleep ()
 __wakeup ()

Protected Member Functions

 _getPos ($id)
 _isMboxFile ($file, $fileIsString=true)
 _openMboxFile ($filename)

Protected Attributes

 $_fh
 $_filename
 $_filemtime
 $_positions
 $_messageClass = 'Zend_Mail_Message_File'

Detailed Description

Definition at line 48 of file Mbox.php.


Constructor & Destructor Documentation

__construct ( params )

Create instance with parameters Supported parameters are:

  • filename filename of mbox file
Parameters:
$paramsarray mail reader specific parameters
Exceptions:
Zend_Mail_Storage_Exception

See also:
Zend_Mail_Storage_Exception

Reimplemented from Zend_Mail_Storage_Abstract.

Reimplemented in Zend_Mail_Storage_Folder_Mbox.

Definition at line 222 of file Mbox.php.


Member Function Documentation

__sleep (  )

magic method for serialize()

with this method you can cache the mbox class

Returns:
array name of variables

Reimplemented in Zend_Mail_Storage_Folder_Mbox.

Definition at line 416 of file Mbox.php.

__wakeup (  )

magic method for unserialize()

with this method you can cache the mbox class for cache validation the mtime of the mbox file is used

Returns:
null
Exceptions:
Zend_Mail_Storage_Exception

See also:
Zend_Mail_Storage_Exception

Reimplemented in Zend_Mail_Storage_Folder_Mbox.

Definition at line 430 of file Mbox.php.

_getPos ( id ) [protected]

Get positions for mail message or throw exeption if id is invalid

Parameters:
int$idnumber of message
Returns:
array positions as in _positions
Exceptions:
Zend_Mail_Storage_Exception

See also:
Zend_Mail_Storage_Exception

Definition at line 121 of file Mbox.php.

_isMboxFile ( file,
fileIsString = true 
) [protected]

check if given file is a mbox file

if $file is a resource its file pointer is moved after the first line

Parameters:
resource | string$filestream resource of name of file
bool$fileIsStringfile is string or resource
Returns:
bool file is mbox file

Definition at line 250 of file Mbox.php.

_openMboxFile ( filename ) [protected]

open given file as current mbox file

Parameters:
string$filenamefilename of mbox file
Returns:
null
Exceptions:
Zend_Mail_Storage_Exception

See also:
Zend_Mail_Storage_Exception
Zend_Mail_Storage_Exception

Definition at line 282 of file Mbox.php.

close (  )

Close resource for mail lib. If you need to control, when the resource is closed. Otherwise the destructor would call this.

Returns:
void

Reimplemented from Zend_Mail_Storage_Abstract.

Definition at line 336 of file Mbox.php.

countMessages (  )

Count messages all messages in current box

Returns:
int number of messages
Exceptions:
Zend_Mail_Storage_Exception

Reimplemented from Zend_Mail_Storage_Abstract.

Definition at line 86 of file Mbox.php.

getMessage ( id )

Fetch a message

Parameters:
int$idnumber of message
Returns:
Zend_Mail_Message_File
Exceptions:
Zend_Mail_Storage_Exception

Reimplemented from Zend_Mail_Storage_Abstract.

Definition at line 142 of file Mbox.php.

getNumberByUniqueId ( id )

get a message number from a unique id

I.e. if you have a webmailer that supports deleting messages you should use unique ids as parameter and use this method to translate it to message number right before calling removeMessage()

Parameters:
string$idunique id
Returns:
int message number
Exceptions:
Zend_Mail_Storage_Exception

Reimplemented from Zend_Mail_Storage_Abstract.

Definition at line 402 of file Mbox.php.

getRawContent ( id,
part = null 
)

Get raw content of message or part

Parameters:
int$idnumber of message
null | array | string$partpath to part or null for messsage content
Returns:
string raw content

See also:
Zend_Mail_Storage_Exception

Reimplemented from Zend_Mail_Storage_Abstract.

Definition at line 200 of file Mbox.php.

getRawHeader ( id,
part = null,
topLines = 0 
)

Get raw header of message or part

Parameters:
int$idnumber of message
null | array | string$partpath to part or null for messsage header
int$topLinesinclude this many lines with header (after an empty line)
Returns:
string raw header

See also:
Zend_Mail_Storage_Exception

Reimplemented from Zend_Mail_Storage_Abstract.

Definition at line 176 of file Mbox.php.

getSize ( id = 0 )

Get a list of messages with number and size

Parameters:
int | null$idnumber of message or null for all messages
Returns:
int|array size of given message of list with all messages as array(num => size)

Reimplemented from Zend_Mail_Storage_Abstract.

Definition at line 98 of file Mbox.php.

getUniqueId ( id = null )

get unique id for one or all messages

Mbox does not support unique ids (yet) - it's always the same as the message number. That shouldn't be a problem, because we can't change mbox files. Therefor the message number is save enough.

Parameters:
int | null$idmessage number
Returns:
array|string message number for given message or all messages as array
Exceptions:
Zend_Mail_Storage_Exception

Reimplemented from Zend_Mail_Storage_Abstract.

Definition at line 380 of file Mbox.php.

noop (  )

Waste some CPU cycles doing nothing.

Returns:
void

Reimplemented from Zend_Mail_Storage_Abstract.

Definition at line 348 of file Mbox.php.

removeMessage ( id )

stub for not supported message deletion

Returns:
null
Exceptions:
Zend_Mail_Storage_Exception

See also:
Zend_Mail_Storage_Exception

Reimplemented from Zend_Mail_Storage_Abstract.

Definition at line 360 of file Mbox.php.


The documentation for this class was generated from the following file: