Merge "Avoid unnecessary database reads"
This commit is contained in:
commit
dfdf55b9ce
|
@ -182,8 +182,7 @@ class MathLaTeXML extends MathMathML {
|
|||
$renderer = new MathMathML( $this->getTex() );
|
||||
$renderer->setMathml( $this->getMathml() );
|
||||
$renderer->setMode( MW_MATH_LATEXML );
|
||||
$renderer->setPurge( true );
|
||||
$res = $renderer->render();
|
||||
$res = $renderer->render( true );
|
||||
if ( $res == true ) {
|
||||
$this->svg = $renderer->getSvg();
|
||||
} else {
|
||||
|
|
|
@ -104,7 +104,7 @@ class MathMathML extends MathRenderer {
|
|||
wfDebugLog( "Math", "Rerendering was requested." );
|
||||
return true;
|
||||
} else {
|
||||
$dbres = $this->readFromDatabase();
|
||||
$dbres = $this->isInDatabase();
|
||||
if ( $dbres ) {
|
||||
if ( $this->isValidMathML( $this->getMathml() ) ) {
|
||||
wfDebugLog( "Math", "Valid MathML entry found in database." );
|
||||
|
|
|
@ -387,7 +387,7 @@ class MathTexvc extends MathRenderer {
|
|||
global $wgMathCheckFiles;
|
||||
|
||||
wfProfileIn( __METHOD__ );
|
||||
if ( $this->readFromDatabase() ) {
|
||||
if ( $this->isInDatabase() ) {
|
||||
if ( !$wgMathCheckFiles ) {
|
||||
// Short-circuit the file existence & migration checks
|
||||
wfProfileOut( __METHOD__ );
|
||||
|
@ -413,8 +413,8 @@ class MathTexvc extends MathRenderer {
|
|||
return $backend->getFileContents( array( 'src' => $this->getHashPath() . "/" . $this->getHash() . '.png' ) );
|
||||
}
|
||||
|
||||
public function readFromDatabase() {
|
||||
$return = parent::readFromDatabase();
|
||||
public function isInDatabase() {
|
||||
$return = parent::isInDatabase();
|
||||
if ( $this->hash && $return ) {
|
||||
return true;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue