Class Swift_Message_Headers

Description

Contains and constructs the headers for a MIME document

Located in /Swift/Message/Headers.php (line 19)


	
			
Variable Summary
array $attributes
string $cached
string $charset
string $encoding
boolean $forceEncoding
array $headers
string $language
string $LE
Method Summary
string build ()
string buildAttributes (string $header_line, string $header_name)
void forceEncoding ([boolean $force = true])
string get (string $name)
string getAttribute (string $header, string $name)
string getCharset ()
string getEncoded (string $name)
string getEncoding ()
string getLanguage ()
string getLE ()
array getList ()
boolean has (string $name)
boolean hasAttribute (string $header, string $name)
array listAttributes (string $header)
void remove (string $name)
void removeAttribute (string $header, string $name)
void set (string $name, string $value)
void setAttribute (string $header, string $name, string $value)
void setCharset (string $charset)
boolean setEncoding (string $encoding)
void setLanguage (string $lang)
boolean setLE (string $le)
void uncacheAll ()
Variables
array $attributes = array() (line 51)

Attributes appended to headers

  • access: protected
string $cached = array() (line 66)

Cached, pre-built headers

  • access: protected
string $charset = false (line 36)

The charset used in the headers

  • access: protected
array $emailContainingHeaders = array(
"To", "From", "Reply-To", "Cc", "Bcc", "Return-Path", "Sender")
(line 25)

Headers which may contain email addresses, and therefore should take notice when encoding

  • var: headers
  • access: protected
string $encoding = "B" (line 31)

The encoding format used for the body of the document

  • var: format
  • access: protected
boolean $forceEncoding = false (line 56)

If QP or Base64 encoding should be forced

  • access: protected
array $headers = array() (line 41)

A collection of headers

  • var: headers
  • access: protected
string $language = "en-us" (line 61)

The language used in the headers (doesn't really matter much)

  • access: protected
string $LE = "\r\n" (line 71)

The line ending used in the headers

  • access: protected
array $lowerHeaders = array() (line 46)

A container of references to the headers

  • access: protected
Methods
build (line 563)

Compile the list of headers which have been set and return an ascii string The return value should always be 7-bit ascii and will have been cleaned for header injection If this looks complicated it's probably because it is!! Keeping everything compliant is not easy.

This is RFC 2822 compliant

  • access: public
string build ()
buildAttributes (line 489)

Build the list of attributes for appending to the given header This is RFC 2231 & 2047 compliant.

A HUGE thanks to Joaquim Homrighausen for heaps of help, advice and testing to get this working rock solid.

  • access: protected
  • throws: Swift_Message_MimeException If no such header exists or there are no attributes
string buildAttributes (string $header_line, string $header_name)
  • string $header_line: The header built without attributes
  • string $header_name: The lowercase name of the header
forceEncoding (line 260)

Turn on or off forced header encoding

  • access: public
void forceEncoding ([boolean $force = true])
  • boolean $force: On/Off
get (line 149)

Get the value at a given header

  • access: public
  • see: hasHeader
  • throws: Swift_Message_MimeException If no such header exists
string get (string $name)
  • string $name: The name of the header, for example "From" or "Subject"
getAttribute (line 318)

Get the value for a given attribute on a given header

  • access: public
  • throws: Swift_Message_MimeException If no header is set
string getAttribute (string $header, string $name)
  • string $header: The name of the main header
  • string $name: The name of the attribute
getCharset (line 218)

Get the current charset used

  • access: public
string getCharset ()
getEncoded (line 369)

Get the header in it's compliant, encoded form

  • access: public
  • throws: Swift_Message_MimeException If the header doesn't exist
string getEncoded (string $name)
  • string $name: The name of the header
getEncoding (line 252)

Get the encoding format used in this document

  • access: public
string getEncoding ()
getLanguage (line 202)

Get the language used in the headers to $lang (e.g. en-us, en-gb, sv etc)

  • access: public
string getLanguage ()
getLE (line 92)

Get the line ending sequence

  • access: public
string getLE ()
getList (line 176)

Just fetch the array containing the headers

  • access: public
array getList ()
has (line 185)

Check if a header has been set or not

  • access: public
boolean has (string $name)
  • string $name: The name of the header, for example "From" or "Subject"
hasAttribute (line 298)

Check if a header has a given attribute applied to it

  • access: public
boolean hasAttribute (string $header, string $name)
  • string $header: The name of the main header
  • string $name: The name of the attribute
listAttributes (line 354)

Get a list of all the attributes in the given header.

  • access: public
array listAttributes (string $header)
  • string $header: The name of the header
remove (line 161)

Remove a header from the list

  • access: public
void remove (string $name)
  • string $name: The name of the header
removeAttribute (line 340)

Remove an attribute from a header

  • access: public
void removeAttribute (string $header, string $name)
  • string $header: The name of the header to remove the attribute from
  • string $name: The name of the attribute to remove
set (line 111)

Add a header or change an existing header value

  • access: public
void set (string $name, string $value)
  • string $name: The header name, for example "From" or "Subject"
  • string $value: The value to be inserted into the header. This is safe from header injection.
setAttribute (line 272)

Set an attribute in a major header

For example $headers->setAttribute("Content-Type", "format", "flowed")

  • access: public
  • throws: Swift_Message_MimeException If no such header exists
void setAttribute (string $header, string $name, string $value)
  • string $header: The main header these values exist in
  • string $name: The name for this value
  • string $value: The value to set
setCharset (line 210)

Set the charset used in the headers

  • access: public
void setCharset (string $charset)
  • string $charset: The charset name
setEncoding (line 235)

Specify the encoding to use for the headers if characters outside the 7-bit-printable ascii range are found This encoding will never be used if only 7-bit-printable characters are found in the headers.

Possible values are:

  • QP
  • Q
  • Quoted-Printable
  • B
  • Base64
NOTE: Q, QP, Quoted-Printable are all the same; as are B and Base64

  • access: public
boolean setEncoding (string $encoding)
  • string $encoding: The encoding format to use
setLanguage (line 194)

Set the language used in the headers to $lang (e.g. en-us, en-gb, sv etc)

  • access: public
void setLanguage (string $lang)
  • string $lang: The language to use
setLE (line 78)

Set the line ending character to use

  • access: public
boolean setLE (string $le)
  • string $le: The line ending sequence
uncacheAll (line 99)

Reset the cache state in these headers

  • access: public
void uncacheAll ()

Documentation generated on Wed, 26 Mar 2008 20:33:07 +1100 by phpDocumentor 1.3.1