diff -r 5a6b6e770365 -r 68c69c656a2c web/lib/Zend/Mime/Part.php --- a/web/lib/Zend/Mime/Part.php Thu May 07 15:10:09 2015 +0200 +++ b/web/lib/Zend/Mime/Part.php Thu May 07 15:16:02 2015 +0200 @@ -14,9 +14,9 @@ * * @category Zend * @package Zend_Mime - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Part.php 24593 2012-01-05 20:35:02Z matthew $ + * @version $Id$ */ /** @@ -29,31 +29,100 @@ * * @category Zend * @package Zend_Mime - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Mime_Part { +class Zend_Mime_Part +{ + /** + * Type + * + * @var string + */ public $type = Zend_Mime::TYPE_OCTETSTREAM; + + /** + * Encoding + * + * @var string + */ public $encoding = Zend_Mime::ENCODING_8BIT; + + /** + * ID + * + * @var string + */ public $id; + + /** + * Disposition + * + * @var string + */ public $disposition; + + /** + * Filename + * + * @var string + */ public $filename; + + /** + * Description + * + * @var string + */ public $description; + + /** + * Character set + * + * @var string + */ public $charset; + + /** + * Boundary + * + * @var string + */ public $boundary; + + /** + * Location + * + * @var string + */ public $location; + + /** + * Language + * + * @var string + */ public $language; + + /** + * Content + * + * @var mixed + */ protected $_content; + + /** + * @var bool + */ protected $_isStream = false; - /** * create a new Mime Part. * The (unencoded) content of the Part as passed * as a string or stream * - * @param mixed $content String or Stream containing the content + * @param mixed $content String or Stream containing the content */ public function __construct($content) { @@ -79,21 +148,23 @@ */ public function isStream() { - return $this->_isStream; + return $this->_isStream; } /** * if this was created with a stream, return a filtered stream for * reading the content. very useful for large file attachments. * - * @return stream + * @return mixed Stream * @throws Zend_Mime_Exception if not a stream or unable to append filter */ public function getEncodedStream() { if (!$this->_isStream) { require_once 'Zend/Mime/Exception.php'; - throw new Zend_Mime_Exception('Attempt to get a stream from a string part'); + throw new Zend_Mime_Exception( + 'Attempt to get a stream from a string part' + ); } //stream_filter_remove(); // ??? is that right? @@ -110,9 +181,12 @@ ); if (!is_resource($filter)) { require_once 'Zend/Mime/Exception.php'; - throw new Zend_Mime_Exception('Failed to append quoted-printable filter'); + throw new Zend_Mime_Exception( + 'Failed to append quoted-printable filter' + ); } break; + case Zend_Mime::ENCODING_BASE64: $filter = stream_filter_append( $this->_content, @@ -125,18 +199,24 @@ ); if (!is_resource($filter)) { require_once 'Zend/Mime/Exception.php'; - throw new Zend_Mime_Exception('Failed to append base64 filter'); + throw new Zend_Mime_Exception( + 'Failed to append base64 filter' + ); } break; + default: } + return $this->_content; } /** * Get the Content of the current Mime Part in the given encoding. * - * @return String + * @param string $EOL Line end; defaults to {@link Zend_Mime::LINEEND} + * @throws Zend_Mime_Exception + * @return string */ public function getContent($EOL = Zend_Mime::LINEEND) { @@ -146,9 +226,10 @@ return Zend_Mime::encode($this->_content, $this->encoding, $EOL); } } - + /** * Get the RAW unencoded content from this part + * * @return string */ public function getRawContent() @@ -163,7 +244,7 @@ /** * Create and return the array of headers for this MIME part * - * @access public + * @param string $EOL Line end; defaults to {@link Zend_Mime::LINEEND} * @return array */ public function getHeadersArray($EOL = Zend_Mime::LINEEND) @@ -177,17 +258,26 @@ if ($this->boundary) { $contentType .= ';' . $EOL - . " boundary=\"" . $this->boundary . '"'; + . " boundary=\"" . $this->boundary . '"'; } - $headers[] = array('Content-Type', $contentType); + $headers[] = array( + 'Content-Type', + $contentType + ); if ($this->encoding) { - $headers[] = array('Content-Transfer-Encoding', $this->encoding); + $headers[] = array( + 'Content-Transfer-Encoding', + $this->encoding + ); } if ($this->id) { - $headers[] = array('Content-ID', '<' . $this->id . '>'); + $headers[] = array( + 'Content-ID', + '<' . $this->id . '>' + ); } if ($this->disposition) { @@ -195,19 +285,31 @@ if ($this->filename) { $disposition .= '; filename="' . $this->filename . '"'; } - $headers[] = array('Content-Disposition', $disposition); + $headers[] = array( + 'Content-Disposition', + $disposition + ); } if ($this->description) { - $headers[] = array('Content-Description', $this->description); + $headers[] = array( + 'Content-Description', + $this->description + ); } if ($this->location) { - $headers[] = array('Content-Location', $this->location); + $headers[] = array( + 'Content-Location', + $this->location + ); } - if ($this->language){ - $headers[] = array('Content-Language', $this->language); + if ($this->language) { + $headers[] = array( + 'Content-Language', + $this->language + ); } return $headers; @@ -216,7 +318,8 @@ /** * Return the headers for this part as a string * - * @return String + * @param string $EOL Line end; defaults to {@link Zend_Mime::LINEEND} + * @return string */ public function getHeaders($EOL = Zend_Mime::LINEEND) {