MediaWiki REL1_30
|
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, $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]+/)*$#' |
Private Member Functions | |
getInstance ( $prefix) | |
Private Attributes | |
MultiHttpClient | $http |
array | $instances = [] |
Map of (prefix => VirtualRESTService|array) | |
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 45 of file VirtualRESTServiceClient.php.
VirtualRESTServiceClient::__construct | ( | MultiHttpClient | $http | ) |
MultiHttpClient | $http |
Definition at line 56 of file VirtualRESTServiceClient.php.
References http.
|
private |
string | $prefix |
Definition at line 304 of file VirtualRESTServiceClient.php.
Referenced by getMountAndService(), and runMulti().
VirtualRESTServiceClient::getMountAndService | ( | $path | ) |
Get the prefix and service that a virtual path is serviced by.
string | $path |
Definition at line 104 of file VirtualRESTServiceClient.php.
References $matches, and getInstance().
Referenced by runMulti().
VirtualRESTServiceClient::mount | ( | $prefix, | |
$instance ) |
Map a prefix to service handler.
If $instance is in array, it must have these keys:
string | $prefix | Virtual path |
VirtualRESTService | array | $instance | Service or info to yield the service |
Definition at line 70 of file VirtualRESTServiceClient.php.
VirtualRESTServiceClient::run | ( | array | $req | ) |
Execute a virtual HTTP(S) request.
This method returns a response map of:
array | $req | Virtual HTTP request maps |
Definition at line 144 of file VirtualRESTServiceClient.php.
References $req, and runMulti().
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:
array | $reqs | Map of Virtual HTTP request maps |
Exception |
Definition at line 166 of file VirtualRESTServiceClient.php.
References $req, getInstance(), getMountAndService(), http, and list.
Referenced by run().
VirtualRESTServiceClient::unmount | ( | $prefix | ) |
Unmap a prefix to service handler.
string | $prefix | Virtual path |
Definition at line 89 of file VirtualRESTServiceClient.php.
|
private |
Definition at line 47 of file VirtualRESTServiceClient.php.
|
private |
Map of (prefix => VirtualRESTService|array)
Definition at line 49 of file VirtualRESTServiceClient.php.
const VirtualRESTServiceClient::VALID_MOUNT_REGEX = '#^/[0-9a-z]+/([0-9a-z]+/)*$#' |
Definition at line 51 of file VirtualRESTServiceClient.php.