AutoLoad Math.php
authorDomas Mituzas <midom@users.mediawiki.org>
Tue, 6 Jun 2006 10:00:53 +0000 (10:00 +0000)
committerDomas Mituzas <midom@users.mediawiki.org>
Tue, 6 Jun 2006 10:00:53 +0000 (10:00 +0000)
includes/Math.php
includes/OutputPage.php
includes/Parser.php
maintenance/parserTests.inc

index e40abdf..1bf68b2 100644 (file)
@@ -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();
+       }
 }
-
 ?>
index c155d38..e78c072 100644 (file)
@@ -5,9 +5,6 @@ if ( ! defined( 'MEDIAWIKI' ) )
  * @package MediaWiki
  */
 
-if ( $wgUseTeX )
-       require_once 'Math.php';
-
 /**
  * @todo document
  * @package MediaWiki
index f141df2..0c0d5ac 100644 (file)
@@ -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
index e8dfb8f..167956e 100644 (file)
@@ -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);
                }