category Zend
package Zend_Mail
subpackage Storage
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
inherited_from \Zend_Mail_Storage_Abstract

 Methods

Create instance with parameters Supported parameters are: - filename filename of mbox file

__construct(array $params) 
inherited_from \Zend_Mail_Storage_Abstract::__construct()

Parameters

$params

array

mail reader specific parameters

Exceptions

\Zend_Mail_Storage_Exception

Create instance with parameters

__construct(array $params) 
Inherited

Parameters

$params

array

mail reader specific parameters

Exceptions

\Zend_Mail_Storage_Exception

Destructor calls close() and therefore closes the resource.

__destruct() 
Inherited

Getter for has-properties. The standard has properties are: hasFolder, hasUniqueid, hasDelete, hasCreate, hasTop

__get(string $var) : boolean
Inherited

The valid values for the has-properties are:

  • true if a feature is supported
  • false if a feature is not supported
  • null is it's not yet known or it can't be know if a feature is supported

Parameters

$var

string

property name

Exceptions

\Zend_Mail_Storage_Exception

Returns

booleansupported or not

magic method for serialize()

__sleep() : array

with this method you can cache the mbox class

Returns

arrayname of variables

magic method for unserialize()

__wakeup() : null

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

Exceptions

\Zend_Mail_Storage_Exception

Returns

null

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

close() : void
inherited_from \Zend_Mail_Storage_Abstract::close()

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

close() : null
Inherited

Returns

null

Countable::count()

count() : integer
Inherited

Returns

integer

Count messages all messages in current box

countMessages() : integer
inherited_from \Zend_Mail_Storage_Abstract::countMessages()

Exceptions

\Zend_Mail_Storage_Exception

Returns

integernumber of messages

Count messages messages in current box/folder

countMessages() : integer
Inherited

Exceptions

\Zend_Mail_Storage_Exception

Returns

integernumber of messages

Iterator::current()

current() : \Zend_Mail_Message
Inherited

Returns

\Zend_Mail_Messagecurrent message

Get a full list of features supported by the specific mail lib and the server

getCapabilities() : array
Inherited

Returns

arraylist of features as array(featurename => true|false[|null])

Fetch a message

getMessage(integer $id) : \Zend_Mail_Message_File
inherited_from \Zend_Mail_Storage_Abstract::getMessage()

Parameters

$id

integer

number of message

Exceptions

\Zend_Mail_Storage_Exception

Returns

\Zend_Mail_Message_File

Get a message with headers and body

getMessage(integer $id) : \Zend_Mail_Message
Inherited

Parameters

$id

integer

number of message

Returns

\Zend_Mail_Message

get a message number from a unique id

getNumberByUniqueId(string $id) : integer

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()

inherited_from \Zend_Mail_Storage_Abstract::getNumberByUniqueId()

Parameters

$id

string

unique id

Exceptions

\Zend_Mail_Storage_Exception

Returns

integermessage number

get a message number from a unique id

getNumberByUniqueId(string $id) : integer
Inherited

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

$id

string

unique id

Exceptions

\Zend_Mail_Storage_Exception

Returns

integermessage number

Get raw content of message or part

getRawContent(integer $id, null|array|string $part = null
inherited_from \Zend_Mail_Storage_Abstract::getRawContent()

Parameters

$id

$part

Get raw content of message or part

getRawContent(integer $id, null|array|string $part = null) : string
Inherited

Parameters

$id

integer

number of message

$part

nullarraystring

path to part or null for messsage content

Returns

stringraw content

Get raw header of message or part

getRawHeader(integer $id, null|array|string $part = null, integer $topLines = 0
inherited_from \Zend_Mail_Storage_Abstract::getRawHeader()

Parameters

$id

$part

$topLines

Get raw header of message or part

getRawHeader(integer $id, null|array|string $part = null, integer $topLines = 0) : string
Inherited

Parameters

$id

integer

number of message

$part

nullarraystring

path to part or null for messsage header

$topLines

integer

include this many lines with header (after an empty line)

Returns

stringraw header

Get a list of messages with number and size

getSize(integer|null $id = 0) : integer | array
inherited_from \Zend_Mail_Storage_Abstract::getSize()

Parameters

$id

integernull

number of message or null for all messages

Returns

integerarraysize of given message of list with all messages as array(num => size)

Get a list of messages with number and size

getSize(integer $id = 0) : integer | array
Inherited

Parameters

$id

integer

number of message

Returns

integerarraysize of given message of list with all messages as array(num => size)

get unique id for one or all messages

getUniqueId(integer|null $id = null) : array | string

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.

inherited_from \Zend_Mail_Storage_Abstract::getUniqueId()

Parameters

$id

integernull

message number

Exceptions

\Zend_Mail_Storage_Exception

Returns

arraystringmessage number for given message or all messages as array

get unique id for one or all messages

getUniqueId(integer|null $id = null) : array | string
Inherited

if storage does not support unique ids it's the same as the message number

Parameters

$id

integernull

message number

Exceptions

\Zend_Mail_Storage_Exception

Returns

arraystringmessage number for given message or all messages as array

Iterator::key()

key() : integer
Inherited

Returns

integerid of current position

Iterator::next()

next() : void
Inherited

Waste some CPU cycles doing nothing.

noop() : void
inherited_from \Zend_Mail_Storage_Abstract::noop()

Keep the resource alive.

noop() : null
Inherited

Returns

null

ArrayAccess::offsetExists()

offsetExists(integer $id) : boolean
Inherited

Parameters

$id

integer

Returns

boolean

ArrayAccess::offsetGet()

offsetGet(integer $id) : \Zend_Mail_Message
Inherited

Parameters

$id

integer

Returns

\Zend_Mail_Messagemessage object

ArrayAccess::offsetSet()

offsetSet(\id $id, mixed $value) : void
Inherited

Parameters

$id

\id

$value

mixed

Exceptions

\Zend_Mail_Storage_Exception

ArrayAccess::offsetUnset()

offsetUnset(integer $id) : boolean
Inherited

Parameters

$id

integer

Returns

booleansuccess

stub for not supported message deletion

removeMessage($id) : null
inherited_from \Zend_Mail_Storage_Abstract::removeMessage()

Parameters

$id

Exceptions

\Zend_Mail_Storage_Exception

Returns

null

delete a message from current box/folder

removeMessage($id) : null
Inherited

Parameters

$id

Returns

null

Iterator::rewind()

rewind() : void
Inherited

Rewind always gets the new count from the storage. Thus if you use the interfaces and your scripts take long you should use reset() from time to time.

SeekableIterator::seek()

seek(integer $pos) : void
Inherited

Parameters

$pos

integer

Exceptions

\OutOfBoundsException

Iterator::valid()

valid() : boolean
Inherited

Returns

boolean

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

_getPos(integer $id) : array

Parameters

$id

integer

number of message

Exceptions

\Zend_Mail_Storage_Exception

Returns

arraypositions as in _positions

check if given file is a mbox file

_isMboxFile(resource|string $file, boolean $fileIsString = true) : boolean

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

Parameters

$file

resourcestring

stream resource of name of file

$fileIsString

boolean

file is string or resource

Returns

booleanfile is mbox file

open given file as current mbox file

_openMboxFile(string $filename) : null

Parameters

$filename

string

filename of mbox file

Exceptions

\Zend_Mail_Storage_Exception

Returns

null

 Properties

 

file handle to mbox file

$_fh : null | resource

Default

 

modification date of mbox file for __wakeup

$_filemtime : integer

Default

 

filename of mbox file for __wakeup

$_filename : string

Default

 

class capabilities with default values

$_has : array

Default

array('uniqueid' => true, 'delete' => false, 'create' => false, 'top' => false, 'fetchPart' => true, 'flags' => false)
 

maximum iteration position (= message count)

$_iterationMax : null | integer

Default

null
 

current iteration position

$_iterationPos : integer

Default

0
 

used message class, change it in an extened class to extend the returned message class

$_messageClass : string

Default

'Zend_Mail_Message_File'
inherited_from \Zend_Mail_Storage_Abstract::_messageClass
 

used message class, change it in an extened class to extend the returned message class

$_messageClass : string

Default

'Zend_Mail_Message'
 

start and end position of messages as array('start' => start, 'seperator' => headersep, 'end' => end)

$_positions : array

Default