Frank Brückner 11 лет назад
Родитель
Сommit
81f1234882
4 измененных файлов с 127 добавлено и 37 удалено
  1. 37 21
      library/Zend/Mime.php
  2. 6 6
      library/Zend/Mime/Decode.php
  3. 7 5
      library/Zend/Mime/Message.php
  4. 77 5
      library/Zend/Mime/Part.php

+ 37 - 21
library/Zend/Mime.php

@@ -45,10 +45,23 @@ class Zend_Mime
     const MULTIPART_MIXED = 'multipart/mixed';
     const MULTIPART_RELATED = 'multipart/related';
 
+    /**
+     * Boundary
+     *
+     * @var null|string
+     */
     protected $_boundary;
+
+    /**
+     * @var int
+     */
     protected static $makeUnique = 0;
 
-    // lookup-Tables for QuotedPrintable
+    /**
+     * Lookup-Tables for QuotedPrintable
+     *
+     * @var array
+     */
     public static $qpKeys = array(
         "\x00","\x01","\x02","\x03","\x04","\x05","\x06","\x07",
         "\x08","\x09","\x0A","\x0B","\x0C","\x0D","\x0E","\x0F",
@@ -73,6 +86,9 @@ class Zend_Mime
         "\xFF"
         );
 
+    /**
+     * @var array
+     */
     public static $qpReplaceValues = array(
         "=00","=01","=02","=03","=04","=05","=06","=07",
         "=08","=09","=0A","=0B","=0C","=0D","=0E","=0F",
@@ -97,6 +113,9 @@ class Zend_Mime
         "=FF"
         );
 
+    /**
+     * @var string
+     */
     public static $qpKeysString =
          "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF";
 
@@ -117,9 +136,9 @@ class Zend_Mime
     /**
      * Encode a given string with the QUOTED_PRINTABLE mechanism and wrap the lines.
      *
-     * @param string $str
-     * @param int $lineLength Defaults to {@link LINELENGTH}
-     * @param int $lineEnd Defaults to {@link LINEEND}
+     * @param  string $str
+     * @param  int    $lineLength Line length; defaults to {@link LINELENGTH}
+     * @param  string $lineEnd    Line end; defaults to {@link LINEEND}
      * @return string
      */
     public static function encodeQuotedPrintable($str,
@@ -177,10 +196,10 @@ class Zend_Mime
      * Mail headers depend on an extended quoted printable algorithm otherwise
      * a range of bugs can occur.
      *
-     * @param string $str
-     * @param string $charset
-     * @param int $lineLength Defaults to {@link LINELENGTH}
-     * @param int $lineEnd Defaults to {@link LINEEND}
+     * @param  string $str
+     * @param  string $charset
+     * @param  int    $lineLength Line length; defaults to {@link LINELENGTH}
+     * @param  string $lineEnd    Line end; defaults to {@link LINEEND}
      * @return string
      */
     public static function encodeQuotedPrintableHeader($str, $charset,
@@ -250,10 +269,10 @@ class Zend_Mime
     /**
      * Encode a given string in mail header compatible base64 encoding.
      *
-     * @param string $str
-     * @param string $charset
-     * @param int $lineLength Defaults to {@link LINELENGTH}
-     * @param int $lineEnd Defaults to {@link LINEEND}
+     * @param  string $str
+     * @param  string $charset
+     * @param  int    $lineLength Line length; defaults to {@link LINELENGTH}
+     * @param  string $lineEnd    Line end; defaults to {@link LINEEND}
      * @return string
      */
     public static function encodeBase64Header($str,
@@ -275,9 +294,9 @@ class Zend_Mime
      * Encode a given string in base64 encoding and break lines
      * according to the maximum linelength.
      *
-     * @param string $str
-     * @param int $lineLength Defaults to {@link LINELENGTH}
-     * @param int $lineEnd Defaults to {@link LINEEND}
+     * @param  string $str
+     * @param  int    $lineLength Line length; defaults to {@link LINELENGTH}
+     * @param  string $lineEnd    Line end; defaults to {@link LINEEND}
      * @return string
      */
     public static function encodeBase64($str,
@@ -291,8 +310,6 @@ class Zend_Mime
      * Constructor
      *
      * @param null|string $boundary
-     * @access public
-     * @return void
      */
     public function __construct($boundary = null)
     {
@@ -309,7 +326,7 @@ class Zend_Mime
      *
      * @param string $str
      * @param string $encoding
-     * @param string $EOL EOL string; defaults to {@link Zend_Mime::LINEEND}
+     * @param string $EOL Line end; defaults to {@link Zend_Mime::LINEEND}
      * @return string
      */
     public static function encode($str, $encoding, $EOL = self::LINEEND)
@@ -343,8 +360,7 @@ class Zend_Mime
     /**
      * Return a MIME boundary line
      *
-     * @param mixed $EOL Defaults to {@link LINEEND}
-     * @access public
+     * @param  string $EOL Line end; defaults to {@link LINEEND}
      * @return string
      */
     public function boundaryLine($EOL = self::LINEEND)
@@ -355,7 +371,7 @@ class Zend_Mime
     /**
      * Return MIME ending
      *
-     * @access public
+     * @param  string $EOL Line end; defaults to {@link LINEEND}
      * @return string
      */
     public function mimeEnd($EOL = self::LINEEND)

+ 6 - 6
library/Zend/Mime/Decode.php

@@ -181,11 +181,11 @@ class Zend_Mime_Decode
     /**
      * split a header field like content type in its different parts
      *
-     * @param  string $type       header field
-     * @param  string $wantedPart the wanted part, else an array with all parts is returned
-     * @param  string $firstName  key name for the first part
-     * @return string|array wanted part or all parts as array($firstName => firstPart, partname => value)
+     * @param  string     $field
+     * @param  string     $wantedPart the wanted part, else an array with all parts is returned
+     * @param  int|string $firstName  key name for the first part
      * @throws Zend_Exception
+     * @return string|array wanted part or all parts as array($firstName => firstPart, partname => value)
      */
     public static function splitHeaderField($field, $wantedPart = null, $firstName = 0)
     {
@@ -234,8 +234,8 @@ class Zend_Mime_Decode
      *
      * The charset of the returned string depends on your iconv settings.
      *
-     * @param  string encoded string
-     * @return string decoded string
+     * @param  string $string Encoded string
+     * @return string         Decoded string
      */
     public static function decodeQuotedPrintable($string)
     {

+ 7 - 5
library/Zend/Mime/Message.php

@@ -195,8 +195,9 @@ class Zend_Mime_Message
      *
      * Parts consist of the header and the body of each MIME part.
      *
-     * @param string $body
-     * @param string $boundary
+     * @param  string $body
+     * @param  string $boundary
+     * @throws Zend_Exception
      * @return array
      */
     protected static function _disassembleMime($body, $boundary)
@@ -235,9 +236,10 @@ class Zend_Mime_Message
      * Decodes a MIME encoded string and returns a Zend_Mime_Message object with
      * all the MIME parts set according to the given string
      *
-     * @param string $message
-     * @param string $boundary
-     * @param string $EOL EOL string; defaults to {@link Zend_Mime::LINEEND}
+     * @param  string $message
+     * @param  string $boundary
+     * @param  string $EOL EOL string; defaults to {@link Zend_Mime::LINEEND}
+     * @throws Zend_Exception
      * @return Zend_Mime_Message
      */
     public static function createFromMessage($message, $boundary, $EOL = Zend_Mime::LINEEND)

+ 77 - 5
library/Zend/Mime/Part.php

@@ -34,19 +34,87 @@ require_once 'Zend/Mime.php';
  */
 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;
-    protected $_isStream = false;
 
+    /**
+     * @var bool
+     */
+    protected $_isStream = false;
 
     /**
      * create a new Mime Part.
@@ -86,7 +154,7 @@ class Zend_Mime_Part {
      * 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()
@@ -136,7 +204,9 @@ class Zend_Mime_Part {
     /**
      * 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)
     {
@@ -149,6 +219,7 @@ class Zend_Mime_Part {
     
     /**
      * Get the RAW unencoded content from this part
+     *
      * @return string
      */
     public function getRawContent()
@@ -163,7 +234,7 @@ class Zend_Mime_Part {
     /**
      * 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)
@@ -216,7 +287,8 @@ class Zend_Mime_Part {
     /**
      * 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)
     {