1 | <?php |
||
24 | class PartStreamRegistry |
||
25 | { |
||
26 | /** |
||
27 | * @var array Array of handles, with message IDs as keys. |
||
28 | */ |
||
29 | private $registeredHandles; |
||
30 | |||
31 | /** |
||
32 | * @var array Array of PartStream handles with message IDs as keys. |
||
33 | */ |
||
34 | private $registeredPartStreamHandles; |
||
35 | |||
36 | /** |
||
37 | * Registers an ID for the passed resource handle. |
||
38 | * |
||
39 | * @param string $id |
||
40 | * @param resource $handle |
||
41 | */ |
||
42 | public function register($id, $handle) |
||
48 | |||
49 | /** |
||
50 | * Unregisters the given message ID. |
||
51 | * |
||
52 | * @param string $id |
||
53 | */ |
||
54 | public function unregister($id) |
||
58 | |||
59 | /** |
||
60 | * Returns the resource handle with the passed $id. |
||
61 | * |
||
62 | * @param string $id |
||
63 | * @return resource |
||
64 | */ |
||
65 | public function get($id) |
||
72 | |||
73 | /** |
||
74 | * Attaches a stream filter on the passed resource $handle for the part's |
||
75 | * encoding. |
||
76 | * |
||
77 | * @param \ZBateson\MailMimeParser\MimePart $part |
||
78 | * @param resource $handle |
||
79 | */ |
||
80 | private function attachEncodingFilterToStream(MimePart $part, $handle) |
||
97 | |||
98 | /** |
||
99 | * Attaches a mailmimeparser-encode stream filter based on the part's |
||
100 | * defined charset. |
||
101 | * |
||
102 | * @param \ZBateson\MailMimeParser\MimePart $part |
||
103 | * @param resource $handle |
||
104 | */ |
||
105 | private function attachCharsetFilterToStream(MimePart $part, $handle) |
||
115 | |||
116 | /** |
||
117 | * Creates a part stream handle for the start and end position of the |
||
118 | * message stream, and attaches it to the passed MimePart. |
||
119 | * |
||
120 | * @param MimePart $part |
||
121 | * @param Message $message |
||
122 | * @param int $start |
||
123 | * @param int $end |
||
124 | */ |
||
125 | public function attachPartStreamHandle(MimePart $part, Message $message, $start, $end) |
||
139 | } |
||
140 |