mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-10-16 06:26:08 +02:00
Rename Lexer, separate files. Also augmented benchmarks and benchmarker,
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@79 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
32
Lexer.php
Normal file
32
Lexer.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Forgivingly lexes SGML style documents: HTML, XML, XHTML, etc.
|
||||
*/
|
||||
|
||||
require_once 'HTMLPurifier/Token.php';
|
||||
|
||||
class HTMLPurifier_Lexer
|
||||
{
|
||||
|
||||
function tokenizeHTML($string) {
|
||||
trigger_error('Call to abstract class', E_USER_ERROR);
|
||||
}
|
||||
|
||||
// we don't really care if it's a reference or a copy
|
||||
|
||||
function create($prototype = null) {
|
||||
static $lexer = null;
|
||||
if ($prototype) {
|
||||
$lexer = $prototype;
|
||||
}
|
||||
if (empty($lexer)) {
|
||||
require_once 'HTMLPurifier/Lexer/DirectLex.php';
|
||||
$lexer = new HTMLPurifier_Lexer_DirectLex();
|
||||
}
|
||||
return $lexer;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user