Class Swift_Message_Headers

Description

Contains and constructs the headers for a MIME document

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


	
			
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)
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 ()
Methods
build (line 532)

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 THIS SERIOUSLY NEEDS REFACTORING

string build ()
buildAttributes (line 457)

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.

  • 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

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

Get the value at a given header

  • 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 321)

Get the value for a given attribute on a given header

  • 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

string getCharset ()
getEncoded (line 358)

Get the header in it's compliant, encoded form

  • 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

string getEncoding ()
getLanguage (line 202)

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

string getLanguage ()
getLE (line 92)

Get the line ending sequence

string getLE ()
getList (line 176)

Just fetch the array containing the headers

array getList ()
has (line 185)

Check if a header has been set or not

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

Check if a header has a given attribute applied to it

  • throws: Swift_Message_MimeException If no header is set
boolean hasAttribute (string $header, string $name)
  • string $header: The name of the main header
  • string $name: The name of the attribute
remove (line 161)

Remove a header from the list

void remove (string $name)
  • string $name: The name of the header
removeAttribute (line 343)

Remove an attribute from a header

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

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")

  • 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

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

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)

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

Set the line ending character to use

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

Reset the cache state in these headers

void uncacheAll ()

Documentation generated on Tue, 06 Mar 2007 23:32:24 +0000 by phpDocumentor 1.3.1