API Documentation

Mail/Storage/Mbox.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Mail
subpackage
Storage
version
$Id: Mbox.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Mail_Storage_Mbox

Description

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Zend_Mail_Storage_Mbox

Extends from
Zend_Mail_Storage_Abstract
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Mail
subpackage
Storage
Properties
$_fh
$_filename
$_filemtime
$_positions
$_messageClass
Methods
countMessages
getSize
_getPos
getMessage
getRawHeader
getRawContent
__construct
_isMboxFile
_openMboxFile
close
noop
removeMessage
getUniqueId
getNumberByUniqueId
__sleep
__wakeup

Description

Properties

$_fh

null|resource $_fh = ''

file handle to mbox file

Details

$_fh
null|resource
visibility
protected
default
final
false
static
false

$_filemtime

int $_filemtime = ''

modification date of mbox file for __wakeup

Details

$_filemtime
int
visibility
protected
default
final
false
static
false

$_filename

string $_filename = ''

filename of mbox file for __wakeup

Details

$_filename
string
visibility
protected
default
final
false
static
false

$_messageClass

string $_messageClass = 'Zend_Mail_Message_File'

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

Details

$_messageClass
string
visibility
protected
default
Zend_Mail_Message_File
final
false
static
false

$_positions

array $_positions = ''

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

Details

$_positions
array
visibility
protected
default
final
false
static
false

Methods

__construct

__construct( $params $params ) :

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

Arguments
$params
$params
array mail reader specific parameters
Details
visibility
public
final
false
static
false
throws

__sleep

__sleep( ) : array

magic method for serialize()

with this method you can cache the mbox class

Output
array
name of variables
Details
visibility
public
final
false
static
false

__wakeup

__wakeup( ) : null

magic method for unserialize()

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

Output
null
Details
visibility
public
final
false
static
false
throws

_getPos

_getPos( int $id ) : array

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

Arguments
$id
int
number of message
Output
array
positions as in _positions
Details
visibility
protected
final
false
static
false
throws

_isMboxFile

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

check if given file is a mbox file

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

Arguments
$file
resourcestring
stream resource of name of file
$fileIsString
bool
file is string or resource
Output
bool
file is mbox file
Details
visibility
protected
final
false
static
false

_openMboxFile

_openMboxFile( string $filename ) : null

open given file as current mbox file

Arguments
$filename
string
filename of mbox file
Output
null
Details
visibility
protected
final
false
static
false
throws

close

close( ) : void

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

Details
visibility
public
final
false
static
false

countMessages

countMessages( ) : int

Count messages all messages in current box

Output
int
number of messages
Details
visibility
public
final
false
static
false
throws

getMessage

getMessage( int $id ) : Zend_Mail_Message_File

Fetch a message

Arguments
$id
int
number of message
Details
visibility
public
final
false
static
false
throws

getNumberByUniqueId

getNumberByUniqueId( string $id ) : int

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

Arguments
$id
string
unique id
Output
int
message number
Details
visibility
public
final
false
static
false
throws

getRawContent

getRawContent(  $id,  $part = null ) :
Arguments
$id
$part
Details
visibility
public
final
false
static
false

getRawHeader

getRawHeader(  $id,  $part = null,  $topLines = 0 ) :
Arguments
$id
$part
$topLines
Details
visibility
public
final
false
static
false

getSize

getSize( int|null $id = 0 ) : int|array

Get a list of messages with number and size

Arguments
$id
intnull
number of message or null for all messages
Output
int|array
size of given message of list with all messages as array(num => size)
Details
visibility
public
final
false
static
false

getUniqueId

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

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.

Arguments
$id
intnull
message number
Output
array|string
message number for given message or all messages as array
Details
visibility
public
final
false
static
false
throws

noop

noop( ) : void

Waste some CPU cycles doing nothing.

Details
visibility
public
final
false
static
false

removeMessage

removeMessage(  $id ) : null

stub for not supported message deletion

Arguments
$id
Output
null
Details
visibility
public
final
false
static
false
throws
Documentation was generated by DocBlox.