Class Swift_Mime_Grammar

InheritanceSwift_Mime_Grammar

Defines the grammar to use for validation, implements the RFC 2822 (and friends) ABNF grammar definitions.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Initialize some RFC 2822 (and friends) ABNF grammar definitions. Swift_Mime_Grammar
__wakeup() Swift_Mime_Grammar
escapeSpecials() Escape special characters in a string (convert to quoted-pairs). Swift_Mime_Grammar
getDefinition() Get the grammar defined for $name token. Swift_Mime_Grammar
getGrammarDefinitions() Returns the tokens defined in RFC 2822 (and some related RFCs). Swift_Mime_Grammar
getSpecials() Returns the current special characters used in the syntax which need to be escaped. Swift_Mime_Grammar

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
init() Swift_Mime_Grammar

Method Details

__construct() public method

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

public void __construct ( )
__wakeup() public method

public void __wakeup ( )
escapeSpecials() public method

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

public string escapeSpecials ( $token, $include = [], $exclude = [] )
$token string
$include string[]

Additional chars to escape

$exclude string[]

Chars from escaping

getDefinition() public method

Get the grammar defined for $name token.

public string getDefinition ( $name )
$name string

Exactly as written in the RFC

getGrammarDefinitions() public method

Returns the tokens defined in RFC 2822 (and some related RFCs).

public array getGrammarDefinitions ( )
getSpecials() public method

Returns the current special characters used in the syntax which need to be escaped.

public array getSpecials ( )
init() protected method

protected void init ( )