Abstract Class Swift_Mime_Headers_AbstractHeader
An abstract base MIME Header.
Public Methods
Method | Description | Defined By |
---|---|---|
__construct() | Creates a new Header. | Swift_Mime_Headers_AbstractHeader |
__toString() | Returns a string representation of this object. | Swift_Mime_Headers_AbstractHeader |
getCharset() | Get the character set used in this Header. | Swift_Mime_Headers_AbstractHeader |
getEncoder() | Get the encoder used for encoding this Header. | Swift_Mime_Headers_AbstractHeader |
getFieldBody() | Get the field body, prepared for folding into a final header value. | Swift_Mime_Header |
getFieldBodyModel() | Get the model for the field body. | Swift_Mime_Header |
getFieldName() | Get the name of this header (e.g. charset). | Swift_Mime_Headers_AbstractHeader |
getFieldType() | Get the type of Header that this instance represents. | Swift_Mime_Header |
getGrammar() | Get the grammar used for this Header. | Swift_Mime_Headers_AbstractHeader |
getLanguage() | Get the language used in this Header. | Swift_Mime_Headers_AbstractHeader |
getMaxLineLength() | Get the maximum permitted length of lines in this Header. | Swift_Mime_Headers_AbstractHeader |
setCharset() | Set the character set used in this Header. | Swift_Mime_Headers_AbstractHeader |
setEncoder() | Set the encoder used for encoding the header. | Swift_Mime_Headers_AbstractHeader |
setFieldBodyModel() | Set the model for the field body. | Swift_Mime_Header |
setGrammar() | Set the grammar used for the header. | Swift_Mime_Headers_AbstractHeader |
setLanguage() | Set the language used in this Header. | Swift_Mime_Headers_AbstractHeader |
setMaxLineLength() | Set the maximum length of lines in the header (excluding EOL). | Swift_Mime_Headers_AbstractHeader |
toString() | Get this Header rendered as a RFC 2822 compliant string. | Swift_Mime_Headers_AbstractHeader |
Protected Methods
Method | Description | Defined By |
---|---|---|
clearCachedValueIf() | Clear the cached value if $condition is met. | Swift_Mime_Headers_AbstractHeader |
createPhrase() | Produces a compliant, formatted RFC 2822 'phrase' based on the string given. | Swift_Mime_Headers_AbstractHeader |
encodeWords() | Encode needed word tokens within a string of input. | Swift_Mime_Headers_AbstractHeader |
generateTokenLines() | Generates tokens from the given string which include CRLF as individual tokens. | Swift_Mime_Headers_AbstractHeader |
getCachedValue() | Get the value in the cache. | Swift_Mime_Headers_AbstractHeader |
getEncodableWordTokens() | Splits a string into tokens in blocks of words which can be encoded quickly. | Swift_Mime_Headers_AbstractHeader |
getTokenAsEncodedWord() | Get a token as an encoded word for safe insertion into headers. | Swift_Mime_Headers_AbstractHeader |
setCachedValue() | Set a value into the cache. | Swift_Mime_Headers_AbstractHeader |
setFieldName() | Set the name of this Header field. | Swift_Mime_Headers_AbstractHeader |
toTokens() | Generate a list of all tokens in the final header. | Swift_Mime_Headers_AbstractHeader |
tokenNeedsEncoding() | Test if a token needs to be encoded or not. | Swift_Mime_Headers_AbstractHeader |
Method Details
Creates a new Header.
public void __construct ( Swift_Mime_Grammar $grammar ) | ||
$grammar | Swift_Mime_Grammar |
Returns a string representation of this object.
See also toString().
public string __toString ( ) |
Clear the cached value if $condition is met.
protected void clearCachedValueIf ( $condition ) | ||
$condition | bool |
Produces a compliant, formatted RFC 2822 'phrase' based on the string given.
protected string createPhrase ( Swift_Mime_Header $header, $string, $charset, Swift_Mime_HeaderEncoder $encoder = null, $shorten = false ) | ||
$header | Swift_Mime_Header | |
$string | string | As displayed |
$charset | string | Of the text |
$encoder | Swift_Mime_HeaderEncoder | |
$shorten | bool | The first line to make remove for header name |
Encode needed word tokens within a string of input.
protected string encodeWords ( Swift_Mime_Header $header, $input, $usedLength = -1 ) | ||
$header | Swift_Mime_Header | |
$input | string | |
$usedLength | string | Optional |
Generates tokens from the given string which include CRLF as individual tokens.
protected string[] generateTokenLines ( $token ) | ||
$token | string |
Get the value in the cache.
protected string getCachedValue ( ) |
Get the character set used in this Header.
public string getCharset ( ) |
Splits a string into tokens in blocks of words which can be encoded quickly.
protected string[] getEncodableWordTokens ( $string ) | ||
$string | string |
Get the encoder used for encoding this Header.
public Swift_Mime_HeaderEncoder getEncoder ( ) |
Get the name of this header (e.g. charset).
public string getFieldName ( ) |
Get the grammar used for this Header.
public Swift_Mime_Grammar getGrammar ( ) |
Get the language used in this Header.
public string getLanguage ( ) |
Get the maximum permitted length of lines in this Header.
public int getMaxLineLength ( ) |
Get a token as an encoded word for safe insertion into headers.
protected string getTokenAsEncodedWord ( $token, $firstLineOffset = 0 ) | ||
$token | string | Token to encode |
$firstLineOffset | int | Optional |
Set a value into the cache.
protected void setCachedValue ( $value ) | ||
$value | string |
Set the character set used in this Header.
public void setCharset ( $charset ) | ||
$charset | string |
Set the encoder used for encoding the header.
public void setEncoder ( Swift_Mime_HeaderEncoder $encoder ) | ||
$encoder | Swift_Mime_HeaderEncoder |
Set the name of this Header field.
protected void setFieldName ( $name ) | ||
$name | string |
Set the grammar used for the header.
public void setGrammar ( Swift_Mime_Grammar $grammar ) | ||
$grammar | Swift_Mime_Grammar |
Set the language used in this Header.
For example, for US English, 'en-us'. This can be unspecified.
public void setLanguage ( $lang ) | ||
$lang | string |
Set the maximum length of lines in the header (excluding EOL).
public void setMaxLineLength ( $lineLength ) | ||
$lineLength | int |
Get this Header rendered as a RFC 2822 compliant string.
public string toString ( ) | ||
throws | Swift_RfcComplianceException |
---|
Generate a list of all tokens in the final header.
protected array toTokens ( $string = null ) | ||
$string | string | The string to tokenize |
return | array | An array of tokens as strings |
---|
Test if a token needs to be encoded or not.
protected bool tokenNeedsEncoding ( $token ) | ||
$token | string |