Merge "Remove even more unused variables"

This commit is contained in:
jenkins-bot 2013-04-27 19:41:38 +00:00 committed by Gerrit Code Review
commit f971af901f
1 changed files with 27 additions and 8 deletions

View File

@ -9,7 +9,12 @@
*/ */
/** /**
* Abstract base class for math renderers using different technologies. * Abstract base class with static methods for rendering the <math> tags using
* different technologies. These static methods create a new instance of the
* extending classes and render the math tags based on the mode setting of the user.
* Furthermore this class handles the caching of the rendered output and provides
* debug information,
* if run in mathdebug mode.
* *
* @author Tomasz Wegrzanowski * @author Tomasz Wegrzanowski
* @author Brion Vibber * @author Brion Vibber
@ -17,11 +22,15 @@
*/ */
abstract class MathRenderer { abstract class MathRenderer {
/** /**
* The following variables should made private, as soon it can be verified that they are not being directly accessed by other extensions. * The following variables should made private, as soon it can be verified
* that they are not being directly accessed by other extensions.
*/ */
var $mode = MW_MATH_PNG; var $mode = MW_MATH_PNG;
var $tex = ''; var $tex = '';
var $inputhash = ''; /**
* is calculated by texvc.
* @var string
*/
var $hash = ''; var $hash = '';
var $html = ''; var $html = '';
var $mathml = ''; var $mathml = '';
@ -32,10 +41,10 @@ abstract class MathRenderer {
/** /**
* Constructs a base MathRenderer * Constructs a base MathRenderer
* *
* @param string $tex LaTeX markup * @param string $tex (optional) LaTeX markup
* @param array $params HTML attributes * @param array $params (optional) HTML attributes
*/ */
public function __construct( $tex, $params = array() ) { public function __construct( $tex='', $params = array() ) {
$this->tex = $tex; $this->tex = $tex;
$this->params = $params; $this->params = $params;
} }
@ -77,17 +86,21 @@ abstract class MathRenderer {
default: default:
$renderer = new MathTexvc( $tex, $params ); $renderer = new MathTexvc( $tex, $params );
} }
wfDebugLog ( "Math", 'start rendering $' . $renderer->tex . '$' );
return $renderer; return $renderer;
} }
/** /**
* Returns TeX to HTML * Performs the rendering and returns the rendered element that needs to be embedded.
* *
* @return string of rendered HTML * @return string of rendered HTML
*/ */
abstract public function render(); abstract public function render();
/** /**
* texvc error messages
* TODO: update to MathML
* Returns an internationalized HTML error string * Returns an internationalized HTML error string
* *
* @param string $msg message key for specific error * @param string $msg message key for specific error
@ -147,7 +160,13 @@ abstract class MathRenderer {
} }
/** /**
* Writes rendering entry to database * Writes rendering entry to database.
*
* WARNING: Use writeCache() instead of this method to be sure that all
* renderer specific (such as squid caching) are taken into account.
* This function stores the values that are currently present in the class to the database even if they are empty.
*
* This function can be seen as protected function.
*/ */
public function writeToDatabase() { public function writeToDatabase() {
# Now save it back to the DB: # Now save it back to the DB: