[MediaWiki-commits] [Gerrit] Adjustments to the Math extension - change (mediawiki...MathSearch)
Physikerwelt has uploaded a new change for review. https://gerrit.wikimedia.org/r/66065 Change subject: Adjustments to the Math extension .. Adjustments to the Math extension added curl output to the debug page for LaTeXML developers Change-Id: I72b0471d186f4054e8c691a926ab162a2a40e5ec --- M FormulaInfo.php M MathObject.php M MathSearch.alias.php M SpecialMathDebug.php 4 files changed, 33 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MathSearch refs/changes/65/66065/1 diff --git a/FormulaInfo.php b/FormulaInfo.php index 68e4f02..093da30 100644 --- a/FormulaInfo.php +++ b/FormulaInfo.php @@ -66,11 +66,11 @@ $mo = MathObject::constructformpage( $pid, $eid ); $wgOut-addWikiText( Occurences on the following pages: ); wfDebugLog( MathSearch, var_export( $mo-getAllOccurences(), true ) ); - // $wgOut-addWikiText('b:'.var_export($res,true).'/b'); + //$wgOut-addWikiText('b:'.var_export($res,true).'/b'); $wgOut-addWikiText( 'TeX : code' . $mo-getTex() . '/code' ); $wgOut-addWikiText( 'MathML : ', false ); - $wgOut-addHTML( $mo-mathml ); + $wgOut-addHTML( $mo-getMathml() ); $wgOut-addHtml( 'a href=/wiki/Special:MathSearch?pattern=' . urlencode( $mo-getTex() ) . 'searchx=Searchimg src=http://wikidemo.formulasearchengine.com/images/FSE-PIC.png; width=15 height=15/a' ); # $log=htmlspecialchars( $res-math_log ); $wgOut-addWikiText( '==Similar pages==' ); @@ -82,7 +82,7 @@ $wgOut-addWikiText( '==MathML==' ); $wgOut-addHtml( br / ); - $wgOut-addHtml( htmlspecialchars( $mo-mathml ) ); + $wgOut-addHtml( htmlspecialchars( $mo-getMathml() ) ); $wgOut-addHtml( br / ); $wgOut-addHtml( br / ); $wgOut-addHtml( br / ); @@ -90,7 +90,7 @@ $wgOut-addWikiText( '==LOG and Debug==' ); $wgOut-addWikiText( 'Rendered at : code' . $mo-getTimestamp() . '/code an idexed at code' . $mo-getIndexTimestamp() . '/code' ); - $wgOut-addWikiText( 'validxml : code' . $mo-getValidXml() . '/code recheck:', false ); + $wgOut-addWikiText( 'validxml : code' . MathLaTeXML::isValidMathML($mo-getMathml()) . '/code recheck:', false ); $wgOut-addHtml( MathLaTeXML::isValidMathML( $mo-getMathml() ) ? valid:invalid ); $wgOut-addWikiText( 'status : code' . $mo-getStatusCode() . '/code' ); $wgOut-addHtml( htmlspecialchars( $mo-getLog() ) ); diff --git a/MathObject.php b/MathObject.php index dbc158d..73adcbd 100644 --- a/MathObject.php +++ b/MathObject.php @@ -3,6 +3,13 @@ protected $anchorID = 0; protected $pageID = 0; protected $index_timestamp = null; + protected $inputHash = ''; + + private static function DebugPrint($s){ + //$s= Sanitizer::safeEncodeAttribute($s); + wfDebugLog( MathSearch, $s); + } + public function getAnchorID() { return $this-anchorID; } @@ -18,6 +25,15 @@ public function getIndexTimestamp() { return $this-index_timestamp; } + public function getInputHash(){ + wfDebugLog('MathSearch', 'Debugger dies here'); + //die('end of debug toolbar'); + if ($this-inputHash){ + return $this-inputHash; + } else { + return parent::getInputHash(); + } + } public static function constructformpagerow( $res ) { global $wgDebugMath; if ( $res-mathindex_page_id 0 ) { @@ -28,13 +44,14 @@ $instance-index_timestamp = $res-mathindex_timestamp; } $instance-inputHash = $res-mathindex_inputhash; - $instance-readDatabaseEntry(); - wfDebugLog( MathSearch, 'got' . var_export( $instance, true ) ); + $instance-readFromDatabase(); + self::DebugPrint( 'got' . var_export( $instance, true ) ); return $instance; } else { return false; } } + public static function findSimilarPages( $pid ) { global $wgOut; $out = ; @@ -122,7 +139,7 @@ 'mathindex_page_id = ' . $pid . ' AND mathindex_anchor= ' . $eid ); - wfDebugLog( MathSearch, var_export( $res, true ) ); + self::DebugPrint( var_export( $res, true ) ); return self::constructformpagerow( $res ); } @@ -140,7 +157,7
[MediaWiki-commits] [Gerrit] Adjustments to the Math extension - change (mediawiki...MathSearch)
Physikerwelt has submitted this change and it was merged. Change subject: Adjustments to the Math extension .. Adjustments to the Math extension added curl output to the debug page for LaTeXML developers Change-Id: I72b0471d186f4054e8c691a926ab162a2a40e5ec --- M FormulaInfo.php M MathObject.php M MathSearch.alias.php M SpecialMathDebug.php 4 files changed, 33 insertions(+), 10 deletions(-) Approvals: Physikerwelt: Verified; Looks good to me, approved diff --git a/FormulaInfo.php b/FormulaInfo.php index 68e4f02..093da30 100644 --- a/FormulaInfo.php +++ b/FormulaInfo.php @@ -66,11 +66,11 @@ $mo = MathObject::constructformpage( $pid, $eid ); $wgOut-addWikiText( Occurences on the following pages: ); wfDebugLog( MathSearch, var_export( $mo-getAllOccurences(), true ) ); - // $wgOut-addWikiText('b:'.var_export($res,true).'/b'); + //$wgOut-addWikiText('b:'.var_export($res,true).'/b'); $wgOut-addWikiText( 'TeX : code' . $mo-getTex() . '/code' ); $wgOut-addWikiText( 'MathML : ', false ); - $wgOut-addHTML( $mo-mathml ); + $wgOut-addHTML( $mo-getMathml() ); $wgOut-addHtml( 'a href=/wiki/Special:MathSearch?pattern=' . urlencode( $mo-getTex() ) . 'searchx=Searchimg src=http://wikidemo.formulasearchengine.com/images/FSE-PIC.png; width=15 height=15/a' ); # $log=htmlspecialchars( $res-math_log ); $wgOut-addWikiText( '==Similar pages==' ); @@ -82,7 +82,7 @@ $wgOut-addWikiText( '==MathML==' ); $wgOut-addHtml( br / ); - $wgOut-addHtml( htmlspecialchars( $mo-mathml ) ); + $wgOut-addHtml( htmlspecialchars( $mo-getMathml() ) ); $wgOut-addHtml( br / ); $wgOut-addHtml( br / ); $wgOut-addHtml( br / ); @@ -90,7 +90,7 @@ $wgOut-addWikiText( '==LOG and Debug==' ); $wgOut-addWikiText( 'Rendered at : code' . $mo-getTimestamp() . '/code an idexed at code' . $mo-getIndexTimestamp() . '/code' ); - $wgOut-addWikiText( 'validxml : code' . $mo-getValidXml() . '/code recheck:', false ); + $wgOut-addWikiText( 'validxml : code' . MathLaTeXML::isValidMathML($mo-getMathml()) . '/code recheck:', false ); $wgOut-addHtml( MathLaTeXML::isValidMathML( $mo-getMathml() ) ? valid:invalid ); $wgOut-addWikiText( 'status : code' . $mo-getStatusCode() . '/code' ); $wgOut-addHtml( htmlspecialchars( $mo-getLog() ) ); diff --git a/MathObject.php b/MathObject.php index dbc158d..73adcbd 100644 --- a/MathObject.php +++ b/MathObject.php @@ -3,6 +3,13 @@ protected $anchorID = 0; protected $pageID = 0; protected $index_timestamp = null; + protected $inputHash = ''; + + private static function DebugPrint($s){ + //$s= Sanitizer::safeEncodeAttribute($s); + wfDebugLog( MathSearch, $s); + } + public function getAnchorID() { return $this-anchorID; } @@ -18,6 +25,15 @@ public function getIndexTimestamp() { return $this-index_timestamp; } + public function getInputHash(){ + wfDebugLog('MathSearch', 'Debugger dies here'); + //die('end of debug toolbar'); + if ($this-inputHash){ + return $this-inputHash; + } else { + return parent::getInputHash(); + } + } public static function constructformpagerow( $res ) { global $wgDebugMath; if ( $res-mathindex_page_id 0 ) { @@ -28,13 +44,14 @@ $instance-index_timestamp = $res-mathindex_timestamp; } $instance-inputHash = $res-mathindex_inputhash; - $instance-readDatabaseEntry(); - wfDebugLog( MathSearch, 'got' . var_export( $instance, true ) ); + $instance-readFromDatabase(); + self::DebugPrint( 'got' . var_export( $instance, true ) ); return $instance; } else { return false; } } + public static function findSimilarPages( $pid ) { global $wgOut; $out = ; @@ -122,7 +139,7 @@ 'mathindex_page_id = ' . $pid . ' AND mathindex_anchor= ' . $eid ); - wfDebugLog( MathSearch, var_export( $res, true ) ); + self::DebugPrint( var_export( $res, true ) ); return self::constructformpagerow( $res ); } @@ -140,7 +157,7 @@ ); foreach ( $res as $row ) { -