PHP Класс Horde_ActiveSync_Imap_Message, horde

Some Mime parsing code taken from Imp_Contents.
Автор: Michael J Rubinsky ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_basePart Horde_ActiveSync_Mime Message structure.
$_data Horde_Imap_Client_Data_Fetch Message data.
$_hasAttachments boolean Flag to indicate if this message contains attachments.
$_imap Horde_Imap_Client_Base The imap client.
$_lastBodyPartDecode boolean Cache if the last body part was encoded or not.

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

Метод Описание
__construct ( Horde_Imap_Client_Base $imap, Horde_Imap_Client_Mailbox $mbox, Horde_Imap_Client_Data_Fetch $data ) Constructor
__destruct ( )
__get ( string $property ) : mixed Accessor
contentTypeMap ( ) : array Return this message's content map
getAttachments ( float $version ) : array Return an array of Horde_ActiveSync_Message_Attachment objects for the current message.
getAttachmentsMimeParts ( ) : array Return an array of mime parts for each message attachment.
getBodyPart ( integer $id, array $options ) : mixed Gets the raw text for one section of the message.
getCc ( ) : string Return the CC addresses for this message.
getDate ( ) : Horde_Date Return the message date.
getFlag ( string $flag ) : boolean Get a message flag
getFlags ( ) : array Return all message flags.
getForwardHeaders ( ) : string Return nicely formatted text representing the headers to display with in-line forwarded messages.
getFromAddress ( ) : string Return the message's From: address.
getFullMsg ( boolean $stream = false ) : mixed Return the full message text.
getHeaders ( ) : Horde_Mime_Headers Return this message's base part headers.
getMessageBodyData ( array $options = [] ) : array Returns the main text body of the message suitable for sending over EAS response.
getMessageBodyDataObject ( array $options = [] ) : Horde_ActiveSync_Imap_MessageBodyData Returns the main text body of the message suitable for sending over EAS response.
getMimePart ( integer $id, array $options = [] ) : Horde_Mime_Part Fetch a part of a MIME message.
getPartName ( Horde_Mime_Part $part, boolean $use_descrip = false ) : string Return the descriptive part label, making sure it is not empty.
getReplyTo ( ) : string Return the ReplyTo Address
getStructure ( ) : Horde_Mime_Part Return the message's base Mime part.
getSubject ( ) : string Return the message subject.
getToAddresses ( ) : array Return the To addresses from this message.
hasAttachments ( ) : boolean Return the hasAttachments flag
hasiCalendar ( ) : mixed Return the MIME part of the iCalendar attachment, if available.
isAttachment ( string $id, string $mime_type ) : boolean Determines if a MIME type is an attachment.
isEncrypted ( Horde_Mime_Part $message = null ) : boolean Return the S/MIME encryption status of this message (RFC2633)
isSigned ( Horde_Mime_Part $message = null ) : boolean Return the S/MIME signature status of this message (RFC2633)

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

Метод Описание
_buildEasAttachmentFromMime ( integer $id, Horde_Mime_Part $mime_part, float $version ) : Horde_ActiveSync_Message_AirSyncBaseAttachment Build an appropriate attachment object from the given mime part.
_decodeTnefData ( integer | Horde_Mime_part $data ) : Horde_Mime_Part Convert a TNEF attachment into a multipart/mixed part.

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

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

Constructor
public __construct ( Horde_Imap_Client_Base $imap, Horde_Imap_Client_Mailbox $mbox, Horde_Imap_Client_Data_Fetch $data )
$imap Horde_Imap_Client_Base The imap client object.
$mbox Horde_Imap_Client_Mailbox The mailbox object.
$data Horde_Imap_Client_Data_Fetch The data returned from a FETCH must contain at least uid, structure and flags.

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

public __destruct ( )

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

Accessor
public __get ( string $property ) : mixed
$property string The property.
Результат mixed

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

Build an appropriate attachment object from the given mime part.
protected _buildEasAttachmentFromMime ( integer $id, Horde_Mime_Part $mime_part, float $version ) : Horde_ActiveSync_Message_AirSyncBaseAttachment
$id integer The mime id for the part
$mime_part Horde_Mime_Part The mime part.
$version float The EAS version.
Результат Horde_ActiveSync_Message_AirSyncBaseAttachment | Horde_ActiveSync_Message_Attachment

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

Convert a TNEF attachment into a multipart/mixed part.
protected _decodeTnefData ( integer | Horde_Mime_part $data ) : Horde_Mime_Part
$data integer | Horde_Mime_part Either a mime part id or a Horde_Mime_Part object containing the TNEF attachment.
Результат Horde_Mime_Part The multipart/mixed MIME part containing any attachment data we can decode.

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

Return this message's content map
public contentTypeMap ( ) : array
Результат array The content map, with mime ids as keys and content type as values.

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

Return an array of Horde_ActiveSync_Message_Attachment objects for the current message.
public getAttachments ( float $version ) : array
$version float The EAS protocol version this is for.
Результат array An array of Horde_ActiveSync_Message_Attachment objects.

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

Return an array of mime parts for each message attachment.
public getAttachmentsMimeParts ( ) : array
Результат array An array of Horde_Mime_Part objects.

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

Gets the raw text for one section of the message.
public getBodyPart ( integer $id, array $options ) : mixed
$id integer The ID of the MIME part.
$options array Additional options: - decode: (boolean) Attempt to decode the bodypart on the remote server. If successful, sets self::$_lastBodyPartDecode to the content-type of the decoded data. DEFAULT: No - length: (integer) If set, only download this many bytes of the bodypart from the server. DEFAULT: All data is retrieved. - mimeheaders: (boolean) Include the MIME headers also? DEFAULT: No - stream: (boolean) If true, return a stream. DEFAULT: No
Результат mixed The text of the part or a stream resource if 'stream' is true.

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

Return the CC addresses for this message.
public getCc ( ) : string
Результат string The Cc address string.

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

Return the message date.
public getDate ( ) : Horde_Date
Результат Horde_Date The messages's envelope date.

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

Get a message flag
public getFlag ( string $flag ) : boolean
$flag string The flag to search for.
Результат boolean

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

Return all message flags.
С версии: 2.17.0
public getFlags ( ) : array
Результат array An array of message flags.

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

Return nicely formatted text representing the headers to display with in-line forwarded messages.
public getForwardHeaders ( ) : string
Результат string

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

Return the message's From: address.
public getFromAddress ( ) : string
Результат string The From address of this message.

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

Return the full message text.
public getFullMsg ( boolean $stream = false ) : mixed
$stream boolean Return data as a stream?
Результат mixed A string or stream resource.

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

Return this message's base part headers.
public getHeaders ( ) : Horde_Mime_Headers
Результат Horde_Mime_Headers The message headers.

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

Returns the main text body of the message suitable for sending over EAS response.
public getMessageBodyData ( array $options = [] ) : array
$options array An options array containgin: - bodyprefs: (array) Bodypref settings DEFAULT: none (No bodyprefs used). - mimesupport: (integer) Indicates if MIME is supported or not. Possible values: 0 - Not supported 1 - Only S/MIME or 2 - All MIME. DEFAULT: 0 (No MIME support) - protocolversion: (float) The EAS protocol we are supporting. DEFAULT 2.5
Результат array An array of one or both of 'plain' and 'html' content.

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

Returns the main text body of the message suitable for sending over EAS response.
public getMessageBodyDataObject ( array $options = [] ) : Horde_ActiveSync_Imap_MessageBodyData
$options array An options array containgin: - bodyprefs: (array) Bodypref settings DEFAULT: none (No bodyprefs used). - mimesupport: (integer) Indicates if MIME is supported or not. Possible values: 0 - Not supported 1 - Only S/MIME or 2 - All MIME. DEFAULT: 0 (No MIME support) - protocolversion: (float) The EAS protocol we are supporting. DEFAULT 2.5
Результат Horde_ActiveSync_Imap_MessageBodyData The result.

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

Fetch a part of a MIME message.
public getMimePart ( integer $id, array $options = [] ) : Horde_Mime_Part
$id integer The MIME index of the part requested.
$options array Additional options: - length: (integer) If set, only download this many bytes of the bodypart from the server. DEFAULT: All data is retrieved. - nocontents: (boolean) If true, don't add the contents to the part DEFAULT: Contents are added to the part
Результат Horde_Mime_Part The raw MIME part asked for.

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

Return the descriptive part label, making sure it is not empty.
public getPartName ( Horde_Mime_Part $part, boolean $use_descrip = false ) : string
$part Horde_Mime_Part The MIME Part object.
$use_descrip boolean Use description? If false, uses name.
Результат string The part label (non-empty).

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

Return the ReplyTo Address
public getReplyTo ( ) : string
Результат string

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

Return the message's base Mime part.
public getStructure ( ) : Horde_Mime_Part
Результат Horde_Mime_Part

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

Return the message subject.
public getSubject ( ) : string
Результат string The subject.

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

Return the To addresses from this message.
public getToAddresses ( ) : array
Результат array An array containing arrays of 'to' and 'displayto' addresses. @since 2.37.1, ensures the text is UTF8.

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

Return the hasAttachments flag
public hasAttachments ( ) : boolean
Результат boolean

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

Return the MIME part of the iCalendar attachment, if available.
public hasiCalendar ( ) : mixed
Результат mixed The mime part, if present, false otherwise.

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

For our purposes, an attachment is any MIME part that can be downloaded by itself (i.e. all the data needed to view the part is contained within the download data).
Устаревший: Will be removed in 3.0 (Only used in self::hasAttachments call).
public isAttachment ( string $id, string $mime_type ) : boolean
$id string The MIME Id for the part we are checking.
$mime_type string The MIME type.
Результат boolean True if an attachment.

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

Return the S/MIME encryption status of this message (RFC2633)
public isEncrypted ( Horde_Mime_Part $message = null ) : boolean
$message Horde_Mime_Part A mime part to check. If omitted, use self::$_message.
Результат boolean True if message is S/MIME signed or encrypted, false otherwise.

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

Return the S/MIME signature status of this message (RFC2633)
public isSigned ( Horde_Mime_Part $message = null ) : boolean
$message Horde_Mime_Part A mime part to check. If omitted, use self::$_message.
Результат boolean True if message is S/MIME signed, false otherwise.

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

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

Message structure.
protected Horde_ActiveSync_Mime $_basePart
Результат Horde_ActiveSync_Mime

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

Message data.
protected Horde_Imap_Client_Data_Fetch $_data
Результат Horde_Imap_Client_Data_Fetch

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

Flag to indicate if this message contains attachments.
protected bool $_hasAttachments
Результат boolean

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

The imap client.
protected Horde_Imap_Client_Base $_imap
Результат Horde_Imap_Client_Base

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

Cache if the last body part was encoded or not.
protected bool $_lastBodyPartDecode
Результат boolean