A part stream container that proxies requests for content streams to a parser to read the content.
Keeps reference to the original stream a part was parsed from, using that stream as the part's stream instead of the PartStreamContainer's MessagePartStream (which dynamically creates a stream from an IMessagePart) unless the part changed.
The ParserPartStreamContainer must also be attached to its underlying part with SplSubject::attach() so the ParserPartStreamContainer gets notified of any changes.
- author Zaahid Bateson
| Methods |
| public __construct(Psr\Log\LoggerInterface $logger, ZBateson |
| public __destruct() |
| public getBinaryContentStream(ZBateson |
| public getContentStream(ZBateson |
| public getStream() : Psr\Http\Message\StreamInterface |
| public hasContent() : bool |
| public setContentStream(?Psr\Http\Message\StreamInterface $contentStream = NULL) : static |
| public update(SplSubject $subject) : void |
| Properties |
protected bool $contentParseRequested = false
|
protected ?Psr\Http\Message\StreamInterface $parsedStream = NULL
|
| protected readonly ZBateson |
protected bool $partUpdated = false
|
| Methods |
| protected requestParsedContentStream() : static Requests content from the parser if not previously requested, and calls PartStreamContainer::setContentStream(). |
| protected requestParsedStream() : static Ensures the parser has parsed the entire part, and sets $this->parsedStream to the original parsed stream (or a limited part of it corresponding to the current part this stream container belongs to). |