PartStreamRegistry
Factory class for PartStream objects and registration class for Message handles.
PartStreamRegistry is used for \ZBateson\MailMimeParser\Message\MessageParser to register Message stream handles for opening with PartStreams, and to open file handles for specific mime parts of a message. The PartStreamRegistry maintains a list of opened resources, closing them either when unregistering a Message or on destruction.
Tags
Table of Contents
- $numRefCountsForHandles : array<string|int, int>
- $registeredHandles : array<string|int, mixed>
- attachContentPartStreamHandle() : mixed
- Creates a part stream handle for the start and end position of the message stream, and attaches it to the passed MimePart.
- attachOriginalPartStreamHandle() : mixed
- Creates a part stream handle for the start and end position of the message stream, and attaches it to the passed MimePart.
- decreaseHandleRefCount() : mixed
- Decreases the reference count for streams using the resource handle associated with the message id. Once the reference count hits 0, unregister is called.
- get() : resource
- Returns the resource handle with the passed $id.
- increaseHandleRefCount() : mixed
- Increases the reference count for streams using the resource handle associated with the message id.
- register() : mixed
- Registers an ID for the passed resource handle.
- unregister() : mixed
- Unregisters the given message ID and closes the associated resource handle.
- attachCharsetFilterToStream() : mixed
- Attaches a mailmimeparser-encode stream filter based on the part's defined charset.
- attachEncodingFilterToStream() : mixed
- Attaches a stream filter on the passed resource $handle for the part's encoding.
Properties
$numRefCountsForHandles
private
array<string|int, int>
$numRefCountsForHandles
$registeredHandles
private
array<string|int, mixed>
$registeredHandles
Methods
attachContentPartStreamHandle()
Creates a part stream handle for the start and end position of the message stream, and attaches it to the passed MimePart.
public
attachContentPartStreamHandle(MimePart $part, Message $message, int $start, int $end) : mixed
Parameters
Return values
mixed —attachOriginalPartStreamHandle()
Creates a part stream handle for the start and end position of the message stream, and attaches it to the passed MimePart.
public
attachOriginalPartStreamHandle(MimePart $part, Message $message, int $start, int $end) : mixed
Parameters
Return values
mixed —decreaseHandleRefCount()
Decreases the reference count for streams using the resource handle associated with the message id. Once the reference count hits 0, unregister is called.
public
decreaseHandleRefCount(int $messageId) : mixed
Parameters
- $messageId : int
Return values
mixed —get()
Returns the resource handle with the passed $id.
public
get(string $id) : resource
Parameters
- $id : string
Return values
resource —increaseHandleRefCount()
Increases the reference count for streams using the resource handle associated with the message id.
public
increaseHandleRefCount(int $messageId) : mixed
Parameters
- $messageId : int
Return values
mixed —register()
Registers an ID for the passed resource handle.
public
register(string $id, resource $handle) : mixed
Parameters
- $id : string
- $handle : resource
Return values
mixed —unregister()
Unregisters the given message ID and closes the associated resource handle.
protected
unregister(string $id) : mixed
Parameters
- $id : string
Return values
mixed —attachCharsetFilterToStream()
Attaches a mailmimeparser-encode stream filter based on the part's defined charset.
private
attachCharsetFilterToStream(MimePart $part, resource $handle) : mixed
Parameters
- $part : MimePart
- $handle : resource
Return values
mixed —attachEncodingFilterToStream()
Attaches a stream filter on the passed resource $handle for the part's encoding.
private
attachEncodingFilterToStream(MimePart $part, resource $handle) : mixed
Parameters
- $part : MimePart
- $handle : resource