MediaWiki
REL1_24
|
Virtual HTTP service client loosely styled after a Virtual File System. More...
Public Member Functions | |
__construct (MultiHttpClient $http) | |
getMountAndService ($path) | |
Get the prefix and service that a virtual path is serviced by. | |
mount ($prefix, VirtualRESTService $instance) | |
Map a prefix to service handler. | |
run (array $req) | |
Execute a virtual HTTP(S) request. | |
runMulti (array $reqs) | |
Execute a set of virtual HTTP(S) requests concurrently. | |
unmount ($prefix) | |
Unmap a prefix to service handler. | |
Public Attributes | |
const | VALID_MOUNT_REGEX = '#^/[0-9a-z]+/([0-9a-z]+/)*$#' |
Protected Attributes | |
MultiHttpClient | $http |
* | |
Array | $instances = array() |
Map of (prefix => VirtualRESTService) *. |
Virtual HTTP service client loosely styled after a Virtual File System.
Services can be mounted on path prefixes so that virtual HTTP operations against sub-paths will map to those services. Operations can actually be done using HTTP messages over the wire or may simple be emulated locally.
Virtual HTTP request maps are arrays that use the following format:
Definition at line 46 of file VirtualRESTServiceClient.php.
MultiHttpClient | $http |
Definition at line 55 of file VirtualRESTServiceClient.php.
Get the prefix and service that a virtual path is serviced by.
string | $path |
Definition at line 94 of file VirtualRESTServiceClient.php.
VirtualRESTServiceClient::mount | ( | $ | prefix, |
VirtualRESTService $ | instance | ||
) |
Map a prefix to service handler.
string | $prefix | Virtual path |
VirtualRESTService | $instance |
Definition at line 65 of file VirtualRESTServiceClient.php.
VirtualRESTServiceClient::run | ( | array $ | req | ) |
Execute a virtual HTTP(S) request.
This method returns a response map of:
list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $client->run( $req );
array | $req | Virtual HTTP request array |
Definition at line 134 of file VirtualRESTServiceClient.php.
VirtualRESTServiceClient::runMulti | ( | array $ | reqs | ) |
Execute a set of virtual HTTP(S) requests concurrently.
A map of requests keys to response maps is returned. Each response map has:
list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $responses[0];
array | $req | Map of Virtual HTTP request arrays |
Definition at line 156 of file VirtualRESTServiceClient.php.
VirtualRESTServiceClient::unmount | ( | $ | prefix | ) |
Unmap a prefix to service handler.
string | $prefix | Virtual path |
Definition at line 79 of file VirtualRESTServiceClient.php.
MultiHttpClient VirtualRESTServiceClient::$http [protected] |
*
Definition at line 47 of file VirtualRESTServiceClient.php.
Array VirtualRESTServiceClient::$instances = array() [protected] |
Map of (prefix => VirtualRESTService) *.
Definition at line 48 of file VirtualRESTServiceClient.php.
const VirtualRESTServiceClient::VALID_MOUNT_REGEX = '#^/[0-9a-z]+/([0-9a-z]+/)*$#' |
Definition at line 50 of file VirtualRESTServiceClient.php.