Commit graph

12 commits

Author SHA1 Message Date
umherirrender
34fe90ac52 Remove empty lines at end of functions
It looks like there is something missing after the last statement
Also remove some other empty lines at begin of functions, ifs or loops
while at these files

Change-Id: Ib00b5cfd31ca4dcd0c32ce33754d3c80bae70641
2016-11-05 11:55:10 +01:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
C. Scott Ananian
f422d00970 Rename RESTBase1/Parsoid3 bodyOnly parameter to body_only
The old `bodyOnly` name was deprecated on 2015-09-09.

Bug: T114185
Change-Id: If1fe919672dec4ca281c7f72bfd769a4bcaa5047
2015-09-30 10:27:04 -04:00
Kunal Mehta
476d99b99b Use tab instead of spaces in ParsoidVirtualRESTService
Spotted by phpcs

Change-Id: Iab3b1e7aa69f84d0655d54c7c64d2681e0662af4
2015-09-23 13:31:04 -07:00
C. Scott Ananian
195ea84883 Provide VRS objects with a name for more informative debugging/logging
Bug: T112330
Change-Id: Iaa3af55ebc426d54e8bef94dba5415bc535e096b
2015-09-14 14:42:28 -04:00
Matthew Flaschen
bff922cc5f Fix notice when restbaseCompat is omitted
Change-Id: I61042b326b989a4e3250f4a170d76048bdafcbd3
2015-09-01 23:50:05 -04:00
C. Scott Ananian
f5c874cbaf Use Parsoid v3 API; emulate the RESTBase v1 API
Update the ParsoidVirtualRESTService and the
RestbaseVirtualRESTService to use Parsoid's v3 API, instead of the
deprecated v1/v2 APIs.  Since Visual Editor still issues requests
using the Parsoid v1 API, convert Parsoid v1 API requests into Parsoid
v3 API requests when needed for a smooth transition.  We also add
support for converting RESTBase v1 API requests to Parsoid v3 API
requests.

The next step will be to convert Visual Editor to issue RESTBase v1
API requests (https://gerrit.wikimedia.org/r/217995), and then the
Parsoid v1 conversion code added here can be removed (T100681).

Tested Parsoid v1->v3 conversion, Parsoid v1->RESTBase conversion,
plus Parsoid v3 and RESTBase v1->Parsoid v3 conversion using VE
patched to issue RESTBase v1 API requests.

Bug: T100681
Change-Id: I07ac60cdec7a52ef93187d40099325a069e3239a
2015-08-27 18:41:23 -04:00
Marko Obrovac
b13bd0996c Introduce the Restbase Virtual REST Service class
Restbase, the REST content API service, is to be queried instead of
Parsoid by current Parsoid users (most importantly VE). This patch
introduces the Restbase virtual REST service class and transparently
maps Parsoid calls into Restbase ones if parsoidCompat is set when
creating the service object.

Additionally, $wgVirtualRestConfig is introduced in DefaultSettings.php. This
is a first step towards global service configuration and management.

Bug: T89066
Change-Id: I4d4043e5052327bbd789331f1c05b607c45fe7cb
2015-03-09 22:05:58 +01:00
Kunal Mehta
3d11321745 ParsoidVirtualRESTService: Don't use "else if"
https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP#C_borrowings

Change-Id: Ica51fd60e3da75d3b882cf3172ef7500afeab0db
2015-03-05 16:43:12 +00:00
Gabriel Wicke
03aee0e0cd Fix array index for oldid parameter
This caused an incorrect oldid parameter to be passed to parsoid on html2wt
conversion, resulting in dirty diffs.

Change-Id: If140bbc94f280f9ec5a1c9f6d9c3b4e7a46e1917
2015-01-14 14:06:01 -08:00
Kunal Mehta
9134bcfbb8 Cleanup ParsoidVirtualRESTService
* Remove unused global
* Throw \Exception instead of \MWException since this is in includes/libs/

Change-Id: I2e51d7e25a755b79d14d1814951449f6ce14c68e
2015-01-06 18:11:25 -08:00
Alex Monk
24409664f1 Make a VirtualRESTService class for Parsoid
So that code to deal with Parsoid can be shared across different extensions.

Relies on I1d57ff24

Bug: T1218
Change-Id: Id658d925b722b885fd425c27f7c4fd2cd02ad0b4
2015-01-07 01:19:45 +00:00