jenkins-bot has submitted this change and it was merged.
Change subject: Rename some global variables that violate the naming convention
......................................................................
Rename some global variables that violate the naming convention
* $wg(.*) variables from extension should start with the extension name
i.e. for extension Math $wgMath(.*)
* But keep $wgUseMathJax, because it has been used for 2 years now.
* Add release notes
Change-Id: Ib70a9f7767890cc4618bc10c2610784f5b17e670
---
M Math.php
M MathLaTeXML.php
A RELEASE-NOTES-2.0
M tests/MathLaTeXMLTest.php
4 files changed, 33 insertions(+), 20 deletions(-)
Approvals:
Chad: Looks good to me, approved
jenkins-bot: Verified
diff --git a/Math.php b/Math.php
index d55fe66..6ed0d6c 100644
--- a/Math.php
+++ b/Math.php
@@ -96,6 +96,8 @@
* that's scalable for zooming, printing, and high-resolution displays.
*
* Not guaranteed to be stable at this time.
+ *
+ * @todo Rename to $wgMathJax
*/
$wgUseMathJax = false;
@@ -104,15 +106,15 @@
* <http://latexml.mathweb.org/help>
*
* If you want or need to run your own server, follow these installation
- * instructions and override $wgLaTeXMLUrl:
- * <https://svn.mathweb.org/repos/LaTeXML/branches/arXMLiv/INSTALL>
+ * instructions and override $wgMathLaTeXMLUrl:
+ * <http://www.formulasearchengine.com/LaTeXML>
*
* If you expect heavy load you can specify multiple servers. In that case one
* server is randomly chosen for each rendering process. Specify the list of
- * servers in an array e.g $wgLaTeXMLUrl = array (
'http://latexml.example.com/convert',
+ * servers in an array e.g $wgMathLaTeXMLUrl = array (
'http://latexml.example.com/convert',
* 'http://latexml2.example.com/convert');
*/
-$wgLaTeXMLUrl = 'http://latexml.mathweb.org/convert';
+$wgMathLaTeXMLUrl = 'http://latexml.mathweb.org/convert';
/**
* Allows to use LaTeXML as renderer for mathematical equation.
@@ -123,12 +125,12 @@
* The timeout for the HTTP-Request sent to the LaTeXML to render an equation,
* in seconds.
*/
-$wgLaTeXMLTimeout = 240;
+$wgMathLaTeXMLTimeout = 240;
/**
* Setting for the LaTeXML renderer.
* See http://dlmf.nist.gov/LaTeXML/manual/commands/latexmlpost.xhtml for
details.
*/
-$wgDefaultLaTeXMLSetting =
'format=xhtml&whatsin=math&whatsout=math&pmml&cmml&nodefaultresources&preload=LaTeX.pool&preload=article.cls&preload=amsmath.sty&preload=amsthm.sty&preload=amstext.sty&preload=amssymb.sty&preload=eucal.sty&preload=[dvipsnames]xcolor.sty&preload=url.sty&preload=hyperref.sty&preload=[ids]latexml.sty&preload=texvc';
+$wgMathDefaultLaTeXMLSetting =
'format=xhtml&whatsin=math&whatsout=math&pmml&cmml&nodefaultresources&preload=LaTeX.pool&preload=article.cls&preload=amsmath.sty&preload=amsthm.sty&preload=amstext.sty&preload=amssymb.sty&preload=eucal.sty&preload=[dvipsnames]xcolor.sty&preload=url.sty&preload=hyperref.sty&preload=[ids]latexml.sty&preload=texvc';
/**
* The link to the texvc executable
*/
diff --git a/MathLaTeXML.php b/MathLaTeXML.php
index 14aea29..f3dce52 100644
--- a/MathLaTeXML.php
+++ b/MathLaTeXML.php
@@ -35,15 +35,15 @@
}
/**
* Gets the settings for the LaTeXML daemon.
- *
+ * @global type $wgMathDefaultLaTeXMLSetting
* @return string
*/
public function getLaTeXMLSettings() {
- global $wgDefaultLaTeXMLSetting;
+ global $wgMathDefaultLaTeXMLSetting;
if ( $this->LaTeXMLSettings ) {
return $this->LaTeXMLSettings;
} else {
- return $wgDefaultLaTeXMLSetting;
+ return $wgMathDefaultLaTeXMLSetting;
}
}
@@ -106,10 +106,11 @@
/**
* Performs a HTTP Post request to the given host.
- * Uses $wgLaTeXMLTimeout as timeout.
+ * Uses $wgMathLaTeXMLTimeout as timeout.
* Generates error messages on failure
* @see Http::post()
*
+ * @global type $wgMathLaTeXMLTimeout
* @param string $host
* @param string $post the encoded post request
* @param mixed $res the result
@@ -118,12 +119,12 @@
* @return boolean success
*/
public function makeRequest( $host, $post, &$res, &$error = '',
$httpRequestClass = 'MWHttpRequest' ) {
- global $wgLaTeXMLTimeout;
+ global $wgMathLaTeXMLTimeout;
wfProfileIn( __METHOD__ );
$error = '';
$res = null;
- $options = array( 'method' => 'POST', 'postData' => $post,
'timeout' => $wgLaTeXMLTimeout );
+ $options = array( 'method' => 'POST', 'postData' => $post,
'timeout' => $wgMathLaTeXMLTimeout );
$req = $httpRequestClass::factory( $host, $options );
$status = $req->execute();
if ( $status->isGood() ) {
@@ -136,7 +137,7 @@
$res = false;
wfDebugLog( "Math", "\nLaTeXML Timeout:"
. var_export( array( 'post' => $post,
'host' => $host
- , 'wgLaTeXMLTimeout' =>
$wgLaTeXMLTimeout ), true ) . "\n\n" );
+ , 'timeout' =>
$wgMathLaTeXMLTimeout ), true ) . "\n\n" );
} else {
// for any other unkonwn http error
$errormsg = $status->getHtml();
@@ -162,15 +163,15 @@
/**
* Picks a LaTeXML daemon.
* If more than one demon are availible one is chosen from the
- * $wgLaTeXMLUrl array.
+ * $wgMathLaTeXMLUrl array.
* @return string
*/
private static function pickHost() {
- global $wgLaTeXMLUrl;
- if ( is_array( $wgLaTeXMLUrl ) ) {
- $host = array_rand( $wgLaTeXMLUrl );
+ global $wgMathLaTeXMLUrl;
+ if ( is_array( $wgMathLaTeXMLUrl ) ) {
+ $host = array_rand( $wgMathLaTeXMLUrl );
} else {
- $host = $wgLaTeXMLUrl;
+ $host = $wgMathLaTeXMLUrl;
}
wfDebugLog( "Math", "picking host " . $host );
return $host;
diff --git a/RELEASE-NOTES-2.0 b/RELEASE-NOTES-2.0
new file mode 100644
index 0000000..e6c9842
--- /dev/null
+++ b/RELEASE-NOTES-2.0
@@ -0,0 +1,10 @@
+== Math 2.0 ==
+
+THIS IS NOT A RELEASE YET
+
+Math 2.0 is an alpha-quality branch and is not recommended for use in
+production.
+
+=== Configuration changes in 2.0 ===
+* $wgLaTeXMLUrl was renamed to $wgMathLaTeXMLUrl
+* $wgLaTeXMLUrl was renamed to $wgMathLaTeXMLTimeout
diff --git a/tests/MathLaTeXMLTest.php b/tests/MathLaTeXMLTest.php
index a549977..4c103c7 100644
--- a/tests/MathLaTeXMLTest.php
+++ b/tests/MathLaTeXMLTest.php
@@ -125,8 +125,8 @@
* i.e. if the span element is generated right.
*/
public function testIntegration() {
- global $wgLaTeXMLTimeout;
- $wgLaTeXMLTimeout = 20;
+ global $wgMathLaTeXMLTimeout;
+ $wgMathLaTeXMLTimeout = 20;
$renderer = MathRenderer::getRenderer( "a+b", array(),
MW_MATH_LATEXML );
$real = $renderer->render( true );
$expected = '<span class="tex" dir="ltr" id="a_b"><math
xmlns="http://www.w3.org/1998/Math/MathML" id="p1.1.m1" class="ltx_Math"
alttext="a+b" display="inline" xml:id="p1.1.m1.1" xref="p1.1.m1.1.cmml">
<semantics xml:id="p1.1.m1.1a" xref="p1.1.m1.1.cmml"> <mrow
xml:id="p1.1.m1.1.4" xref="p1.1.m1.1.4.cmml"> <mi xml:id="p1.1.m1.1.1"
xref="p1.1.m1.1.1.cmml">a</mi> <mo xml:id="p1.1.m1.1.2"
xref="p1.1.m1.1.2.cmml">+</mo> <mi xml:id="p1.1.m1.1.3"
xref="p1.1.m1.1.3.cmml">b</mi> </mrow> <annotation-xml
encoding="MathML-Content" xml:id="p1.1.m1.1.cmml" xref="p1.1.m1.1">
<apply xml:id="p1.1.m1.1.4.cmml" xref="p1.1.m1.1.4"> <plus
xml:id="p1.1.m1.1.2.cmml" xref="p1.1.m1.1.2"/> <ci
xml:id="p1.1.m1.1.1.cmml" xref="p1.1.m1.1.1">a</ci> <ci
xml:id="p1.1.m1.1.3.cmml" xref="p1.1.m1.1.3">b</ci> </apply>
</annotation-xml> <annotation encoding="application/x-tex"
xml:id="p1.1.m1.1b" xref="p1.1.m1.1.cmml">a+b</annotation> </semantics>
</math></span>';
--
To view, visit https://gerrit.wikimedia.org/r/109495
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib70a9f7767890cc4618bc10c2610784f5b17e670
Gerrit-PatchSet: 11
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: Cjucovschi <[email protected]>
Gerrit-Reviewer: Dginev <[email protected]>
Gerrit-Reviewer: Frédéric Wang <[email protected]>
Gerrit-Reviewer: GWicke <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Physikerwelt <[email protected]>
Gerrit-Reviewer: TheDJ <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits