package Default
inherited_from \Zend\Mail\Storage\Mbox

 Methods

Create instance with parameters

__construct(array $params) 

Disallowed parameters are:

  • filename use \Zend\Mail\Storage\Mbox for a single file Supported parameters are:
  • dirname rootdir of mbox structure
  • folder intial selected folder, default is 'INBOX'
inherited_from \Zend\Mail\Storage\Mbox::__construct()

Parameters

$params

array mail reader specific parameters

Exceptions

\Zend\Mail\Storage\Exception\InvalidArgumentException

Create instance with parameters

__construct(array $params) 
Inherited

Parameters

$params

array

mail reader specific parameters

Exceptions

\Zend\Mail\Storage\Exception\ExceptionInterface

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\InvalidArgumentException

Returns

booleansupported or not

magic method for serialize()

__sleep() : array

with this method you can cache the mbox class

inherited_from \Zend\Mail\Storage\Mbox::__sleep()

Returns

arrayname of variables

magic method for serialize()

__sleep() : array
Inherited

with this method you can cache the mbox class

Returns

arrayname of variables

magic method for unserialize(), with this method you can cache the mbox class

__wakeup() 

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

inherited_from \Zend\Mail\Storage\Mbox::__wakeup()

magic method for unserialize()

__wakeup() 
Inherited

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\RuntimeException

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

close() 
Inherited

Countable::count()

count() : integer
Inherited

Returns

integer

Count messages messages in current box/folder

countMessages() : integer
Inherited

Exceptions

\Zend\Mail\Storage\Exception\ExceptionInterface

Returns

integernumber of messages

Iterator::current()

current() : \Zend\Mail\Storage\Message
Inherited

Returns

\Zend\Mail\Storage\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(feature_name => true|false[|null])

get \Zend\Mail\Storage\Folder instance for current folder

getCurrentFolder() : \Zend\Mail\Storage\Folder
inherited_from \Zend\Mail\Storage\Folder\FolderInterface::getCurrentFolder()

Exceptions

\Zend\Mail\Storage\Exception\ExceptionInterface

Returns

\Zend\Mail\Storage\Folderinstance of current folder

get root folder or given folder

getFolders(string $rootFolder = null) : \Zend\Mail\Storage\Folder
inherited_from \Zend\Mail\Storage\Folder\FolderInterface::getFolders()

Parameters

$rootFolder

string

get folder structure for given folder, else root

Exceptions

\Zend\Mail\Storage\Exception\InvalidArgumentException

Returns

\Zend\Mail\Storage\Folderroot or wanted folder

Get a message with headers and body

getMessage($id) : \Zend\Mail\Storage\Message
Inherited

Parameters

$id

int number of message

Returns

\Zend\Mail\Storage\Message

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\ExceptionInterface

Returns

integermessage number

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 message content

Returns

stringraw content

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 message 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 $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
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\ExceptionInterface

Returns

arraystringmessage number for given message or all messages as array

Iterator::key()

key() : integer
Inherited

Returns

integerid of current position

Iterator::next()

next() 
Inherited

Keep the resource alive.

noop() 
Inherited

ArrayAccess::offsetExists()

offsetExists(integer $id) : boolean
Inherited

Parameters

$id

integer

Returns

boolean

ArrayAccess::offsetGet()

offsetGet(integer $id) : \Zend\Mail\Storage\Message
Inherited

Parameters

$id

integer

Returns

\Zend\Mail\Storage\Messagemessage object

ArrayAccess::offsetSet()

offsetSet(mixed $id, mixed $value) 
Inherited

Parameters

$id

mixed

$value

mixed

Exceptions

\Zend\Mail\Storage\Exception\RuntimeException

ArrayAccess::offsetUnset()

offsetUnset(integer $id) : boolean
Inherited

Parameters

$id

integer

Returns

booleansuccess

delete a message from current box/folder

removeMessage($id) 
Inherited

Parameters

$id

Iterator::rewind()

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

Parameters

$pos

integer

Exceptions

\Zend\Mail\Storage\Exception\OutOfBoundsException

select given folder

selectFolder(\Zend\Mail\Storage\Folder|string $globalName) 

folder must be selectable!

inherited_from \Zend\Mail\Storage\Folder\FolderInterface::selectFolder()

Parameters

$globalName

\Zend\Mail\Storage\Folderstring

global name of folder or instance for subfolder

Exceptions

\Zend\Mail\Storage\Exception\RuntimeException

Iterator::valid()

valid() : boolean
Inherited

Returns

boolean

find all subfolders and mbox files for folder structure

_buildFolderTree(string $currentDir, \Zend\Mail\Storage\Folder|null $parentFolder = null, string $parentGlobalName = ''

Result is save in \Zend\Mail\Storage\Folder instances with the root in $this->rootFolder. $parentFolder and $parentGlobalName are only used internally for recursion.

Parameters

$currentDir

string

call with root dir, also used for recursion.

$parentFolder

\Zend\Mail\Storage\Foldernull

used for recursion

$parentGlobalName

string

used for recursion

Exceptions

\Zend\Mail\Storage\Exception\InvalidArgumentException

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

getPos(integer $id) : array
Inherited

Parameters

$id

integer

number of message

Exceptions

\Zend\Mail\Storage\Exception\InvalidArgumentException

Returns

arraypositions as in positions

check if given file is a mbox file

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

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

Parameters

$filename

string

filename of mbox file

Exceptions

\Zend\Mail\Storage\Exception\RuntimeException
\Zend\Mail\Storage\Exception\InvalidArgumentException

 Properties

 

name of current folder

$currentFolder : string

Default

 

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 extended class to extend the returned message class

$messageClass : string

Default

'Zend\Mail\Storage\Message'
 

end of Line for messages

$messageEOL : string | null

Default

 

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

$positions : array

Default

 

\Zend\Mail\Storage\Folder root folder for folder structure

$rootFolder : \Zend\Mail\Storage\Folder

Default

 

rootdir of folder structure

$rootdir : string

Default