[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/lib/horde/framework/Horde/Mime/ -> Part.php (summary)

(no description)

File Size: 2366 lines (74 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Horde_Mime_Part:: (79 methods):
  __construct()
  _init()
  __clone()
  setDisposition()
  getDisposition()
  setDispositionParameter()
  getDispositionParameter()
  getAllDispositionParameters()
  setName()
  getName()
  setContents()
  appendContents()
  clearContents()
  getContents()
  _transferDecode()
  _transferEncode()
  setType()
  getType()
  getDefaultType()
  getPrimaryType()
  getSubType()
  setCharset()
  getCharset()
  setHeaderCharset()
  getHeaderCharset()
  setLanguage()
  getLanguage()
  setDuration()
  getDuration()
  setDescription()
  getDescription()
  setTransferEncoding()
  addPart()
  getParts()
  getPart()
  removePart()
  alterPart()
  _partAction()
  setContentTypeParameter()
  clearContentTypeParameter()
  getContentTypeParameter()
  getAllContentTypeParameters()
  setEOL()
  getEOL()
  addMimeHeaders()
  toString()
  _getTransferEncoding()
  replaceEOL()
  getBytes()
  setBytes()
  getSize()
  setContentId()
  getContentId()
  setMimeId()
  getMimeId()
  buildMimeIds()
  _generateBoundary()
  contentTypeMap()
  isBasePart()
  setMetadata()
  getMetadata()
  send()
  findBody()
  _writeStream()
  _writeStreamErrorHandler()
  _readStream()
  _scanStream()
  parseMessage()
  _getStructure()
  getRawPartText()
  _findHeader()
  _findBoundary()
  offsetExists()
  offsetGet()
  offsetSet()
  offsetUnset()
  count()
  serialize()
  unserialize()


Class: Horde_Mime_Part  - X-Ref

This class provides an object-oriented representation of a MIME part
(defined by RFC 2045).

Copyright 1999-2014 Horde LLC (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you
did not receive this file, see http://www.horde.org/licenses/lgpl21.

__construct()   X-Ref
Constructor.


_init()   X-Ref
Initialization tasks.


__clone()   X-Ref
Function to run on clone.


setDisposition($disposition = null)   X-Ref
Set the content-disposition of this part.

param: string $disposition  The content-disposition to set ('inline',

getDisposition()   X-Ref
Get the content-disposition of this part.

return: string  The part's content-disposition.  An empty string means

setDispositionParameter($label, $data)   X-Ref
Add a disposition parameter to this part.

param: string $label  The disposition parameter label.
param: string $data   The disposition parameter data.

getDispositionParameter($label)   X-Ref
Get a disposition parameter from this part.

param: string $label  The disposition parameter label.
return: string  The data requested.

getAllDispositionParameters()   X-Ref
Get all parameters from the Content-Disposition header.

return: array  An array of all the parameters

setName($name)   X-Ref
Set the name of this part.

param: string $name  The name to set.

getName($default = false)   X-Ref
Get the name of this part.

param: boolean $default  If the name parameter doesn't exist, should we
return: string  The name of the part.

setContents($contents, $options = array()   X-Ref
Set the body contents of this part.

param: mixed $contents  The part body. Either a string or a stream
param: array $options   Additional options:

appendContents($contents, $options = array()   X-Ref
Add to the body contents of this part.

param: mixed $contents  The part body. Either a string or a stream

clearContents()   X-Ref
Clears the body contents of this part.


getContents($options = array()   X-Ref
Return the body of the part.

param: array $options  Additional options:
return: mixed  The body text (string) of the part, null if there is no

_transferDecode($fp, $encoding)   X-Ref
Decodes the contents of the part to binary encoding.

param: resource $fp      A stream containing the data to decode.
param: string $encoding  The original file encoding.
return: resource  A new file resource with the decoded data.

_transferEncode($fp, $encoding)   X-Ref
Encodes the contents of the part as necessary for transport.

param: resource $fp      A stream containing the data to encode.
param: string $encoding  The encoding to use.
return: resource  A new file resource with the encoded data.

setType($type)   X-Ref
Set the MIME type of this part.

param: string $type  The MIME type to set (ex.: text/plain).

getType($charset = false)   X-Ref
Get the full MIME Content-Type of this part.

param: boolean $charset  Append character set information to the end
return: string  The mimetype of this part (ex.: text/plain;

getDefaultType()   X-Ref
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.

return: string  The default MIME type of this part (ex.: text/plain).

getPrimaryType()   X-Ref
Get the primary type of this part.

return: string  The primary MIME type of this part.

getSubType()   X-Ref
Get the subtype of this part.

return: string  The MIME subtype of this part.

setCharset($charset)   X-Ref
Set the character set of this part.

param: string $charset  The character set of this part.

getCharset()   X-Ref
Get the character set to use for this part.

return: string  The character set of this part. Returns null if there

setHeaderCharset($charset)   X-Ref
Set the character set to use when outputting MIME headers.

param: string $charset  The character set.

getHeaderCharset()   X-Ref
Get the character set to use when outputting MIME headers.

return: string  The character set.

setLanguage($lang)   X-Ref
Set the language(s) of this part.

param: mixed $lang  A language string, or an array of language

getLanguage()   X-Ref
Get the language(s) of this part.

param: array  The list of languages.

setDuration($duration)   X-Ref
Set the content duration of the data contained in this part (see RFC
3803).

param: integer $duration  The duration of the data, in seconds. If

getDuration()   X-Ref
Get the content duration of the data contained in this part (see RFC
3803).

return: integer  The duration of the data, in seconds. Returns null if

setDescription($description)   X-Ref
Set the description of this part.

param: string $description  The description of this part.

getDescription($default = false)   X-Ref
Get the description of this part.

param: boolean $default  If the description parameter doesn't exist,
return: string  The description of this part.

setTransferEncoding($encoding, $options = array()   X-Ref
Set the transfer encoding to use for this part. 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).

param: string $encoding  The transfer encoding to use.
param: array $options    Additional options:

addPart($mime_part)   X-Ref
Add a MIME subpart.

param: Horde_Mime_Part $mime_part  Add a subpart to the current object.

getParts()   X-Ref
Get a list of all MIME subparts.

return: array  An array of the Horde_Mime_Part subparts.

getPart($id)   X-Ref
Retrieve a specific MIME part.

param: string $id  The MIME ID to get.
return: Horde_Mime_Part  The part requested or null if the part doesn't

removePart($id)   X-Ref
Remove a subpart.

param: string $id  The MIME ID to delete.
param: boolean  Success status.

alterPart($id, $mime_part)   X-Ref
Alter a current MIME subpart.

param: string $id                  The MIME ID to alter.
param: Horde_Mime_Part $mime_part  The MIME part to store.
param: boolean  Success status.

_partAction($id, $action, $mime_part = null)   X-Ref
Function used to find a specific MIME part by ID and perform an action
on it.

param: string $id                  The MIME ID.
param: string $action              The action to perform ('get',
param: Horde_Mime_Part $mime_part  The object to use for 'alter'.
return: mixed  See calling functions.

setContentTypeParameter($label, $data)   X-Ref
Add a content type parameter to this part.

param: string $label  The disposition parameter label.
param: string $data   The disposition parameter data.

clearContentTypeParameter($label)   X-Ref
Clears a content type parameter from this part.

param: string $label  The disposition parameter label.
param: string $data   The disposition parameter data.

getContentTypeParameter($label)   X-Ref
Get a content type parameter from this part.

param: string $label  The content type parameter label.
return: string  The data requested.

getAllContentTypeParameters()   X-Ref
Get all parameters from the Content-Type header.

return: array  An array of all the parameters

setEOL($eol)   X-Ref
Sets a new string to use for EOLs.

param: string $eol  The string to use for EOLs.

getEOL()   X-Ref
Get the string to use for EOLs.

return: string  The string to use for EOLs.

addMimeHeaders($options = array()   X-Ref
Returns a Horde_Mime_Header object containing all MIME headers needed
for the part.

param: array $options  Additional options:
return: Horde_Mime_Headers  A Horde_Mime_Headers object.

toString($options = array()   X-Ref
Return the entire part in MIME format.

param: array $options  Additional options:
return: mixed  The MIME string (returned as a resource if $stream is

_getTransferEncoding($encode = self::ENCODE_7BIT)   X-Ref
Get the transfer encoding for the part based on the user requested
transfer encoding and the current contents of the part.

param: integer $encode  A mask of allowable encodings.
return: string  The transfer-encoding of this part.

replaceEOL($text, $eol = null, $stream = false)   X-Ref
Replace newlines in this part's contents with those specified by either
the given newline sequence or the part's current EOL setting.

param: mixed $text      The text to replace. Either a string or a
param: string $eol      The EOL sequence to use. If not present, uses
param: boolean $stream  If true, returns a stream resource.
return: string  The text with the newlines replaced by the desired

getBytes($approx = false)   X-Ref
Determine the size of this MIME part and its child members.

param: boolean $approx  If true, determines an approximate size for
return: integer  Size of the part, in bytes.

setBytes($bytes)   X-Ref
Explicitly set the size (in bytes) of this part. This value will only
be returned (via getBytes()) if there are no contents currently set.
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).

param: integer $bytes  The size of this part in bytes.

getSize($approx = false)   X-Ref
Output the size of this MIME part in KB.

param: boolean $approx  If true, determines an approximate size for
return: string  Size of the part in KB.

setContentId($cid = null)   X-Ref
Sets the Content-ID header for this part.

param: string $cid  Use this CID (if not already set).  Else, generate
return: string  The Content-ID for this part.

getContentId()   X-Ref
Returns the Content-ID for this part.

return: string  The Content-ID for this part.

setMimeId($mimeid)   X-Ref
Alter the MIME ID of this part.

param: string $mimeid  The MIME ID.

getMimeId()   X-Ref
Returns the MIME ID of this part.

return: string  The MIME ID.

buildMimeIds($id = null, $rfc822 = false)   X-Ref
Build the MIME IDs for this part and all subparts.

param: string $id       The ID of this part.
param: boolean $rfc822  Is this a message/rfc822 part?

_generateBoundary()   X-Ref
Generate the unique boundary string (if not already done).

return: string  The boundary string.

contentTypeMap($sort = true)   X-Ref
Returns a mapping of all MIME IDs to their content-types.

param: boolean $sort  Sort by MIME ID?
return: array  Keys: MIME ID; values: content type.

isBasePart($base)   X-Ref
Is this the base MIME part?

param: boolean $base  True if this is the base MIME part.

setMetadata($key, $data = null)   X-Ref
Set a piece of metadata on this object.

param: string $key  The metadata key.
param: mixed $data  The metadata. If null, clears the key.

getMetadata($key)   X-Ref
Retrieves metadata from this object.

param: string $key  The metadata key.
return: mixed  The metadata, or null if it doesn't exist.

send($email, $headers, Horde_Mail_Transport $mailer,array $opts = array()   X-Ref
Sends this message.

param: string $email                 The address list to send to.
param: Horde_Mime_Headers $headers   The Horde_Mime_Headers object
param: Horde_Mail_Transport $mailer  A Horde_Mail_Transport object.
param: array $opts                   Additional options:

findBody($subtype = null)   X-Ref
Finds the main "body" text part (if any) in a message.
"Body" data is the first text part under this part.

param: string $subtype  Specifically search for this subtype.
return: mixed  The MIME ID of the main body part, or null if a body

_writeStream($data, $options = array()   X-Ref
Write data to a stream.

param: array $data     The data to write. Either a stream resource or
param: array $options  Additional options:
return: resource  The stream resource.

_writeStreamErrorHandler($errno, $errstr)   X-Ref
Error handler for _writeStream().

param: integer $errno  Error code.
param: string $errstr  Error text.

_readStream($fp, $close = false)   X-Ref
Read data from a stream.

param: resource $fp    An active stream.
param: boolean $close  Close the stream when done reading?
return: string  The data from the stream.

_scanStream($fp, $type, $data = null)   X-Ref
Scans a stream for the requested data.

param: resource $fp  A stream resource.
param: string $type  Either '8bit', 'binary', or 'preg'.
param: mixed $data   Any additional data needed to do the scan.
param: boolean  The result of the scan.

parseMessage($text, array $opts = array()   X-Ref
Attempts to build a Horde_Mime_Part object from message text.
This function can be called statically via:
$mime_part = Horde_Mime_Part::parseMessage();

param: string $text  The text of the MIME message.
param: array $opts   Additional options:
return: Horde_Mime_Part  A MIME Part object.

_getStructure($header, $body,array $opts = array()   X-Ref
Creates a MIME object from the text of one part of a MIME message.

param: string $header  The header text.
param: string $body    The body text.
param: array $opts     Additional options:
return: Horde_Mime_Part  The MIME part object.

getRawPartText($text, $type, $id)   X-Ref
Attempts to obtain the raw text of a MIME part.
This function can be called statically via:
$data = Horde_Mime_Part::getRawPartText();

param: mixed $text   The full text of the MIME message. The text is
param: string $type  Either 'header' or 'body'.
param: string $id    The MIME ID.
return: string  The raw text.

_findHeader($text, $eol)   X-Ref
Find the location of the end of the header text.

param: string $text  The text to search.
param: string $eol   The EOL string.
return: integer  Header position.

_findBoundary($text, $pos, $boundary,$end = null)   X-Ref
Find the location of the next boundary string.

param: string $text      The text to search.
param: integer $pos      The current position in $text.
param: string $boundary  The boundary string.
param: integer $end      If set, return after matching this many
return: array  Keys are the boundary number, values are an array with

offsetExists($offset)   X-Ref
No description

offsetGet($offset)   X-Ref
No description

offsetSet($offset, $value)   X-Ref
No description

offsetUnset($offset)   X-Ref
No description

count()   X-Ref
Returns the number of message parts.

return: integer  Number of message parts.

serialize()   X-Ref
Serialization.

return: string  Serialized data.

unserialize($data)   X-Ref
Unserialization.

param: string $data  Serialized data.



Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1