Copied!

A bi-directional parser-to-part proxy for IMessage objects created by MimeParser.

CloneableInstantiable
Methods
public ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy::__construct(ZBateson\MailMimeParser\Parser\PartBuilder $partBuilder, ZBateson\MailMimeParser\Parser\IParserService $parser)
public ZBateson\MailMimeParser\Parser\PartBuilder::__destruct()
public ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy::addError(string $message, string $level) : ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy
public ZBateson\MailMimeParser\Parser\Proxy\ParserMimePartProxy::getAddedChildAt(int $index) : ?ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy
 

Returns the added child at the provided index, useful for looking at previously parsed children.

public ZBateson\MailMimeParser\Parser\Proxy\ParserMimePartProxy::getContentType() : ?ZBateson\MailMimeParser\Header\ParameterHeader
 

Returns a ParameterHeader representing the parsed Content-Type header for this part.

public ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy::getHeaderContainer() : ZBateson\MailMimeParser\Message\PartHeaderContainer
public ZBateson\MailMimeParser\Parser\Proxy\ParserMimePartProxy::getLastAddedChild() : ?ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy
 

Returns the last part that was added.

public getLastLineEndingLength() : int
public ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy::getMessageResourceHandle() : ?mixed
 
  • return resource
public ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy::getMessageResourceHandlePos() : int
public ZBateson\MailMimeParser\Parser\Proxy\ParserMimePartProxy::getMimeBoundary() : ?string
 

Returns the parsed boundary parameter of the Content-Type header if set for a multipart message part.

public ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy::getParent() : ?ZBateson\MailMimeParser\Parser\Proxy\ParserMimePartProxy
public ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy::getPart() : ZBateson\MailMimeParser\Message\IMessagePart
 

Returns the IMessagePart associated with this proxy.

  • return \IMessagePart the part.
public ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy::getStream() : Psr\Http\Message\StreamInterface
public ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy::getStreamContentLength() : int
public ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy::getStreamContentStartPos() : ?int
public ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy::getStreamPartLength() : int
public ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy::getStreamPartStartPos() : int
public ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy::isContentParsed() : bool
public ZBateson\MailMimeParser\Parser\Proxy\ParserMimePartProxy::isEndBoundaryFound() : bool
 

Returns true if an end boundary was found for this part.

public ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy::isMime() : bool
public ZBateson\MailMimeParser\Parser\Proxy\ParserMimePartProxy::isParentBoundaryFound() : bool
 

Returns true if the parser passed an input line to setEndBoundary that matches a parent's mime boundary, and the following input belongs to a new part under its parent.

public ZBateson\MailMimeParser\Parser\Proxy\ParserMimePartProxy::parseAll() : static
 

Parses all content and children for this part.

public ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy::parseContent() : static
 

Requests the parser to parse this part's content, and call setStreamContentStartPos/EndPos to setup this part's boundaries within the main message's raw stream.

The method first checks to see if the content has already been parsed, and is safe to call multiple times.

public ZBateson\MailMimeParser\Parser\Proxy\ParserMimePartProxy::popNextChild() : ?ZBateson\MailMimeParser\Message\IMessagePart
 

Returns the next child part if one exists, popping it from the internal 'stack' of children, attempting to parse a new one if the stack is empty, and returning null if there are no more children.

  • return ?\IMessagePart the child part.
public ZBateson\MailMimeParser\Parser\Proxy\ParserMimePartProxy::setEndBoundaryFound(string $line) : bool
 

Returns true if the passed $line of read input matches this part's mime boundary, or any of its parent's mime boundaries for a multipart message.

If the passed $line is the ending boundary for the current part, $this->isEndBoundaryFound will return true after.

public ZBateson\MailMimeParser\Parser\Proxy\ParserMimePartProxy::setEof() : static
 

Called once EOF is reached while reading content. The method sets the flag used by isParentBoundaryFound() to true on this part and all parent parts.

public setLastLineEndingLength(int $lastLineEndingLength) : static
public ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy::setPart(ZBateson\MailMimeParser\Message\IMessagePart $part) : static
 

Sets the associated part.

  • param \IMessagePart $part The part
public ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy::setStreamContentStartPos(int $streamContentStartPos) : static
public ZBateson\MailMimeParser\Parser\Proxy\ParserMimePartProxy::setStreamPartAndContentEndPos(int $streamContentEndPos) : static
 

Overridden to set a 0-length content length, and a stream end pos of -2 if the passed end pos is before the start pos (can happen if a mime end boundary doesn't have an empty line before the next parent start boundary).

public ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy::setStreamPartEndPos(int $streamPartEndPos) : static
public ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy::setStreamPartStartPos(int $streamPartStartPos) : static
Properties
protected bool ZBateson\MailMimeParser\Parser\Proxy\ParserMimePartProxy::$allChildrenParsed = false
 
  • var bool true once all children of this part have been parsed.
protected array ZBateson\MailMimeParser\Parser\Proxy\ParserMimePartProxy::$children = []
 
  • var \ParserPartProxy[] Array of all parsed children.
protected array ZBateson\MailMimeParser\Parser\Proxy\ParserMimePartProxy::$childrenStack = []
 
  • var \ParserPartProxy[] Parsed children used as a 'first-in-first-out' stack as children are parsed.
protected bool ZBateson\MailMimeParser\Parser\Proxy\ParserMimePartProxy::$endBoundaryFound = false
 
  • var bool set to true once the end boundary of the currently-parsed part is found.
protected ?ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy ZBateson\MailMimeParser\Parser\Proxy\ParserMimePartProxy::$lastAddedChild = NULL
 
  • var \ParserPartProxy Reference to the last child added to this part.
protected int $lastLineEndingLength = 0
 
  • var int maintains the character length of the last line separator, typically 2 for CRLF, to keep track of the correct 'end' position for a part because the CRLF before a boundary is considered part of the boundary.
protected bool ZBateson\MailMimeParser\Parser\Proxy\ParserMimePartProxy::$parentBoundaryFound = false
 
  • var bool set to true once a boundary belonging to this parent's part is found.
protected ZBateson\MailMimeParser\Parser\IParserService ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy::$parser
 
  • var \IParserService The parser.
protected ZBateson\MailMimeParser\Parser\PartBuilder ZBateson\MailMimeParser\Parser\Proxy\ParserPartProxy::$partBuilder
 
  • var \PartBuilder The part's PartBuilder.
Methods
protected ZBateson\MailMimeParser\Parser\Proxy\ParserMimePartProxy::ensureLastChildParsed() : static
 

Ensures that the last child added to this part is fully parsed (content and children).

protected ZBateson\MailMimeParser\Parser\Proxy\ParserMimePartProxy::parseNextChild() : static
 

Parses the next child of this part and adds it to the 'stack' of children.

© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration