PHP Class BP_Reply_By_Email_IMAP, bp-reply-by-email

Datei anzeigen Open project: r-a-y/bp-reply-by-email Class Usage Examples

Public Properties

Property Type Description
$html Is the current email message body HTML?

Protected Properties

Property Type Description
$connection Holds the current IMAP connection.

Public Methods

Method Description
body_parser ( resource $imap, integer $i, boolean $reply = true ) : mixed Parses the body of an email message.
init ( ) : BP_Reply_By_Email_IMAP Creates a singleton instance of the BP_Reply_By_Email_IMAP class
multipart_plain_text_parser ( obj $parts, resource $imap, integer $i, boolean $subpart = false ) : array Multipart plain-text parser.
run ( ) The main method we use to parse an IMAP inbox.

Protected Methods

Method Description
get_mail_headers ( resource $imap, integer $i ) : mixed Fetch all headers for an email and parses them into an array.

Private Methods

Method Description
__construct ( ) Private constructor. Intentionally left empty.
close ( ) : boolean Closes the IMAP connection.
connect ( ) : boolean Connects to the IMAP inbox.
is_connected ( ) : boolean Check to see if the IMAP connection is connected.

Method Details

body_parser() public static method

Tries to fetch the plain-text version when available first. Otherwise, will fallback to the HTML version.
public static body_parser ( resource $imap, integer $i, boolean $reply = true ) : mixed
$imap resource The current IMAP connection
$i integer The current email message number
$reply boolean If we're parsing a reply or not. Default set to true.
return mixed Either the email body on success or false on failure

get_mail_headers() protected method

Fetch all headers for an email and parses them into an array.
protected get_mail_headers ( resource $imap, integer $i ) : mixed
$imap resource The current IMAP connection
$i integer The current email message number
return mixed Array of email headers. False if no headers.

init() public static method

Creates a singleton instance of the BP_Reply_By_Email_IMAP class
public static init ( ) : BP_Reply_By_Email_IMAP
return BP_Reply_By_Email_IMAP object

multipart_plain_text_parser() public static method

Used during {@link BP_Reply_By_Email_IMAP::body_parser()} if email is a multipart email. This method parses a multipart email to return the plain-text body as well as the encoding type and other parameters on success.
public static multipart_plain_text_parser ( obj $parts, resource $imap, integer $i, boolean $subpart = false ) : array
$parts obj The multiple parts of an email. See imap_fetchstructure() for more details.
$imap resource The current IMAP connection
$i integer The current email message number
$subpart boolean If we're parsing a subpart or not. Defaults to false.
return array A populated array containing the body, encoding type and other parameters on success. Empty array on failure.

run() public method

The main method we use to parse an IMAP inbox.
public run ( )

Property Details

$connection protected_oe property

Holds the current IMAP connection.
protected $connection

$html public_oe static_oe property

Is the current email message body HTML?
public static $html