MediaWiki REL1_33
|
Virtual HTTP service client for Parsoid. More...
Public Member Functions | |
__construct (array $params) | |
Example Parsoid v3 requests: GET /local/v3/page/html/$title/{$revision}. | |
onRequests (array $reqs, Closure $idGeneratorFunc) | |
Prepare virtual HTTP(S) requests (for this service) for execution. | |
Public Member Functions inherited from VirtualRESTService | |
getName () | |
Return the name of this service, in a form suitable for error reporting or debugging. | |
onResponses (array $reqs, Closure $idGeneratorFunc) | |
Mangle or replace virtual HTTP(S) requests which have been responded to. | |
Additional Inherited Members | |
Protected Attributes inherited from VirtualRESTService | |
array | $params = [] |
Key/value map. | |
Virtual HTTP service client for Parsoid.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html Virtual REST service for Parsoid
Definition at line 25 of file ParsoidVirtualRESTService.php.
ParsoidVirtualRESTService::__construct | ( | array | $params | ) |
Example Parsoid v3 requests: GET /local/v3/page/html/$title/{$revision}.
array | $params | Key/value map
|
Reimplemented from VirtualRESTService.
Definition at line 47 of file ParsoidVirtualRESTService.php.
References VirtualRESTService\$params.
ParsoidVirtualRESTService::onRequests | ( | array | $reqs, |
Closure | $idGeneratorFunc | ||
) |
Prepare virtual HTTP(S) requests (for this service) for execution.
This method should mangle any of the $reqs entry fields as needed:
The incoming URL parameter will be relative to the service mount point.
This method can also remove some of the requests as well as add new ones (using $idGenerator to set each of the entries' array keys). For any existing or added request, the 'response' array can be filled in, which will prevent the client from executing it. If an original request is removed, at some point it must be added back (with the same key) in onRequests() or onResponses(); it's reponse may be filled in as with other requests.
array | $reqs | Map of Virtual HTTP request arrays |
Closure | $idGeneratorFunc | Method to generate unique keys for new requests |
Reimplemented from VirtualRESTService.
Definition at line 78 of file ParsoidVirtualRESTService.php.