1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-06 22:26:31 +02:00

Move classes into Zend style setup.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@88 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2006-07-22 15:38:41 +00:00
parent 758e70dd94
commit 1ab3ae160a
18 changed files with 31 additions and 31 deletions

View File

@@ -0,0 +1,37 @@
<?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)) {
if (version_compare(PHP_VERSION, '5', '>=')) {
require_once 'HTMLPurifier/Lexer/DOMLex.php';
$lexer = new HTMLPurifier_Lexer_DOMLex();
} else {
require_once 'HTMLPurifier/Lexer/DirectLex.php';
$lexer = new HTMLPurifier_Lexer_DirectLex();
}
}
return $lexer;
}
}
?>