cvs: pear /Mail_Mime mimePart.php
| From: | Richard Heyes | Date: | Mon, 07 Jan 2002 15:38:10 +0000 |
| Subject: | cvs: pear /Mail_Mime mimePart.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-1867@lists.php.net to get a copy of this message | ||
heyesr Mon Jan 7 10:38:10 2002 EDT
Modified files:
/pear/Mail_Mime mimePart.php
Log:
* Now handles no constructor arguments
* Now handles 8bit encoding
* Minor maintenance
Index: pear/Mail_Mime/mimePart.php
diff -u pear/Mail_Mime/mimePart.php:1.5 pear/Mail_Mime/mimePart.php:1.6
--- pear/Mail_Mime/mimePart.php:1.5 Tue Dec 11 10:31:32 2001
+++ pear/Mail_Mime/mimePart.php Mon Jan 7 10:38:10 2002
@@ -73,7 +73,7 @@
* re-build the message.
*
* @author Richard Heyes <richard@phpguru.org>
-* @version $Revision: 1.5 $
+* @version $Revision: 1.6 $
* @package Mail
*/
@@ -117,14 +117,15 @@
* @param $body - The body of the mime part if any.
* @param $params - An associative array of parameters:
* content_type - The content type for this part eg multipart/mixed
- * encoding - The encoding to use, 7bit, base64, or quoted-printable
+ * encoding - The encoding to use, 7bit, 8bit, base64, or quoted-printable
* cid - Content ID to apply
* disposition - Content disposition, inline or attachment
* dfilename - Optional filename parameter for content disposition
* description - Content description
+ * charset - Character set to use
* @access public
*/
- function Mail_mimePart($body, $params = array())
+ function Mail_mimePart($body = '', $params = array())
{
if (!defined('MAIL_MIMEPART_CRLF')) {
define('MAIL_MIMEPART_CRLF', "\r\n", TRUE);
@@ -176,10 +177,15 @@
$_headers['Content-Type'] = 'text/plain';
}
+ //Default encoding
+ if (!isset($this->_encoding)) {
+ $this->_encoding = '7bit';
+ }
+
// Assign stuff to member variables
- $this->_encoded = array();
- $this->_headers =& $headers;
- $this->_body = $body;
+ $this->_encoded = array();
+ $this->_headers = $_headers;
+ $this->_body = $body;
}
/**
@@ -260,6 +266,7 @@
function _getEncodedData($data, $encoding)
{
switch ($encoding) {
+ case '8bit':
case '7bit':
return $data;
break;
@@ -271,6 +278,9 @@
case 'base64':
return rtrim(chunk_split(base64_encode($data), 76, MAIL_MIMEPART_CRLF));
break;
+
+ default:
+ return $data;
}
}