PHP Класс Horde_Mime_Part, horde

Автор: Chuck Hagenbuch ([email protected])
Автор: Michael Slusarz ([email protected])
Наследование: implements ArrayAccess, implements Countable, implements RecursiveIterator, implements Serializable
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$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)

Свойство Тип Описание
$_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.

Открытые методы

Метод Описание
__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 ( )

Защищенные методы

Метод Описание
_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.

Описание методов

__clone() публичный Метод

Function to run on clone.
public __clone ( )

__construct() публичный Метод

Constructor.
public __construct ( )

_findBoundary() защищенный статический Метод

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.
Результат array Keys are the boundary number, values are an array with two elements: 'start' and 'length'.

_findHeader() защищенный статический Метод

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.
Результат integer Header position.

_getStructure() защищенный статический Метод

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.
Результат Horde_Mime_Part The MIME part object.

_getTransferEncoding() защищенный Метод

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.
Результат string The transfer-encoding of this part.

_reEncodeMessageAttachment() защищенный Метод

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() защищенный Метод

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?
Результат string The data from the stream.

_reindex() защищенный Метод

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

_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() защищенный Метод

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

_transferDecode() защищенный Метод

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.
Результат resource A new file resource with the decoded data.

_transferEncode() защищенный Метод

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.
Результат resource A new file resource with the encoded data.

_writeStream() защищенный Метод

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.
Результат resource The stream resource.

addMimeHeaders() публичный Метод

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
Результат Horde_Mime_Headers A Horde_Mime_Headers object.

addPart() публичный Метод

Устаревший: Use array access instead.
public addPart ( $mime_part )

alterPart() публичный Метод

Устаревший: Use array access instead.
public alterPart ( $id, $mime_part )

appendContents() публичный Метод

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() публичный Метод

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() публичный Метод

Устаревший: Use setContentTypeParameter with a null $data value.
public clearContentTypeParameter ( $label )

clearContents() публичный Метод

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

contentTypeMap() публичный Метод

Устаревший: Use iterator instead.
public contentTypeMap ( $sort = true )

count() публичный Метод

Returns the number of child message parts (doesn't include grandchildren or more remote ancestors).
public count ( ) : integer
Результат integer Number of message parts.

current() публичный Метод

С версии: 2.8.0
public current ( )

findBody() публичный Метод

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

getAllContentTypeParameters() публичный Метод

Get all parameters from the Content-Type header.
public getAllContentTypeParameters ( ) : array
Результат array An array of all the parameters Returns the empty array if no parameters set.

getAllDispositionParameters() публичный Метод

Get all parameters from the Content-Disposition header.
public getAllDispositionParameters ( ) : array
Результат array An array of all the parameters Returns the empty array if no parameters set.

getBytes() публичный Метод

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.
Результат integer Size of the part, in bytes.

getCharset() публичный Метод

Get the character set to use for this part.
public getCharset ( ) : string
Результат string The character set of this part (lowercase). Returns null if there is no character set.

getChildren() публичный Метод

С версии: 2.8.0
public getChildren ( )

getContentId() публичный Метод

Returns the Content-ID for this part.
public getContentId ( ) : string
Результат string The Content-ID for this part (null if not set).

getContentTypeParameter() публичный Метод

Get a content type parameter from this part.
public getContentTypeParameter ( string $label ) : string
$label string The content type parameter label.
Результат string The data requested. Returns null if $label is not set.

getContents() публичный Метод

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
Результат mixed The body text (string) of the part, null if there is no contents, and a stream resource if 'stream' is true.

getDefaultType() публичный Метод

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
Результат string The default MIME type of this part (ex.: text/plain).

getDescription() публичный Метод

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?
Результат string The description of this part.

getDisposition() публичный Метод

Get the content-disposition of this part.
public getDisposition ( ) : string
Результат string The part's content-disposition. An empty string means no desired disposition has been set for this part.

getDispositionParameter() публичный Метод

Get a disposition parameter from this part.
public getDispositionParameter ( string $label ) : string
$label string The disposition parameter label.
Результат string The data requested. Returns null if $label is not set.

getDuration() публичный Метод

Get the content duration of the data contained in this part (see RFC 3803).
public getDuration ( ) : integer
Результат integer The duration of the data, in seconds. Returns null if there is no duration information.

getEOL() публичный Метод

Get the string to use for EOLs.
public getEOL ( ) : string
Результат string The string to use for EOLs.

getHeaderCharset() публичный Метод

Get the character set to use when outputting MIME headers.
public getHeaderCharset ( ) : string
Результат string The character set. If no preferred character set has been set, returns null.

getLanguage() публичный Метод

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

getMetadata() публичный Метод

Retrieves metadata from this object.
public getMetadata ( string $key ) : mixed
$key string The metadata key.
Результат mixed The metadata, or null if it doesn't exist.

getMimeId() публичный Метод

Returns the MIME ID of this part.
public getMimeId ( ) : string
Результат string The MIME ID.

getName() публичный Метод

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?
Результат string The name of the part.

getPart() публичный Метод

Устаревший: Use array access instead.
public getPart ( $id )

getPartByIndex() публичный Метод

Returns a subpart by index.
public getPartByIndex ( $index ) : Horde_Mime_Part
Результат Horde_Mime_Part Part, or null if not found.

getParts() публичный Метод

Get a list of all MIME subparts.
public getParts ( ) : array
Результат array An array of the Horde_Mime_Part subparts.

getPrimaryType() публичный Метод

Get the primary type of this part.
public getPrimaryType ( ) : string
Результат string The primary MIME type of this part.

getRawPartText() публичный статический Метод

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.
Результат string The raw text.

getSize() публичный Метод

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.
Результат string Size of the part in KB.

getSubType() публичный Метод

Get the subtype of this part.
public getSubType ( ) : string
Результат string The MIME subtype of this part.

getType() публичный Метод

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? `
Результат string The MIME type of this part.

hasChildren() публичный Метод

С версии: 2.8.0
public hasChildren ( )

isAttachment() публичный Метод

Determines if this MIME part is an attachment for display purposes.
public isAttachment ( ) : boolean
Результат boolean True if this part should be considered an attachment.

isBasePart() публичный Метод

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

key() публичный Метод

С версии: 2.8.0
public key ( )

next() публичный Метод

С версии: 2.8.0
public next ( )

offsetExists() публичный Метод

public offsetExists ( $offset )

offsetGet() публичный Метод

public offsetGet ( $offset )

offsetSet() публичный Метод

public offsetSet ( $offset, $value )

offsetUnset() публичный Метод

public offsetUnset ( $offset )

parseMessage() публичный статический Метод

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
Результат Horde_Mime_Part A MIME Part object.

partIterator() публичный Метод

Returns the recursive iterator needed to iterate through this part.
С версии: 2.8.0
public partIterator ( boolean $current = true ) : Iterator
$current boolean Include the current part as the base?
Результат Iterator Recursive iterator.

removePart() публичный Метод

Устаревший: Use array access instead.
public removePart ( $id )

replaceEOL() публичный Метод

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.
Результат string The text with the newlines replaced by the desired newline sequence (returned as a stream resource if $stream is true).

rewind() публичный Метод

С версии: 2.8.0
public rewind ( )

send() публичный Метод

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() публичный Метод

Serialization.
public serialize ( ) : string
Результат string Serialized data.

setBytes() публичный Метод

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() публичный Метод

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

setContentId() публичный Метод

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.
Результат string The Content-ID for this part.

setContentTypeParameter() публичный Метод

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() публичный Метод

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() публичный Метод

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() публичный Метод

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() публичный Метод

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() публичный Метод

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() публичный Метод

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

setHeaderCharset() публичный Метод

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

setLanguage() публичный Метод

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

setMetadata() публичный Метод

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() публичный Метод

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

setName() публичный Метод

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

setTransferEncoding() публичный Метод

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() публичный Метод

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

toString() публичный Метод

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
Результат mixed The MIME string (returned as a resource if $stream is true).

unserialize() публичный Метод

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

valid() публичный Метод

С версии: 2.8.0
public valid ( )

Описание свойств

$_bytes защищенное свойство

Default value for this Part's size.
protected int $_bytes
Результат integer

$_contents защищенное свойство

The body of the part. Always stored in binary format.
protected resource $_contents
Результат resource

$_eol защищенное свойство

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
Результат string

$_failed защищенное свойство

Flag to detect if a message failed to send at least once.
protected bool $_failed
Результат boolean

$_hdrCharset защищенное свойство

The charset to output the headers in.
protected string $_hdrCharset
Результат string

$_headers защищенное свойство

The MIME headers for this part.
protected Horde_Mime_Headers $_headers
Результат Horde_Mime_Headers

$_metadata защищенное свойство

Metadata.
protected array $_metadata
Результат array

$_mimeid защищенное свойство

The MIME ID of this part.
protected string $_mimeid
Результат string

$_parts защищенное свойство

The subparts of this part.
protected array $_parts
Результат array

$_status защищенное свойство

Status mask for this part.
protected int $_status
Результат integer

$_temp защищенное свойство

Temporary array.
protected array $_temp
Результат array

$_transferEncoding защищенное свойство

The desired transfer encoding of this part.
protected string $_transferEncoding
Результат string

$defaultCharset публичное статическое свойство

The default charset to use when parsing text parts with no charset information.
public static string $defaultCharset
Результат string

$encodingTypes публичное статическое свойство

Устаревший:
public static $encodingTypes

$memoryLimit публичное статическое свойство

The memory limit for use with the PHP temp stream.
public static int $memoryLimit
Результат integer

$mimeTypes публичное статическое свойство

Устаревший:
public static $mimeTypes

$parent публичное свойство

Parent object. Value only accurate when iterating.
С версии: 2.8.0
public Horde_Mime_Part $parent
Результат Horde_Mime_Part