PHP Class Horde_Mime_Part, horde

Author: Chuck Hagenbuch ([email protected])
Author: Michael Slusarz ([email protected])
Inheritance: implements ArrayAccess, implements Countable, implements RecursiveIterator, implements Serializable
ファイルを表示 Open project: horde/horde Class Usage Examples

Public Properties

Property Type Description
$defaultCharset string The default charset to use when parsing text parts with no charset information.
$encodingTypes
$memoryLimit integer The memory limit for use with the PHP temp stream.
$mimeTypes
$parent Horde_Mime_Part Parent object. Value only accurate when iterating.

Protected Properties

Property Type Description
$_bytes integer Default value for this Part's size.
$_contents resource The body of the part. Always stored in binary format.
$_eol string The default is currently to output the EOL sequence internally as just "\n" instead of the canonical "\r\n" required in RFC 822 & 2045. To be RFC complaint, the full EOL combination should be used when sending a message.
$_failed boolean Flag to detect if a message failed to send at least once.
$_hdrCharset string The charset to output the headers in.
$_headers Horde_Mime_Headers The MIME headers for this part.
$_metadata array Metadata.
$_mimeid string The MIME ID of this part.
$_parts array The subparts of this part.
$_status integer Status mask for this part.
$_temp array Temporary array.
$_transferEncoding string The desired transfer encoding of this part.

Public Methods

Method Description
__clone ( ) Function to run on clone.
__construct ( ) Constructor.
addMimeHeaders ( array $options = [] ) : Horde_Mime_Headers Returns a Horde_Mime_Header object containing all MIME headers needed for the part.
addPart ( $mime_part )
alterPart ( $id, $mime_part )
appendContents ( mixed $contents, $options = [] ) Add to the body contents of this part.
buildMimeIds ( string $id = null, boolean $rfc822 = false ) Build the MIME IDs for this part and all subparts.
clearContentTypeParameter ( $label )
clearContents ( ) Clears the body contents of this part.
contentTypeMap ( $sort = true )
count ( ) : integer Returns the number of child message parts (doesn't include grandchildren or more remote ancestors).
current ( )
findBody ( string $subtype = null ) : mixed Finds the main "body" text part (if any) in a message.
getAllContentTypeParameters ( ) : array Get all parameters from the Content-Type header.
getAllDispositionParameters ( ) : array Get all parameters from the Content-Disposition header.
getBytes ( boolean $approx = false ) : integer Determine the size of this MIME part and its child members.
getCharset ( ) : string Get the character set to use for this part.
getChildren ( )
getContentId ( ) : string Returns the Content-ID for this part.
getContentTypeParameter ( string $label ) : string Get a content type parameter from this part.
getContents ( array $options = [] ) : mixed Return the body of the part.
getDefaultType ( ) : string If the subtype of a MIME part is unrecognized by an application, the default type should be used instead (See RFC 2046). This method returns the default subtype for a particular primary MIME type.
getDescription ( boolean $default = false ) : string Get the description of this part.
getDisposition ( ) : string Get the content-disposition of this part.
getDispositionParameter ( string $label ) : string Get a disposition parameter from this part.
getDuration ( ) : integer Get the content duration of the data contained in this part (see RFC 3803).
getEOL ( ) : string Get the string to use for EOLs.
getHeaderCharset ( ) : string Get the character set to use when outputting MIME headers.
getLanguage ( ) Get the language(s) of this part.
getMetadata ( string $key ) : mixed Retrieves metadata from this object.
getMimeId ( ) : string Returns the MIME ID of this part.
getName ( boolean $default = false ) : string Get the name of this part.
getPart ( $id )
getPartByIndex ( $index ) : Horde_Mime_Part Returns a subpart by index.
getParts ( ) : array Get a list of all MIME subparts.
getPrimaryType ( ) : string Get the primary type of this part.
getRawPartText ( mixed $text, string $type, string $id ) : string Attempts to obtain the raw text of a MIME part.
getSize ( boolean $approx = false ) : string Output the size of this MIME part in KB.
getSubType ( ) : string Get the subtype of this part.
getType ( boolean $charset = false ) : string Get the full MIME Content-Type of this part.
hasChildren ( )
isAttachment ( ) : boolean Determines if this MIME part is an attachment for display purposes.
isBasePart ( boolean $base ) Is this the base MIME part?
key ( )
next ( )
offsetExists ( $offset )
offsetGet ( $offset )
offsetSet ( $offset, $value )
offsetUnset ( $offset )
parseMessage ( string $text, array $opts = [] ) : Horde_Mime_Part Attempts to build a Horde_Mime_Part object from message text.
partIterator ( boolean $current = true ) : Iterator Returns the recursive iterator needed to iterate through this part.
removePart ( $id )
replaceEOL ( mixed $text, string $eol = null, boolean $stream = false ) : string Replace newlines in this part's contents with those specified by either the given newline sequence or the part's current EOL setting.
rewind ( )
send ( string $email, Horde_Mime_Headers $headers, Horde_Mail_Transport $mailer, array $opts = [] ) Sends this message.
serialize ( ) : string Serialization.
setBytes ( integer $bytes ) Explicitly set the size (in bytes) of this part. This value will only be returned (via getBytes()) if there are no contents currently set.
setCharset ( string $charset ) Set the character set of this part.
setContentId ( string $cid = null ) : string Sets the Content-ID header for this part.
setContentTypeParameter ( string $label, string $data ) Add/remove a content type parameter to this part.
setContents ( mixed $contents, array $options = [] ) Set the body contents of this part.
setDescription ( string $description ) Set the description of this part.
setDisposition ( string $disposition = null ) Set the content-disposition of this part.
setDispositionParameter ( string $label, string $data ) Add a disposition parameter to this part.
setDuration ( integer $duration ) Set the content duration of the data contained in this part (see RFC 3803).
setEOL ( string $eol ) Sets a new string to use for EOLs.
setHeaderCharset ( string $charset ) Set the character set to use when outputting MIME headers.
setLanguage ( mixed $lang ) Set the language(s) of this part.
setMetadata ( string $key, mixed $data = null ) Set a piece of metadata on this object.
setMimeId ( string $mimeid ) Alter the MIME ID of this part.
setName ( string $name ) Set the name of this part.
setTransferEncoding ( string $encoding, array $options = [] ) Set the transfer encoding to use for this part.
setType ( string $type ) Set the MIME type of this part.
toString ( array $options = [] ) : mixed Return the entire part in MIME format.
unserialize ( string $data ) Unserialization.
valid ( )

Protected Methods

Method Description
_findBoundary ( string $text, integer $pos, string $boundary, integer $end = null ) : array Find the location of the next boundary string.
_findHeader ( string $text, string $eol ) : integer Find the location of the end of the header text.
_getStructure ( string $header, string $body, array $opts = [] ) : Horde_Mime_Part Creates a MIME object from the text of one part of a MIME message.
_getTransferEncoding ( integer $encode = self::ENCODE_7BIT ) : string Get the transfer encoding for the part based on the user requested transfer encoding and the current contents of the part.
_reEncodeMessageAttachment ( Horde_Mime_Part $part ) Rebuilds $part and forces it to be a base64 encoded application/octet-stream part.
_readStream ( resource $fp, boolean $close = false ) : string Read data from a stream.
_reindex ( boolean $force = false ) Reindexes the MIME IDs, if necessary.
_sanityCheckRfc822Attachments ( ) Re-enocdes message/rfc822 parts in case there was e.g., some broken line length in the headers of the message in the part. Since we shouldn't alter the original message in any way, we simply reset cause the part to be encoded as base64 and sent as a application/octet part.
_scanStream ( resource $fp ) Scans a stream for content type.
_transferDecode ( resource $fp, string $encoding ) : resource Decodes the contents of the part to binary encoding.
_transferEncode ( resource $fp, string $encoding ) : resource Encodes the contents of the part as necessary for transport.
_writeStream ( array $data, array $options = [] ) : resource Write data to a stream.

Method Details

__clone() public method

Function to run on clone.
public __clone ( )

__construct() public method

Constructor.
public __construct ( )

_findBoundary() protected static method

Find the location of the next boundary string.
protected static _findBoundary ( string $text, integer $pos, string $boundary, integer $end = null ) : array
$text string The text to search.
$pos integer The current position in $text.
$boundary string The boundary string.
$end integer If set, return after matching this many boundaries.
return array Keys are the boundary number, values are an array with two elements: 'start' and 'length'.

_findHeader() protected static method

Find the location of the end of the header text.
protected static _findHeader ( string $text, string $eol ) : integer
$text string The text to search.
$eol string The EOL string.
return integer Header position.

_getStructure() protected static method

Creates a MIME object from the text of one part of a MIME message.
protected static _getStructure ( string $header, string $body, array $opts = [] ) : Horde_Mime_Part
$header string The header text.
$body string The body text.
$opts array Additional options:
  - ctype: (string) The default content-type.
  - forcemime: (boolean) If true, the message data is assumed to be
               MIME data. If not, a MIME-Version header must exist to
               be parsed as a MIME message.
  - level: (integer) Current nesting level.
  - no_body: (boolean) If true, don't set body contents of parts.
return Horde_Mime_Part The MIME part object.

_getTransferEncoding() protected method

Get the transfer encoding for the part based on the user requested transfer encoding and the current contents of the part.
protected _getTransferEncoding ( integer $encode = self::ENCODE_7BIT ) : string
$encode integer A mask of allowable encodings.
return string The transfer-encoding of this part.

_reEncodeMessageAttachment() protected method

Rebuilds $part and forces it to be a base64 encoded application/octet-stream part.
protected _reEncodeMessageAttachment ( Horde_Mime_Part $part )
$part Horde_Mime_Part The MIME part.

_readStream() protected method

Read data from a stream.
protected _readStream ( resource $fp, boolean $close = false ) : string
$fp resource An active stream.
$close boolean Close the stream when done reading?
return string The data from the stream.

_reindex() protected method

Reindexes the MIME IDs, if necessary.
protected _reindex ( boolean $force = false )
$force boolean Reindex if the current part doesn't have an ID.

_sanityCheckRfc822Attachments() protected method

Re-enocdes message/rfc822 parts in case there was e.g., some broken line length in the headers of the message in the part. Since we shouldn't alter the original message in any way, we simply reset cause the part to be encoded as base64 and sent as a application/octet part.

_scanStream() protected method

Scans a stream for content type.
protected _scanStream ( resource $fp )
$fp resource A stream resource.

_transferDecode() protected method

Decodes the contents of the part to binary encoding.
protected _transferDecode ( resource $fp, string $encoding ) : resource
$fp resource A stream containing the data to decode.
$encoding string The original file encoding.
return resource A new file resource with the decoded data.

_transferEncode() protected method

Encodes the contents of the part as necessary for transport.
protected _transferEncode ( resource $fp, string $encoding ) : resource
$fp resource A stream containing the data to encode.
$encoding string The encoding to use.
return resource A new file resource with the encoded data.

_writeStream() protected method

Write data to a stream.
protected _writeStream ( array $data, array $options = [] ) : resource
$data array The data to write. Either a stream resource or a string.
$options array Additional options: - error: (boolean) Catch errors when writing to the stream. Throw an ErrorException if an error is found. DEFAULT: false - filter: (array) Filter(s) to apply to the string. Keys are the filter names, values are filter params. - fp: (resource) Use this stream instead of creating a new one.
return resource The stream resource.

addMimeHeaders() public method

Returns a Horde_Mime_Header object containing all MIME headers needed for the part.
public addMimeHeaders ( array $options = [] ) : Horde_Mime_Headers
$options array Additional options: - encode: (integer) A mask of allowable encodings. DEFAULT: Auto-determined - headers: (Horde_Mime_Headers) The object to add the MIME headers to. DEFAULT: Add headers to a new object
return Horde_Mime_Headers A Horde_Mime_Headers object.

addPart() public method

Deprecation: Use array access instead.
public addPart ( $mime_part )

alterPart() public method

Deprecation: Use array access instead.
public alterPart ( $id, $mime_part )

appendContents() public method

Add to the body contents of this part.
public appendContents ( mixed $contents, $options = [] )
$contents mixed The part body. Either a string or a stream resource, or an array containing both. - encoding: (string) The encoding of $contents. DEFAULT: Current transfer encoding value. - usestream: (boolean) If $contents is a stream, should we directly use that stream? DEFAULT: $contents copied to a new stream.

buildMimeIds() public method

Build the MIME IDs for this part and all subparts.
public buildMimeIds ( string $id = null, boolean $rfc822 = false )
$id string The ID of this part.
$rfc822 boolean Is this a message/rfc822 part?

clearContentTypeParameter() public method

Deprecation: Use setContentTypeParameter with a null $data value.
public clearContentTypeParameter ( $label )

clearContents() public method

Clears the body contents of this part.
public clearContents ( )

contentTypeMap() public method

Deprecation: Use iterator instead.
public contentTypeMap ( $sort = true )

count() public method

Returns the number of child message parts (doesn't include grandchildren or more remote ancestors).
public count ( ) : integer
return integer Number of message parts.

current() public method

Since: 2.8.0
public current ( )

findBody() public method

"Body" data is the first text part under this part.
public findBody ( string $subtype = null ) : mixed
$subtype string Specifically search for this subtype.
return mixed The MIME ID of the main body part, or null if a body part is not found.

getAllContentTypeParameters() public method

Get all parameters from the Content-Type header.
public getAllContentTypeParameters ( ) : array
return array An array of all the parameters Returns the empty array if no parameters set.

getAllDispositionParameters() public method

Get all parameters from the Content-Disposition header.
public getAllDispositionParameters ( ) : array
return array An array of all the parameters Returns the empty array if no parameters set.

getBytes() public method

Determine the size of this MIME part and its child members.
public getBytes ( boolean $approx = false ) : integer
$approx boolean If true, determines an approximate size for parts consisting of base64 encoded data.
return integer Size of the part, in bytes.

getCharset() public method

Get the character set to use for this part.
public getCharset ( ) : string
return string The character set of this part (lowercase). Returns null if there is no character set.

getChildren() public method

Since: 2.8.0
public getChildren ( )

getContentId() public method

Returns the Content-ID for this part.
public getContentId ( ) : string
return string The Content-ID for this part (null if not set).

getContentTypeParameter() public method

Get a content type parameter from this part.
public getContentTypeParameter ( string $label ) : string
$label string The content type parameter label.
return string The data requested. Returns null if $label is not set.

getContents() public method

Return the body of the part.
public getContents ( array $options = [] ) : mixed
$options array Additional options: - canonical: (boolean) Returns the contents in strict RFC 822 & 2045 output - namely, all newlines end with the canonical sequence. DEFAULT: No - stream: (boolean) Return the body as a stream resource. DEFAULT: No
return mixed The body text (string) of the part, null if there is no contents, and a stream resource if 'stream' is true.

getDefaultType() public method

If the subtype of a MIME part is unrecognized by an application, the default type should be used instead (See RFC 2046). This method returns the default subtype for a particular primary MIME type.
public getDefaultType ( ) : string
return string The default MIME type of this part (ex.: text/plain).

getDescription() public method

Get the description of this part.
public getDescription ( boolean $default = false ) : string
$default boolean If the description parameter doesn't exist, should we use the name of the part?
return string The description of this part.

getDisposition() public method

Get the content-disposition of this part.
public getDisposition ( ) : string
return string The part's content-disposition. An empty string means no desired disposition has been set for this part.

getDispositionParameter() public method

Get a disposition parameter from this part.
public getDispositionParameter ( string $label ) : string
$label string The disposition parameter label.
return string The data requested. Returns null if $label is not set.

getDuration() public method

Get the content duration of the data contained in this part (see RFC 3803).
public getDuration ( ) : integer
return integer The duration of the data, in seconds. Returns null if there is no duration information.

getEOL() public method

Get the string to use for EOLs.
public getEOL ( ) : string
return string The string to use for EOLs.

getHeaderCharset() public method

Get the character set to use when outputting MIME headers.
public getHeaderCharset ( ) : string
return string The character set. If no preferred character set has been set, returns null.

getLanguage() public method

Get the language(s) of this part.
public getLanguage ( )

getMetadata() public method

Retrieves metadata from this object.
public getMetadata ( string $key ) : mixed
$key string The metadata key.
return mixed The metadata, or null if it doesn't exist.

getMimeId() public method

Returns the MIME ID of this part.
public getMimeId ( ) : string
return string The MIME ID.

getName() public method

Get the name of this part.
public getName ( boolean $default = false ) : string
$default boolean If the name parameter doesn't exist, should we use the default name from the description parameter?
return string The name of the part.

getPart() public method

Deprecation: Use array access instead.
public getPart ( $id )

getPartByIndex() public method

Returns a subpart by index.
public getPartByIndex ( $index ) : Horde_Mime_Part
return Horde_Mime_Part Part, or null if not found.

getParts() public method

Get a list of all MIME subparts.
public getParts ( ) : array
return array An array of the Horde_Mime_Part subparts.

getPrimaryType() public method

Get the primary type of this part.
public getPrimaryType ( ) : string
return string The primary MIME type of this part.

getRawPartText() public static method

Attempts to obtain the raw text of a MIME part.
public static getRawPartText ( mixed $text, string $type, string $id ) : string
$text mixed The full text of the MIME message. The text is assumed to be MIME data (no MIME-Version checking is performed). It can be either a stream or a string.
$type string Either 'header' or 'body'.
$id string The MIME ID.
return string The raw text.

getSize() public method

Output the size of this MIME part in KB.
public getSize ( boolean $approx = false ) : string
$approx boolean If true, determines an approximate size for parts consisting of base64 encoded data.
return string Size of the part in KB.

getSubType() public method

Get the subtype of this part.
public getSubType ( ) : string
return string The MIME subtype of this part.

getType() public method

Get the full MIME Content-Type of this part.
public getType ( boolean $charset = false ) : string
$charset boolean Append character set information to the end of the content type if this is a text/* part? `
return string The MIME type of this part.

hasChildren() public method

Since: 2.8.0
public hasChildren ( )

isAttachment() public method

Determines if this MIME part is an attachment for display purposes.
public isAttachment ( ) : boolean
return boolean True if this part should be considered an attachment.

isBasePart() public method

Is this the base MIME part?
public isBasePart ( boolean $base )
$base boolean True if this is the base MIME part.

key() public method

Since: 2.8.0
public key ( )

next() public method

Since: 2.8.0
public next ( )

offsetExists() public method

public offsetExists ( $offset )

offsetGet() public method

public offsetGet ( $offset )

offsetSet() public method

public offsetSet ( $offset, $value )

offsetUnset() public method

public offsetUnset ( $offset )

parseMessage() public static method

Attempts to build a Horde_Mime_Part object from message text.
public static parseMessage ( string $text, array $opts = [] ) : Horde_Mime_Part
$text string The text of the MIME message.
$opts array Additional options: - forcemime: (boolean) If true, the message data is assumed to be MIME data. If not, a MIME-Version header must exist (RFC 2045 [4]) to be parsed as a MIME message. DEFAULT: false - level: (integer) Current nesting level of the MIME data. DEFAULT: 0 - no_body: (boolean) If true, don't set body contents of parts (since 2.2.0). DEFAULT: false
return Horde_Mime_Part A MIME Part object.

partIterator() public method

Returns the recursive iterator needed to iterate through this part.
Since: 2.8.0
public partIterator ( boolean $current = true ) : Iterator
$current boolean Include the current part as the base?
return Iterator Recursive iterator.

removePart() public method

Deprecation: Use array access instead.
public removePart ( $id )

replaceEOL() public method

Replace newlines in this part's contents with those specified by either the given newline sequence or the part's current EOL setting.
public replaceEOL ( mixed $text, string $eol = null, boolean $stream = false ) : string
$text mixed The text to replace. Either a string or a stream resource. If a stream, and returning a string, will close the stream when done.
$eol string The EOL sequence to use. If not present, uses the part's current EOL setting.
$stream boolean If true, returns a stream resource.
return string The text with the newlines replaced by the desired newline sequence (returned as a stream resource if $stream is true).

rewind() public method

Since: 2.8.0
public rewind ( )

send() public method

Sends this message.
public send ( string $email, Horde_Mime_Headers $headers, Horde_Mail_Transport $mailer, array $opts = [] )
$email string The address list to send to.
$headers Horde_Mime_Headers The Horde_Mime_Headers object holding this message's headers.
$mailer Horde_Mail_Transport A Horde_Mail_Transport object.
$opts array Additional options:
  - broken_rfc2231: (boolean) Attempt to work around non-RFC
                    2231-compliant MUAs by generating both a RFC
                    2047-like parameter name and also the correct RFC
                    2231 parameter (@since 2.5.0).
                    DEFAULT: false
  - encode: (integer) The encoding to use. A mask of self::ENCODE_*
            values.
            DEFAULT: Auto-determined based on transport driver.

serialize() public method

Serialization.
public serialize ( ) : string
return string Serialized data.

setBytes() public method

This function is useful for setting the size of the part when the contents of the part are not fully loaded (i.e. creating a Horde_Mime_Part object from IMAP header information without loading the data of the part).
public setBytes ( integer $bytes )
$bytes integer The size of this part in bytes.

setCharset() public method

Set the character set of this part.
public setCharset ( string $charset )
$charset string The character set of this part.

setContentId() public method

Sets the Content-ID header for this part.
public setContentId ( string $cid = null ) : string
$cid string Use this CID (if not already set). Else, generate a random CID.
return string The Content-ID for this part.

setContentTypeParameter() public method

Add/remove a content type parameter to this part.
public setContentTypeParameter ( string $label, string $data )
$label string The content-type parameter label.
$data string The content-type parameter data. If null, removes the parameter (@since 2.8.0).

setContents() public method

Set the body contents of this part.
public setContents ( mixed $contents, array $options = [] )
$contents mixed The part body. Either a string or a stream resource, or an array containing both.
$options array Additional options: - encoding: (string) The encoding of $contents. DEFAULT: Current transfer encoding value. - usestream: (boolean) If $contents is a stream, should we directly use that stream? DEFAULT: $contents copied to a new stream.

setDescription() public method

Set the description of this part.
public setDescription ( string $description )
$description string The description of this part. If null, deletes the description (@since 2.8.0).

setDisposition() public method

Set the content-disposition of this part.
public setDisposition ( string $disposition = null )
$disposition string The content-disposition to set ('inline', 'attachment', or an empty value).

setDispositionParameter() public method

Add a disposition parameter to this part.
public setDispositionParameter ( string $label, string $data )
$label string The disposition parameter label.
$data string The disposition parameter data. If null, removes the parameter (@since 2.8.0).

setDuration() public method

Set the content duration of the data contained in this part (see RFC 3803).
public setDuration ( integer $duration )
$duration integer The duration of the data, in seconds. If null, clears the duration information.

setEOL() public method

Sets a new string to use for EOLs.
public setEOL ( string $eol )
$eol string The string to use for EOLs.

setHeaderCharset() public method

Set the character set to use when outputting MIME headers.
public setHeaderCharset ( string $charset )
$charset string The character set.

setLanguage() public method

Set the language(s) of this part.
public setLanguage ( mixed $lang )
$lang mixed A language string, or an array of language strings.

setMetadata() public method

Set a piece of metadata on this object.
public setMetadata ( string $key, mixed $data = null )
$key string The metadata key.
$data mixed The metadata. If null, clears the key.

setMimeId() public method

Alter the MIME ID of this part.
public setMimeId ( string $mimeid )
$mimeid string The MIME ID.

setName() public method

Set the name of this part.
public setName ( string $name )
$name string The name to set.

setTransferEncoding() public method

Only needed in the following circumstances: 1.) Indicate what the transfer encoding is if the data has not yet been set in the object (can only be set if there presently are not any contents). 2.) Force the encoding to a certain type on a toString() call (if 'send' is true).
public setTransferEncoding ( string $encoding, array $options = [] )
$encoding string The transfer encoding to use.
$options array Additional options: - send: (boolean) If true, use $encoding as the sending encoding. DEFAULT: $encoding is used to change the base encoding.

setType() public method

Set the MIME type of this part.
public setType ( string $type )
$type string The MIME type to set (ex.: text/plain).

toString() public method

Return the entire part in MIME format.
public toString ( array $options = [] ) : mixed
$options array Additional options: - canonical: (boolean) Returns the encoded part in strict RFC 822 & 2045 output - namely, all newlines end with the canonical sequence. DEFAULT: false - defserver: (string) The default server to use when creating the header string. DEFAULT: none - encode: (integer) A mask of allowable encodings. DEFAULT: self::ENCODE_7BIT - headers: (mixed) Include the MIME headers? If true, create a new headers object. If a Horde_Mime_Headers object, add MIME headers to this object. If a string, use the string verbatim. DEFAULT: true - id: (string) Return only this MIME ID part. DEFAULT: Returns the base part. - stream: (boolean) Return a stream resource. DEFAULT: false
return mixed The MIME string (returned as a resource if $stream is true).

unserialize() public method

Unserialization.
public unserialize ( string $data )
$data string Serialized data.

valid() public method

Since: 2.8.0
public valid ( )

Property Details

$_bytes protected_oe property

Default value for this Part's size.
protected int $_bytes
return integer

$_contents protected_oe property

The body of the part. Always stored in binary format.
protected resource $_contents
return resource

$_eol protected_oe property

The default is currently to output the EOL sequence internally as just "\n" instead of the canonical "\r\n" required in RFC 822 & 2045. To be RFC complaint, the full EOL combination should be used when sending a message.
protected string $_eol
return string

$_failed protected_oe property

Flag to detect if a message failed to send at least once.
protected bool $_failed
return boolean

$_hdrCharset protected_oe property

The charset to output the headers in.
protected string $_hdrCharset
return string

$_headers protected_oe property

The MIME headers for this part.
protected Horde_Mime_Headers $_headers
return Horde_Mime_Headers

$_metadata protected_oe property

Metadata.
protected array $_metadata
return array

$_mimeid protected_oe property

The MIME ID of this part.
protected string $_mimeid
return string

$_parts protected_oe property

The subparts of this part.
protected array $_parts
return array

$_status protected_oe property

Status mask for this part.
protected int $_status
return integer

$_temp protected_oe property

Temporary array.
protected array $_temp
return array

$_transferEncoding protected_oe property

The desired transfer encoding of this part.
protected string $_transferEncoding
return string

$defaultCharset public_oe static_oe property

The default charset to use when parsing text parts with no charset information.
public static string $defaultCharset
return string

$encodingTypes public_oe static_oe property

Deprecation:
public static $encodingTypes

$memoryLimit public_oe static_oe property

The memory limit for use with the PHP temp stream.
public static int $memoryLimit
return integer

$mimeTypes public_oe static_oe property

Deprecation:
public static $mimeTypes

$parent public_oe property

Parent object. Value only accurate when iterating.
Since: 2.8.0
public Horde_Mime_Part $parent
return Horde_Mime_Part