XOOPS RMCommon Utilities  2.1.8.91RC
 All Classes Namespaces Files Functions Variables
Swift_Mime_Headers_AbstractHeader Class Reference
Inheritance diagram for Swift_Mime_Headers_AbstractHeader:
Inheritance graph

Public Member Functions

 __toString ()
 
 getCharset ()
 
 getEncoder ()
 
 getFieldName ()
 
 getLanguage ()
 
 getMaxLineLength ()
 
 setCharset ($charset)
 
 setEncoder (Swift_Mime_HeaderEncoder $encoder)
 
 setLanguage ($lang)
 
 setMaxLineLength ($lineLength)
 
 toString ()
 
- Public Member Functions inherited from Swift_Mime_Header
 getFieldBody ()
 
 getFieldBodyModel ()
 
 getFieldType ()
 
 setFieldBodyModel ($model)
 

Protected Member Functions

 clearCachedValueIf ($condition)
 
 createPhrase (Swift_Mime_Header $header, $string, $charset, Swift_Mime_HeaderEncoder $encoder=null, $shorten=false)
 
 encodeWords (Swift_Mime_Header $header, $input, $usedLength=-1)
 
 escapeSpecials ($token, $include=array(), $exclude=array())
 
 generateTokenLines ($token)
 
 getCachedValue ()
 
 getEncodableWordTokens ($string)
 
 getGrammar ($name)
 
 getTokenAsEncodedWord ($token, $firstLineOffset=0)
 
 initializeGrammar ()
 
 setCachedValue ($value)
 
 setFieldName ($name)
 
 tokenNeedsEncoding ($token)
 
 toTokens ($string=null)
 

Private Member Functions

 _tokensToString (array $tokens)
 

Private Attributes

 $_cachedValue = null
 
 $_charset = 'utf-8'
 
 $_encoder
 
 $_grammar = array()
 
 $_lang
 
 $_lineLength = 78
 
 $_name
 
 $_specials = array()
 

Additional Inherited Members

- Public Attributes inherited from Swift_Mime_Header
const TYPE_DATE = 16
 
const TYPE_ID = 32
 
const TYPE_MAILBOX = 8
 
const TYPE_PARAMETERIZED = 6
 
const TYPE_PATH = 64
 
const TYPE_TEXT = 2
 

Detailed Description

Definition at line 21 of file AbstractHeader.php.

Member Function Documentation

Swift_Mime_Headers_AbstractHeader::__toString ( )

Returns a string representation of this object.

Returns
string
See Also
toString()

Definition at line 187 of file AbstractHeader.php.

References toString().

Here is the call graph for this function:

Swift_Mime_Headers_AbstractHeader::_tokensToString ( array  $tokens)
private

Takes an array of tokens which appear in the header and turns them into an RFC 2822 compliant string, adding FWSP where needed.

Parameters
string[]$tokens
Returns
string private

Definition at line 566 of file AbstractHeader.php.

References $i, and $token.

Referenced by toString().

Here is the caller graph for this function:

Swift_Mime_Headers_AbstractHeader::clearCachedValueIf (   $condition)
protected

Clear the cached value if $condition is met.

Parameters
boolean$conditionprotected

Definition at line 525 of file AbstractHeader.php.

References setCachedValue().

Referenced by setCharset(), Swift_Mime_Headers_IdentificationHeader\setIds(), setLanguage(), setMaxLineLength(), Swift_Mime_Headers_ParameterizedHeader\setParameters(), Swift_Mime_Headers_DateHeader\setTimestamp(), and Swift_Mime_Headers_UnstructuredHeader\setValue().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_Mime_Headers_AbstractHeader::createPhrase ( Swift_Mime_Header  $header,
  $string,
  $charset,
Swift_Mime_HeaderEncoder  $encoder = null,
  $shorten = false 
)
protected

Produces a compliant, formatted RFC 2822 'phrase' based on the string given.

Parameters
Swift_Mime_Header$header
string$stringas displayed
string$charsetof the text
Swift_Mime_HeaderEncoder$encoder
boolean$shortenthe first line to make remove for header name
Returns
string

Definition at line 325 of file AbstractHeader.php.

References encodeWords(), escapeSpecials(), and Swift_Mime_Header\getFieldName().

Referenced by Swift_Mime_Headers_MailboxHeader\createDisplayNameString().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_Mime_Headers_AbstractHeader::encodeWords ( Swift_Mime_Header  $header,
  $input,
  $usedLength = -1 
)
protected

Encode needed word tokens within a string of input.

Parameters
string$input
string$usedLength,optional
Returns
string

Definition at line 366 of file AbstractHeader.php.

References $token, getEncodableWordTokens(), Swift_Mime_Header\getFieldName(), getTokenAsEncodedWord(), and tokenNeedsEncoding().

Referenced by createPhrase(), and Swift_Mime_Headers_UnstructuredHeader\getFieldBody().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_Mime_Headers_AbstractHeader::escapeSpecials (   $token,
  $include = array(),
  $exclude = array() 
)
protected

Escape special characters in a string (convert to quoted-pairs).

Parameters
string$token
string[]$include additonal chars to escape
string[]$exclude chars from escaping
Returns
string

Definition at line 305 of file AbstractHeader.php.

References $token.

Referenced by createPhrase().

Here is the caller graph for this function:

Swift_Mime_Headers_AbstractHeader::generateTokenLines (   $token)
protected

Generates tokens from the given string which include CRLF as individual tokens.

Parameters
string$token
Returns
string[] protected

Definition at line 495 of file AbstractHeader.php.

References $token.

Referenced by Swift_Mime_Headers_ParameterizedHeader\toTokens(), and toTokens().

Here is the caller graph for this function:

Swift_Mime_Headers_AbstractHeader::getCachedValue ( )
protected
Swift_Mime_Headers_AbstractHeader::getCharset ( )
Swift_Mime_Headers_AbstractHeader::getEncodableWordTokens (   $string)
protected

Splits a string into tokens in blocks of words which can be encoded quickly.

Parameters
string$string
Returns
string[]

Definition at line 420 of file AbstractHeader.php.

References $token, and tokenNeedsEncoding().

Referenced by encodeWords().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_Mime_Headers_AbstractHeader::getEncoder ( )

Get the encoder used for encoding this Header.

Returns
Swift_Mime_HeaderEncoder

Definition at line 137 of file AbstractHeader.php.

References $_encoder.

Referenced by Swift_Mime_Headers_MailboxHeader\createDisplayNameString(), and Swift_Mime_Headers_UnstructuredHeader\getFieldBody().

Here is the caller graph for this function:

Swift_Mime_Headers_AbstractHeader::getFieldName ( )

Get the name of this header (e.g. charset).

Returns
string

Implements Swift_Mime_Header.

Definition at line 146 of file AbstractHeader.php.

References $_name.

Swift_Mime_Headers_AbstractHeader::getGrammar (   $name)
protected

Get the grammar defined for $name token.

Parameters
string$nameexecatly as written in the RFC
Returns
string

Definition at line 284 of file AbstractHeader.php.

Referenced by Swift_Mime_Headers_MailboxHeader\_assertValidAddress(), Swift_Mime_Headers_ParameterizedHeader\_createParameter(), Swift_Mime_Headers_PathHeader\setAddress(), and Swift_Mime_Headers_IdentificationHeader\setIds().

Here is the caller graph for this function:

Swift_Mime_Headers_AbstractHeader::getLanguage ( )

Get the language used in this Header.

Returns
string

Definition at line 118 of file AbstractHeader.php.

References $_lang.

Referenced by Swift_Mime_Headers_ParameterizedHeader\_createParameter(), and Swift_Mime_Headers_ParameterizedHeader\_getEndOfParameterValue().

Here is the caller graph for this function:

Swift_Mime_Headers_AbstractHeader::getMaxLineLength ( )

Get the maximum permitted length of lines in this Header.

Returns
int

Definition at line 165 of file AbstractHeader.php.

References $_lineLength.

Referenced by Swift_Mime_Headers_ParameterizedHeader\_createParameter().

Here is the caller graph for this function:

Swift_Mime_Headers_AbstractHeader::getTokenAsEncodedWord (   $token,
  $firstLineOffset = 0 
)
protected

Get a token as an encoded word for safe insertion into headers.

Parameters
string$tokento encode
int$firstLineOffset,optional
Returns
string

Definition at line 456 of file AbstractHeader.php.

References $_charset, $_lang, and $token.

Referenced by Swift_Mime_Headers_ParameterizedHeader\_createParameter(), and encodeWords().

Here is the caller graph for this function:

Swift_Mime_Headers_AbstractHeader::initializeGrammar ( )
protected

Initialize some RFC 2822 (and friends) ABNF grammar definitions. protected

Definition at line 208 of file AbstractHeader.php.

Referenced by Swift_Mime_Headers_PathHeader\__construct(), Swift_Mime_Headers_MailboxHeader\__construct(), Swift_Mime_Headers_IdentificationHeader\__construct(), and Swift_Mime_Headers_ParameterizedHeader\__construct().

Here is the caller graph for this function:

Swift_Mime_Headers_AbstractHeader::setCharset (   $charset)

Set the character set used in this Header.

Parameters
string$charset

Implements Swift_Mime_Header.

Definition at line 83 of file AbstractHeader.php.

References clearCachedValueIf().

Here is the call graph for this function:

Swift_Mime_Headers_AbstractHeader::setEncoder ( Swift_Mime_HeaderEncoder  $encoder)

Set the encoder used for encoding the header.

Parameters
Swift_Mime_HeaderEncoder$encoder

Definition at line 127 of file AbstractHeader.php.

References setCachedValue().

Referenced by Swift_Mime_Headers_MailboxHeader\__construct(), Swift_Mime_Headers_UnstructuredHeader\__construct(), and Swift_Mime_Headers_ParameterizedHeader\__construct().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_Mime_Headers_AbstractHeader::setFieldName (   $name)
protected
Swift_Mime_Headers_AbstractHeader::setLanguage (   $lang)

Set the language used in this Header. For example, for US English, 'en-us'. This can be unspecified.

Parameters
string$lang

Definition at line 108 of file AbstractHeader.php.

References $lang, and clearCachedValueIf().

Here is the call graph for this function:

Swift_Mime_Headers_AbstractHeader::setMaxLineLength (   $lineLength)

Set the maximum length of lines in the header (excluding EOL).

Parameters
int$lineLength

Definition at line 155 of file AbstractHeader.php.

References clearCachedValueIf().

Here is the call graph for this function:

Swift_Mime_Headers_AbstractHeader::tokenNeedsEncoding (   $token)
protected

Test if a token needs to be encoded or not.

Parameters
string$token
Returns
boolean

Definition at line 410 of file AbstractHeader.php.

References $token.

Referenced by encodeWords(), and getEncodableWordTokens().

Here is the caller graph for this function:

Swift_Mime_Headers_AbstractHeader::toString ( )

Get this Header rendered as a RFC 2822 compliant string.

Returns
string
Exceptions
Swift_RfcComplianceException

Implements Swift_Mime_Header.

Definition at line 175 of file AbstractHeader.php.

References _tokensToString(), and toTokens().

Referenced by __toString().

Here is the call graph for this function:

Here is the caller graph for this function:

Swift_Mime_Headers_AbstractHeader::toTokens (   $string = null)
protected

Generate a list of all tokens in the final header.

Parameters
string$stringinput, optional
Returns
string[] private

Definition at line 541 of file AbstractHeader.php.

References $token, generateTokenLines(), and Swift_Mime_Header\getFieldBody().

Referenced by toString().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

Swift_Mime_Headers_AbstractHeader::$_cachedValue = null
private

Definition at line 77 of file AbstractHeader.php.

Referenced by getCachedValue().

Swift_Mime_Headers_AbstractHeader::$_charset = 'utf-8'
private

Definition at line 70 of file AbstractHeader.php.

Referenced by getCharset(), and getTokenAsEncodedWord().

Swift_Mime_Headers_AbstractHeader::$_encoder
private

Definition at line 50 of file AbstractHeader.php.

Referenced by getEncoder().

Swift_Mime_Headers_AbstractHeader::$_grammar = array()
private

Definition at line 36 of file AbstractHeader.php.

Swift_Mime_Headers_AbstractHeader::$_lang
private

Definition at line 63 of file AbstractHeader.php.

Referenced by getLanguage(), and getTokenAsEncodedWord().

Swift_Mime_Headers_AbstractHeader::$_lineLength = 78
private

Definition at line 57 of file AbstractHeader.php.

Referenced by getMaxLineLength().

Swift_Mime_Headers_AbstractHeader::$_name
private

Definition at line 43 of file AbstractHeader.php.

Referenced by getFieldName().

Swift_Mime_Headers_AbstractHeader::$_specials = array()
private

Definition at line 29 of file AbstractHeader.php.


The documentation for this class was generated from the following file: