Commit graph

19 commits

Author SHA1 Message Date
jenkins-bot 82e7eb98f6 Merge "Fix and add missing documentation and fix minor code smell issues" 2017-07-10 13:03:19 +00:00
Thiemo Mättig 3e45f5fd77 Fix a few minor control flow issues as reported by PHPStorm
Change-Id: Iad4499e679d7c333b4be49c6e1ad772c6a14a931
2017-07-10 11:48:18 +02:00
Thiemo Mättig bdeec56d1f Fix and add missing documentation and fix minor code smell issues
Change-Id: Ifa2f8a47fbd0bdd20334f59dd06a21339b9a4292
2017-07-10 11:40:12 +02:00
Kunal Mehta fbd17b4fef build: Updating mediawiki/mediawiki-codesniffer to 0.9.0
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.DuplicateReturn
* MediaWiki.Commenting.FunctionComment.MissingParamComment
* MediaWiki.Commenting.FunctionComment.MissingParamName
* MediaWiki.Commenting.FunctionComment.MissingParamTag
* MediaWiki.Commenting.FunctionComment.MissingReturn
* MediaWiki.Commenting.FunctionComment.ParamNameNoMatch
* MediaWiki.Commenting.FunctionComment.WrongStyle
* MediaWiki.FunctionComment.Missing.Protected
* MediaWiki.FunctionComment.Missing.Public
* MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment

Change-Id: I46c900a5652a6560d18be6cd67badc37ed7f8d97
2017-06-21 00:59:25 +00:00
Moritz Schubotz f5fdda0ba1 Improve error reporting
Display error message in the UI,
if the check command passes,
but the mml/svg/complete endpoints returns an valid json error.

Bug: T143225
Change-Id: I50776926e42f75a2c1e30fc9afe08baae3fcdbd1
2016-08-17 21:15:02 +02:00
Erik Bernhardson ae2d1e4bd1 Remove duplicate keys from log message
Bug: T138539
Change-Id: I2289864f20f764e1d9c74a282b3e9d1e1155c11b
(cherry picked from commit a4eb926249)
2016-06-28 22:12:47 +00:00
Marko Obrovac d722bc51f4 Send a no-cache content request on mathpurge=true
When the user specifies the mathpurge=true query parameter, the Math
extension needs to prompt RESTBase to regenerate the renders for all
formulae on the page and consequently issue Varnish purge requests. This
behaviour is achieved by including the `Cache-Control: no-cache` header
when requesting a render. Since RESTBase regenerates all of the renders
when it receives the header, send it only for the first content request;
if subsequent content requests are made, RESTBase will already have the
new renders.

Bug: T136205
Change-Id: I44482ccc1d8afdf6d40dcf8965d8debe83ef7e17
2016-06-03 14:10:57 +02:00
Moritz Schubotz 76fcd6e42c Fix iterator in batchGetMathML
In case there was an error with a check request the SVG size
information was not assigned to the correct SVG image.
This was due to this obvious bug in the batchGetMathML
iterator.

Bug: T136688
Change-Id: Ib2660597a6fb6ef96ba0c5c0ee0fa396b0ea3a24
2016-06-02 10:42:15 +02:00
Moritz Schubotz af2396cc06 Use the cached version of checkTex to improve performance
Bug: T132096
Change-Id: Ia327b4fac7d826ba24027b9f5cea8ba45c7d9017
2016-04-30 20:40:12 +00:00
physikerwelt 6f7bcaf2c6 Update to mediawiki-codesniffer 0.6.0
Change-Id: I2a1a74c771bc00f6c1569568dfcf474f06714426
2016-04-19 17:07:21 -04:00
Marko Obrovac d8e172f713 Allow the number of concurrent connections to be configurable
The MultiHttpClient class allows the user to set the number of
concurrent connections it keeps open. This patch simply allows users of
the Math extension to set it when connecting to RESTBase.

Note that this patch is effectively a no-op, since MultiHttpClient's
default is (also) 50.

Bug: T132096
Change-Id: If9b6e61ffa23f8d22b3aab874058e809ff4c74b8
2016-04-13 21:31:29 +02:00
physikerwelt 6699724d65 Convert all array() syntax to []
Per wikitech-l consensus: https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Change-Id: I1d2604e3f246ede58ff8245ba2b940f258d2d80c
2016-04-13 10:18:23 -04:00
physikerwelt 2f8c92cb79 Reduce number of Restbase requests
This change reduces the number of Restbase requests to two
by bundling all requests for MathML

Bug: T132096
Change-Id: Idfc29eeeca754738fe78ca0372e6b6725065528d
2016-04-12 15:13:26 +00:00
physikerwelt 9e605e09cd Render all math tags in parallel
Bug: T125543
Change-Id: Ia2febf2c0309e5de514445ad2aad58b7e5ce6837
2016-02-18 02:25:38 +00:00
physikerwelt c77118d37d Reduce the number or requests sent to Restbase
Currently two post request and one get request is sent
for each formula.
This change gets rid of the second post request.

Change-Id: I805a2c0fa619c9143c38a0cc60e76c9480578ed3
2016-01-29 18:16:05 +01:00
Marko Obrovac a3072e273b Logging: adjust the log entry levels
Most info-level log entries are actually debug messages, which should
not end up in the production log by default, so adjust them.

Only the Mathoid-powered TeX check fail has been promoted to info so
that we can quickly identify such requests from pages.

Bug: T121445
Change-Id: I3736c59f6425d675befea9438182ee1cdebe5fc5
2015-12-15 00:14:15 +01:00
physikerwelt 1ec767791b Make math usable without RESTbase
* Do not contact RESTbase in texvc rendering mode and
  use the well established tex checking that is already build
  into texvc.
* Do not use RESTbase in LaTeXML mode.

Background:
In I1982612e8c6a356e3dbdf447724ac82e5968cc77 RESTbased replaced
texvccheck that was a derivate of texvc designed for people
that wanted to use secure MathML rendering using mathoid.
The integration of mathoid to restbase made this feature obsolete.
However, texvccheck was not only used to check the latex input
that was sent to mathoid, but also the string which was sent to texvc.
Since texvc has already build in tex checking this is not
required and does not improve security.
Finally, users updating from old versions of the math extension
(prior to 2014) that do not have textexvccheck installed,
do not need to compile the texvccheck binary after this change.

PS5: Also treats the case where VisualEditor is not installed.

Bug: T121173
Change-Id: I1bd076b09206869b5ed75280d22e1b36bfb8d8ad
2015-12-11 22:04:12 +01:00
James D. Forrester 830fbbf071 MathRestbaseInterface: Only read properties we know exist
Horrible hack but will stop the bleeding, I imagine.

Bug: T121165
Change-Id: Ie81cc78e02771bee8ff2d6d492d6a3308bf6cd40
2015-12-10 15:18:22 -08:00
physikerwelt 6ef2e56439 Add Restbase interface
* Add a simple interface to Restbase that currently
  does not do anything.

Change-Id: I4c2ef329b3954fd35276a5e270d0dc3fcacabf7b
2015-12-01 21:10:09 +00:00