Class rcube_mime

Description

Class for parsing MIME messages

Located in /lib/Roundcube/rcube_mime.php (line 29)


	
			
Method Summary
 static string decode (string $input, [string $encoding = '7bit'])
 static array decode_address_list (string $input, [int $max = null], [boolean $decode = true], [string $fallback = null], [boolean $addronly = false])
 static string decode_header (string $input, [string $fallback = null])
 static string decode_mime_string (string $input, [string $fallback = null])
 static array explode_header_string (string $separator, string $str, [bool $remove_comments = false])
 static string file_content_type (string $path, string $name, [string $failover = 'application/octet-stream'], [boolean $is_stream = false], [boolean $skip_suffix = false])
 static string format_flowed (string $text, [int $length = 72], [string $charset = null])
 static string get_charset ()
 static array get_mime_extensions ([string $mimetype = null])
 static string image_content_type (string $data)
 static void parse_headers ( $headers)
 static object rcube_message_part parse_message (string $raw_body)
 static string unfold_flowed (string $text)
 static string wordwrap (string $string, [int $width = 75], [string $break = "\n"], [bool $cut = false], [string $charset = null], [bool $wrap_quoted = true])
 rcube_mime __construct ([ $default_charset = null])
Methods
static decode (line 293)

Decode a mime part

  • return: Decoded string
  • access: public
string decode (string $input, [string $encoding = '7bit'])
  • string $input: Input string
  • string $encoding: Part encoding
static decode_address_list (line 134)

Split an address list into a structured array list

  • return: Indexed list of addresses
array decode_address_list (string $input, [int $max = null], [boolean $decode = true], [string $fallback = null], [boolean $addronly = false])
  • string $input: Input string
  • int $max: List only this number of addresses
  • boolean $decode: Decode address strings
  • string $fallback: Fallback charset if none specified
  • boolean $addronly: Return flat array with e-mail addresses only
static decode_header (line 181)

Decode a message header value

  • return: Decoded string
  • access: public
string decode_header (string $input, [string $fallback = null])
  • string $input: Header value
  • string $fallback: Fallback charset if none specified
static decode_mime_string (line 197)

Decode a mime-encoded string to internal charset

  • return: Decoded string
  • access: public
string decode_mime_string (string $input, [string $fallback = null])
  • string $input: Header value
  • string $fallback: Fallback charset if none specified
static explode_header_string (line 403)

Explodes header (e.g. address-list) string into array of strings using specified separator characters with proper handling of quoted-strings and comments (RFC2822)

  • return: Header items
  • access: public
array explode_header_string (string $separator, string $str, [bool $remove_comments = false])
  • string $separator: String containing separator characters
  • string $str: Header string
  • bool $remove_comments: Enable to remove comments
static file_content_type (line 704)

A method to guess the mime_type of an attachment.

string file_content_type (string $path, string $name, [string $failover = 'application/octet-stream'], [boolean $is_stream = false], [boolean $skip_suffix = false])
  • string $path: Path to the file or file contents
  • string $name: File name (with suffix)
  • string $failover: Mime type supplied for failover
  • boolean $is_stream: Set to True if $path contains file contents
  • boolean $skip_suffix: Set to True if the config/mimetypes.php mappig should be ignored
static format_flowed (line 541)

Wrap the given text to comply with RFC 2646

  • return: Wrapped text
  • access: public
string format_flowed (string $text, [int $length = 72], [string $charset = null])
  • string $text: Text to wrap
  • int $length: Length
  • string $charset: Character encoding of $text
static get_charset (line 48)

Returns message/object character set name

  • return: Characted set name
  • access: public
string get_charset ()
static get_mime_extensions (line 762)

Get mimetype => file extension mapping

  • return: List of extensions matching the given mimetype or a hash array with ext -> mimetype mappings if $mimetype is not given
  • access: public
array get_mime_extensions ([string $mimetype = null])
  • string $mimetype: Mime-Type to get extensions for
static image_content_type (line 858)

Detect image type of the given binary data by checking magic numbers.

  • return: Detected mime-type or jpeg as fallback
  • access: public
string image_content_type (string $data)
  • string $data: Binary file content
static parse_headers (line 316)

Split RFC822 header string into an associative array

  • access: public
void parse_headers ( $headers)
  • $headers
static parse_message (line 71)

Parse the given raw message source and return a structure of rcube_message_part objects.

It makes use of the PEAR:Mail_mimeDecode library

  • return: The message structure
  • access: public
object rcube_message_part parse_message (string $raw_body)
  • string $raw_body: The message source
static unfold_flowed (line 474)

Interpret a format=flowed message body according to RFC 2646

  • return: Interpreted text with unwrapped lines and stuffed space removed
  • access: public
string unfold_flowed (string $text)
  • string $text: Raw body formatted as flowed text
static wordwrap (line 583)

Improved wordwrap function with multibyte support.

The code is based on Zend_Text_MultiByte::wordWrap().

  • return: Text
  • access: public
string wordwrap (string $string, [int $width = 75], [string $break = "\n"], [bool $cut = false], [string $charset = null], [bool $wrap_quoted = true])
  • string $string: Text to wrap
  • int $width: Line width
  • string $break: Line separator
  • bool $cut: Enable to cut word
  • string $charset: Charset of $string
  • bool $wrap_quoted: When enabled quoted lines will not be wrapped
Constructor __construct (line 37)

Object constructor.

rcube_mime __construct ([ $default_charset = null])
  • $default_charset

Documentation generated on Fri, 03 May 2013 12:45:04 +0200 by phpDocumentor 1.4.4