Zeta Components Manual :: Docs For Class ezcMailStorageSet
Mail::ezcMailStorageSet
Class ezcMailStorageSet
ezcMailStorageSet is a wrapper around other mail sets and provides saving of mail sources to files.
Example:
- // create a new POP3 transport object and a mail parser object
- $transport->authenticate( "username", "password" );
- // wrap around the set returned by fetchAll()
- // and specify that the sources are to be saved in the folder /tmp/cache
- // parse the storage set
- $mail = $parser->parseMail( $set );
- // get the filenames of the saved mails in the set.
- // The file names are composed of process ID + current time + a counter
- // This array must be saved to be used on a subsequent request
- // get the source of the 4th saved mail.
- // This can be on a subsequent request if the $files array was saved from
- // a previous request
Source for this file: /Mail/src/transports/storage/storage_set.php
Implements interfaces:
Version: | //autogen// |
Method Summary
public ezcMailStorageSet |
__construct(
$set
, $location
)
Constructs a new storage set around the provided set. |
public void |
__destruct(
)
Destructs the set. |
public string |
getNextLine(
)
Returns one line of data from the current mail in the set. |
public array(string) |
getSourceFiles(
)
Returns an array of the filenames holding the sources of the mails in this set. |
public bool |
hasData(
)
Returns whether the set has mails. |
public bool |
nextMail(
)
Moves the set to the next mail and returns true upon success. |
Methods
__construct
Constructs a new storage set around the provided set.
$location specifies where to save the message sources. This directory MUST exist and must be writable.
Parameters:
Name | Type | Description |
---|---|---|
$set |
ezcMailParserSet | |
$location |
string |
__destruct
Destructs the set.
Closes any open files.
getNextLine
Returns one line of data from the current mail in the set.
Null is returned if there is no current mail in the set or the end of the mail is reached,
It also writes the line of data to the current file. If the line contains a Message-ID header then the value in the header will be used to rename the file.
Implementation of:
Method | Description |
---|---|
ezcMailParserSet::getNextLine() |
Returns one line of data from the current mail in the set including the ending linebreak. |
getSourceFiles
Returns an array of the filenames holding the sources of the mails in this set.
The format of the returned array is: array( 0 => 'location/filename1', 1 => 'location/filename2',...)
hasData
Returns whether the set has mails.
Implementation of:
Method | Description |
---|---|
ezcMailParserSet::hasData() |
Returns true if mail data is available for parsing. |
nextMail
Moves the set to the next mail and returns true upon success.
False is returned if there are no more mail in the set.
Implementation of:
Method | Description |
---|---|
ezcMailParserSet::nextMail() |
Moves the set to the next mail and returns true upon success. |