From a251ec590fe4d25722353856fe9e3c2e31acacad Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Sun, 24 Sep 2006 18:32:41 +0000 Subject: [PATCH] [1.1.1] Error out if PEAR is not enabled on the system, include the test-settings.php file. git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@448 48356398-32a2-884e-a903-53898d9a118a --- benchmarks/Lexer.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/benchmarks/Lexer.php b/benchmarks/Lexer.php index d515a230..2d02defb 100644 --- a/benchmarks/Lexer.php +++ b/benchmarks/Lexer.php @@ -3,15 +3,22 @@ // emulates inserting a dir called HTMLPurifier into your class dir set_include_path(get_include_path() . PATH_SEPARATOR . '../library/'); +require_once '../test-settings.php'; + require_once 'HTMLPurifier/ConfigSchema.php'; require_once 'HTMLPurifier/Config.php'; -require_once 'HTMLPurifier/Lexer/DirectLex.php'; -require_once 'HTMLPurifier/Lexer/PEARSax3.php'; -$LEXERS = array( - 'DirectLex' => new HTMLPurifier_Lexer_DirectLex(), - 'PEARSax3' => new HTMLPurifier_Lexer_PEARSax3() -); +$LEXERS = array(); + +require_once 'HTMLPurifier/Lexer/DirectLex.php'; +$LEXERS['DirectLex'] = new HTMLPurifier_Lexer_DirectLex(); + +if (!empty($GLOBALS['HTMLPurifierTest']['PEAR'])) { + require_once 'HTMLPurifier/Lexer/PEARSax3.php'; + $LEXERS['PEARSax3'] = new HTMLPurifier_Lexer_PEARSax3(); +} else { + exit('PEAR required to perform benchmark.'); +} if (version_compare(PHP_VERSION, '5', '>=')) { require_once 'HTMLPurifier/Lexer/DOMLex.php';