Physikerwelt has uploaded a new change for review.
https://gerrit.wikimedia.org/r/66067
Change subject: Calculate HTTP POST data in separate method for debugging
......................................................................
Calculate HTTP POST data in separate method for debugging
To check if the renderer works correctly it is desired to be able to
separate the test of the renderer and the function of the extension
PHP code. Therefore the method getPostData can be used to get
the values can be sent to the renderer directly via
curl –d 'POSTDATA' URL
Change-Id: I530f5fcba46364458643914bca81cf0bc1b60a58
---
M MathLaTeXML.php
1 file changed, 10 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math
refs/changes/67/66067/1
diff --git a/MathLaTeXML.php b/MathLaTeXML.php
index ee38317..42e25d2 100644
--- a/MathLaTeXML.php
+++ b/MathLaTeXML.php
@@ -152,14 +152,21 @@
}
/**
+ * Calculates the HTTP POST Data for the request. Depends on the
settings
+ * and the input string only.
+ * @return string HTTP POST data
+ */
+ public function getPostData(){
+ $texcmd = urlencode( $this->tex );
+ return $this->getLaTeXMLSettings() . '&tex=' . $texcmd;
+ }
+ /**
* Does the actual web request to convert TeX to MathML.
* @return boolean
*/
private function doRender( ) {
$host = self::pickHost();
- $texcmd = urlencode( $this->tex );
- $post = $this->getLaTeXMLSettings();
- $post .= '&tex=' . $texcmd;
+ $post = $this->getPostData();
$this->lastError = '';
if ( $this->makeRequest( $host, $post, $res, $this->lastError )
) {
$result = json_decode( $res );
--
To view, visit https://gerrit.wikimedia.org/r/66067
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I530f5fcba46364458643914bca81cf0bc1b60a58
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits