Parses content and children of MIME parts.
- author Zaahid Bateson
Methods |
public __construct(ZBateson |
public canParse(ZBateson Returns true if the passed PartBuilder::isMime() method returns true. |
public parseContent(ZBateson |
public parseNextChild(ZBateson |
Properties |
protected ZBateson
|
protected ZBateson
|
Methods |
private createPart(ZBateson Calls the header parser to fill the passed $headerContainer, then calls $this->parserManager->createParserProxyFor($child); The method first checks though if the 'part' represents hidden content past a MIME end boundary, which some messages like to include, for instance:
In this case, $this->parserPartProxyFactory is called directly to create a part, $this->parseContent is called immediately to parse it and discard it, and null is returned. |
private findContentBoundary(ZBateson Reads 2048-byte lines from the passed $handle, calling $partBuilder->setEndBoundaryFound with the passed line until it returns true or the stream is at EOF. setEndBoundaryFound returns true if the passed line matches a boundary for the $partBuilder itself or any of its parents. Lines longer than 2048 bytes are returned as single lines of 2048 bytes, the longer line is not returned separately but is simply discarded. Once a boundary is found, setStreamPartAndContentEndPos is called with the passed $handle's read pos before the boundary and its line separator were read. |
private readBoundaryLine( $handle, ZBateson Reads up to 2048 bytes of input from the passed resource handle, discarding portions of a line that are longer than that, and returning the read portions of the line. The method also calls $proxy->setLastLineEndingLength which is used in findContentBoundary() to set the exact end byte of a part.
|