[ Index ] |
PHP Cross Reference of MediaWiki-1.24.0 |
[Source view] [Print] [Project Stats]
Virtual HTTP service client 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.
File Size: | 289 lines (11 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
VirtualRESTServiceClient:: (6 methods):
__construct()
mount()
unmount()
getMountAndService()
run()
runMulti()
Class: VirtualRESTServiceClient - X-Ref
Virtual HTTP service client loosely styled after a Virtual File System__construct( MultiHttpClient $http ) X-Ref |
param: MultiHttpClient $http |
mount( $prefix, VirtualRESTService $instance ) X-Ref |
Map a prefix to service handler param: string $prefix Virtual path param: VirtualRESTService $instance |
unmount( $prefix ) X-Ref |
Unmap a prefix to service handler param: string $prefix Virtual path |
getMountAndService( $path ) X-Ref |
Get the prefix and service that a virtual path is serviced by param: string $path return: array (prefix,VirtualRESTService) or (null,null) if none found |
run( array $req ) X-Ref |
Execute a virtual HTTP(S) request This method returns a response map of: - code : HTTP response code or 0 if there was a serious cURL error - reason : HTTP response reason (empty if there was a serious cURL error) - headers : <header name/value associative array> - body : HTTP response body or resource (if "stream" was set) - err : Any cURL error string The map also stores integer-indexed copies of these values. This lets callers do: <code> list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $client->run( $req ); </code> param: array $req Virtual HTTP request array return: array Response array for request |
runMulti( array $reqs ) X-Ref |
Execute a set of virtual HTTP(S) requests concurrently A map of requests keys to response maps is returned. Each response map has: - code : HTTP response code or 0 if there was a serious cURL error - reason : HTTP response reason (empty if there was a serious cURL error) - headers : <header name/value associative array> - body : HTTP response body or resource (if "stream" was set) - err : Any cURL error string The map also stores integer-indexed copies of these values. This lets callers do: <code> list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $responses[0]; </code> param: array $req Map of Virtual HTTP request arrays return: array $reqs Map of corresponding response values with the same keys/order |
Generated: Fri Nov 28 14:03:12 2014 | Cross-referenced by PHPXref 0.7.1 |