[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3master/var/www/se3/includes/library/HTMLPurifier/Lexer/ -> DOMLex.php (summary)

(no description)

File Size: 280 lines (11 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

HTMLPurifier_Lexer_DOMLex:: (10 methods):
  __construct()
  tokenizeHTML()
  tokenizeDOM()
  createStartNode()
  createEndNode()
  transformAttrToAssoc()
  muteErrorHandler()
  callbackUndoCommentSubst()
  callbackArmorCommentEntities()
  wrapHTML()


Class: HTMLPurifier_Lexer_DOMLex  - X-Ref

Parser that uses PHP 5's DOM extension (part of the core).

In PHP 5, the DOM XML extension was revamped into DOM and added to the core.
It gives us a forgiving HTML parser, which we use to transform the HTML
into a DOM, and then into the tokens.  It is blazingly fast (for large
documents, it performs twenty times faster than
HTMLPurifier_Lexer_DirectLex,and is the default choice for PHP 5.

__construct()   X-Ref


tokenizeHTML($html, $config, $context)   X-Ref

param: string $html
param: HTMLPurifier_Config $config
param: HTMLPurifier_Context $context
return: HTMLPurifier_Token[]

tokenizeDOM($node, &$tokens)   X-Ref
Iterative function that tokenizes a node, putting it into an accumulator.
To iterate is human, to recurse divine - L. Peter Deutsch

param: DOMNode $node DOMNode to be tokenized.
param: HTMLPurifier_Token[] $tokens   Array-list of already tokenized tokens.
return: HTMLPurifier_Token of node appended to previously passed tokens.

createStartNode($node, &$tokens, $collect)   X-Ref

param: DOMNode $node DOMNode to be tokenized.
param: HTMLPurifier_Token[] $tokens   Array-list of already tokenized tokens.
param: bool $collect  Says whether or start and close are collected, set to
return: bool if the token needs an endtoken

createEndNode($node, &$tokens)   X-Ref

param: DOMNode $node
param: HTMLPurifier_Token[] $tokens

transformAttrToAssoc($node_map)   X-Ref
Converts a DOMNamedNodeMap of DOMAttr objects into an assoc array.

param: DOMNamedNodeMap $node_map DOMNamedNodeMap of DOMAttr objects.
return: array Associative array of attributes.

muteErrorHandler($errno, $errstr)   X-Ref
An error handler that mutes all errors

param: int $errno
param: string $errstr

callbackUndoCommentSubst($matches)   X-Ref
Callback function for undoing escaping of stray angled brackets
in comments

param: array $matches
return: string

callbackArmorCommentEntities($matches)   X-Ref
Callback function that entity-izes ampersands in comments so that
callbackUndoCommentSubst doesn't clobber them

param: array $matches
return: string

wrapHTML($html, $config, $context)   X-Ref
Wraps an HTML fragment in the necessary HTML

param: string $html
param: HTMLPurifier_Config $config
param: HTMLPurifier_Context $context
return: string



Generated: Tue Mar 17 22:47:18 2015 Cross-referenced by PHPXref 0.7.1