Definition at line 35 of file Part.php.
◆ __construct()
create a new Mime Part. The (unencoded) content of the Part as passed as a string or stream
- Parameters
-
mixed | $content | String or Stream containing the content |
Definition at line 127 of file Part.php.
131 $this->_isStream =
true;
◆ getContent()
Get the Content of the current Mime Part in the given encoding.
- Parameters
-
- Exceptions
-
- Returns
- string
Definition at line 221 of file Part.php.
223 if ($this->_isStream) {
static encode($str, $encoding, $EOL=self::LINEEND)
◆ getEncodedStream()
if this was created with a stream, return a filtered stream for reading the content. very useful for large file attachments.
- Returns
- mixed Stream
- Exceptions
-
Definition at line 161 of file Part.php.
163 if (!$this->_isStream) {
164 #require_once 'Zend/Mime/Exception.php'; 166 'Attempt to get a stream from a string part' 171 switch ($this->encoding) {
173 $filter = stream_filter_append(
175 'convert.quoted-printable-encode',
183 #require_once 'Zend/Mime/Exception.php'; 185 'Failed to append quoted-printable filter' 191 $filter = stream_filter_append(
193 'convert.base64-encode',
201 #require_once 'Zend/Mime/Exception.php'; 203 'Failed to append base64 filter'
const ENCODING_QUOTEDPRINTABLE
◆ getHeaders()
Return the headers for this part as a string
- Parameters
-
- Returns
- string
Definition at line 324 of file Part.php.
328 $res .= $header[0] .
': ' . $header[1] . $EOL;
getHeadersArray($EOL=Zend_Mime::LINEEND)
◆ getHeadersArray()
Create and return the array of headers for this MIME part
- Parameters
-
- Returns
- array
Definition at line 250 of file Part.php.
255 if ($this->charset) {
259 if ($this->boundary) {
260 $contentType .=
';' . $EOL
261 .
" boundary=\"" . $this->boundary .
'"';
269 if ($this->encoding) {
271 'Content-Transfer-Encoding',
279 '<' . $this->
id .
'>' 283 if ($this->disposition) {
285 if ($this->filename) {
289 'Content-Disposition',
294 if ($this->description) {
296 'Content-Description',
301 if ($this->location) {
308 if ($this->language) {
◆ getRawContent()
Get the RAW unencoded content from this part
- Returns
- string
Definition at line 235 of file Part.php.
237 if ($this->_isStream) {
238 return stream_get_contents($this->_content);
◆ isStream()
- Todo:
setters/getters
error checking for setting $type
error checking for setting $encoding
check if this part can be read as a stream. if true, getEncodedStream can be called, otherwise only getContent can be used to fetch the encoded content of the part
- Returns
- bool
Definition at line 149 of file Part.php.
◆ $_content
◆ $_isStream
◆ $boundary
◆ $charset
◆ $description
◆ $disposition
◆ $encoding
◆ $filename
◆ $id
◆ $language
◆ $location
◆ $type
The documentation for this class was generated from the following file:
- vendor/magento/zendframework1/library/Zend/Mime/Part.php