From e2ae8925ffad7d057355fe6016dda333d3908775 Mon Sep 17 00:00:00 2001 From: Domas Mituzas Date: Tue, 6 Jun 2006 10:00:53 +0000 Subject: [PATCH] AutoLoad Math.php --- includes/Math.php | 15 ++++++--------- includes/OutputPage.php | 3 --- includes/Parser.php | 2 +- maintenance/parserTests.inc | 2 -- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/includes/Math.php b/includes/Math.php index e40abdf1af..1bf68b2bdd 100644 --- a/includes/Math.php +++ b/includes/Math.php @@ -249,14 +249,11 @@ class MathRenderer { return $path; } - -} - -function renderMath( $tex ) { - global $wgUser; - $math = new MathRenderer( $tex ); - $math->setOutputMode( $wgUser->getOption('math')); - return $math->render(); + function renderMath( $tex ) { + global $wgUser; + $math = new MathRenderer( $tex ); + $math->setOutputMode( $wgUser->getOption('math')); + return $math->render(); + } } - ?> diff --git a/includes/OutputPage.php b/includes/OutputPage.php index c155d380c4..e78c072a14 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -5,9 +5,6 @@ if ( ! defined( 'MEDIAWIKI' ) ) * @package MediaWiki */ -if ( $wgUseTeX ) - require_once 'Math.php'; - /** * @todo document * @package MediaWiki diff --git a/includes/Parser.php b/includes/Parser.php index f141df2fa8..0c0d5ac9f3 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -462,7 +462,7 @@ class Parser $output = wfEscapeHTMLTagsOnly( $content ); break; case 'math': - $output = renderMath( $content ); + $output = MathRenderer::renderMath( $content ); break; case 'pre': // Backwards-compatibility hack diff --git a/maintenance/parserTests.inc b/maintenance/parserTests.inc index e8dfb8f69c..167956eb45 100644 --- a/maintenance/parserTests.inc +++ b/maintenance/parserTests.inc @@ -243,8 +243,6 @@ class ParserTest { if (preg_match('/\\bmath\\b/i', $opts)) { # XXX this should probably be done by the ParserOptions - require_once('Math.php'); - $options->setUseTex(true); } -- 2.20.1