1 | <?php |
||
16 | class UUEncodeStreamFilter extends php_user_filter |
||
17 | { |
||
18 | /** |
||
19 | * Name used when registering with stream_filter_register. |
||
20 | */ |
||
21 | const STREAM_FILTER_NAME = 'mailmimeparser-uudecode'; |
||
22 | |||
23 | /** |
||
24 | * @var string Leftovers from the last incomplete line that was parsed, to |
||
25 | * be prepended to the next line read. |
||
26 | */ |
||
27 | private $leftover = ''; |
||
28 | |||
29 | /** |
||
30 | * Returns an array of complete lines (including line endings) from the |
||
31 | * passed $bucket object. |
||
32 | * |
||
33 | * If the last line on $bucket is incomplete, it's assigned to |
||
34 | * $this->leftover and prepended to the first element of the first line in |
||
35 | * the next call to getLines. |
||
36 | * |
||
37 | * @param object $bucket |
||
38 | * @return string[] |
||
39 | */ |
||
40 | private function getLines($bucket) |
||
58 | |||
59 | /** |
||
60 | * Filter implementation converts encoding before returning PSFS_PASS_ON. |
||
61 | * |
||
62 | * @param resource $in |
||
63 | * @param resource $out |
||
64 | * @param int $consumed |
||
65 | * @param bool $closing |
||
66 | * @return int |
||
67 | */ |
||
68 | public function filter($in, $out, &$consumed, $closing) |
||
91 | } |
||
92 |