Changeset View
Changeset View
Standalone View
Standalone View
externals/mimemailparser/attachment.class.php
| Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | class MimeMailParser_attachment { | ||||
| * @param $bytes Int[optional] | * @param $bytes Int[optional] | ||||
| */ | */ | ||||
| public function read($bytes = 2082) { | public function read($bytes = 2082) { | ||||
| return feof($this->stream) ? false : fread($this->stream, $bytes); | return feof($this->stream) ? false : fread($this->stream, $bytes); | ||||
| } | } | ||||
| /** | /** | ||||
| * Retrieve the file content in one go | * Retrieve the file content in one go | ||||
| * Once you retreive the content you cannot use MimeMailParser_attachment::read() | * Once you retrieve the content you cannot use MimeMailParser_attachment::read() | ||||
| * @return String | * @return String | ||||
| */ | */ | ||||
| public function getContent() { | public function getContent() { | ||||
| if ($this->content === null) { | if ($this->content === null) { | ||||
| fseek($this->stream, 0); | fseek($this->stream, 0); | ||||
| while(($buf = $this->read()) !== false) { | while(($buf = $this->read()) !== false) { | ||||
| $this->content .= $buf; | $this->content .= $buf; | ||||
| } | } | ||||
| Show All 23 Lines | |||||