PHP Class ezcMailFileParser

Inheritance: extends ezcMailPartParser
Show file Open project: zetacomponents/mail Class Usage Examples

Public Properties

Property Type Description
$fileClass string Change this to your own file class with: $parser = new ezcMailParser(); $parser->options->fileClass = 'myCustomFileClass'; call $parser->parseMail( $set ); where myCustomFileClass extends ezcMailFile.

Public Methods

Method Description
__construct ( string $mainType, string $subType, ezcMailHeadersHolder $headers ) Constructs a new ezcMailFileParser with maintype $mainType subtype $subType and headers $headers.
__destruct ( ) Destructs the parser object.
finish ( ) : ezcMailFile Return the result of the parsed file part.
parseBody ( string $line ) Parse the body of a message line by line.

Private Methods

Method Description
appendStreamFilters ( string $line ) Sets the correct stream filters for the attachment.
openFile ( string $fileName ) : resource Returns the filepointer of the opened file $fileName in a unique directory.

Method Details

__construct() public method

Constructs a new ezcMailFileParser with maintype $mainType subtype $subType and headers $headers.
public __construct ( string $mainType, string $subType, ezcMailHeadersHolder $headers )
$mainType string
$subType string
$headers ezcMailHeadersHolder

__destruct() public method

Closes and removes any open file.
public __destruct ( )

finish() public method

This method is called automatically by the parent part.
public finish ( ) : ezcMailFile
return ezcMailFile

parseBody() public method

This method is called by the parent part on a push basis. When there are no more lines the parent part will call finish() to retrieve the mailPart. The file will be decoded and saved to the given temporary directory within a directory based on the process ID and the time.
public parseBody ( string $line )
$line string

Property Details

$fileClass public static property

Change this to your own file class with: $parser = new ezcMailParser(); $parser->options->fileClass = 'myCustomFileClass'; call $parser->parseMail( $set ); where myCustomFileClass extends ezcMailFile.
public static string $fileClass
return string