[ Index ]

PHP Cross Reference of Eventum

title

Body

[close]

/include/ -> class.mime_helper.php (summary)

The MIME:: class provides methods for dealing with MIME standards. $Horde: horde/lib/MIME.php,v 1.121 2003/11/06 15:26:17 chuck Exp $

File Size: 758 lines (27 kb)
Included or required: 7 times
Referenced: 0 times
Includes or requires: 1 file
 include/class.error_handler.php

Defines 1 class

Mime_Helper:: (26 methods):
  getCharacterSet()
  getMessageBody()
  fixEncoding()
  quoteSender()
  removeQuotes()
  encodeAddress()
  decodeAddress()
  isQuotedPrintable()
  is8bit()
  encode()
  _encode()
  encodeValue()
  splitBodyHeader()
  getHeaderNames()
  getAttachmentName()
  hasAttachments()
  getAttachments()
  getAttachmentCIDs()
  _getAttachmentDetails()
  getAttachment()
  decode()
  parse_output()
  _quotedPrintableDecode()
  _getInvalidContentTypes()
  _getValidDispositions()
  splitHeaderBody()


Class: Mime_Helper  - X-Ref

Class to handle the business logic related to the MIME email
processing. The is8bit(), endode() and _encode() functions come from
the excellent Horde package at http://www.horde.org. These functions are
licensed under the LGPL, and Horde's copyright notice is available
above.

getCharacterSet($input)   X-Ref
Method used to get charset from raw email.

param: mixed   $input The full body of the message or decoded email.
return: string charset extracted from Content-Type header of email.

getMessageBody(&$output)   X-Ref
Returns the appropriate message body for a given MIME-based decoded
structure.

param: object $output The parsed message structure
return: string The message body

fixEncoding($input)   X-Ref
Method used to fix the encoding of MIME based strings.

param: string $input The string to be fixed
return: string The fixed string

quoteSender($address)   X-Ref
Method used to properly quote the sender of a given email address.

param: string $address The full email address
return: string The properly quoted email address

removeQuotes($address)   X-Ref
Method used to remove any unnecessary quoting from an email address.

param: string $address The full email address
return: string The email address without quotes

encodeAddress($address)   X-Ref
Method used to properly encode an email address.

param: string $address The full email address
return: string The properly encoded email address

decodeAddress($address)   X-Ref
Decodes a quoted printable encoded address and returns the string.

param: string $address The address to decode
return: string The decoded address

isQuotedPrintable($address)   X-Ref
Returns if a specified string contains a quoted printable address.

param: string $address The address
return: boolean If the address is quoted printable encoded.

is8bit($string)   X-Ref
Determine if a string contains 8-bit characters.

param: string $string  The string to check.
return: boolean  True if it does, false if it doesn't.

encode($text, $charset = APP_CHARSET)   X-Ref
Encode a string containing non-ASCII characters according to RFC 2047.

param: string $text     The text to encode.
param: string $charset  (optional) The character set of the text.
return: string  The text, encoded only if it contains non-ASCII

_encode($text, $charset)   X-Ref
Internal recursive function to RFC 2047 encode a string.

param: string $text     The text to encode.
param: string $charset  The character set of the text.
return: string  The text, encoded only if it contains non-ASCII

encodeValue($hdr_value, $charset = 'iso-8859-1')   X-Ref
Method used to encode a given string in the quoted-printable standard.

param: string $hdr_value The string to be encoded
param: string $charset The charset of the string
return: string The encoded string

splitBodyHeader($input)   X-Ref
Given a string containing a header and body
section, this function will split them (at the first
blank line) and return them.

param: string $input Input to split apart
return: array Contains header and body section

getHeaderNames($input)   X-Ref
Parse headers given in $input and return
as assoc array.

param: string $input Headers to parse
return: array Contains parsed headers

getAttachmentName(&$list, $filename)   X-Ref
Method used to get an unique attachment name for a given
filename. This is specially useful for the emails that Microsoft
Outlook sends out with several attachments with the same name
when you embed several inline screenshots in the message

param: array $list The nested array of mime parts
param: string $filename The filename to search for
return: string The unique attachment name

hasAttachments($message)   X-Ref
Method used to check whether a given email message has any attachments.

param: mixed   $message The full body of the message or parsed message structure.
return: boolean

getAttachments($message)   X-Ref
Method used to parse and return the full list of attachments
associated with a message.

param: mixed   $message The full body of the message or parsed message structure.
return: array The list of attachments, if any

getAttachmentCIDs($message)   X-Ref
Method used to parse and return the full list of attachment CIDs
associated with a message.

param: mixed   $message The full body of the message or parsed message structure.
return: array The list of attachment CIDs, if any

_getAttachmentDetails(&$mime_part, $return_body = FALSE, $return_filename = FALSE, $return_cid = FALSE)   X-Ref
No description

getAttachment($message, $filename, $cid = FALSE)   X-Ref
Method used to get the encoded content of a specific message
attachment.

param: mixed   $message The full content of the message or parsed message structure.
param: string $filename The filename to look for
param: string $cid The content-id to look for, if any
return: string The full encoded content of the attachment

decode($message, $include_bodies = FALSE, $decode_bodies = TRUE)   X-Ref
Method used to decode the content of a MIME encoded message.

param: string $message The full body of the message
param: boolean $include_bodies Whether to include the bodies in the return value or not
return: mixed The decoded content of the message

parse_output($obj, &$parts)   X-Ref
Method used to parse the decoded object structure of a MIME
message into something more manageable.

param: object $obj The decoded object structure of the MIME message
param: array $parts The parsed parts of the MIME message
return: void

_quotedPrintableDecode($input)   X-Ref
Given a quoted-printable string, this
function will decode and return it.

param: string Input body to decode
return: string Decoded body

_getInvalidContentTypes()   X-Ref
Returns the internal list of content types that we do not support as
valid attachment types.

return: array The list of content types

_getValidDispositions()   X-Ref
Returns the internal list of attachment dispositions that we do not
support as valid attachment types.

return: array The list of valid dispositions

splitHeaderBody($message, $unfold = true)   X-Ref
Splits the full email into headers and body

param: string $message The full email message
param: boolean $unfold If headers should be unfolded
return: array An array containing the headers and body



Generated: Wed Dec 19 21:21:33 2007 Cross-referenced by PHPXref 0.7