MediaWiki REL1_41
|
Example virtual rest service for OpenStack Swift. More...
Inherits VirtualRESTService.
Public Member Functions | |||||||
__construct (array $params) | |||||||
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:
| |||||||
onResponses (array $reqs, Closure $idGeneratorFunc) | |||||||
Mangle or replace virtual HTTP(S) requests which have been responded to. | |||||||
Public Member Functions inherited from VirtualRESTService | |||||||
getName () | |||||||
Return the name of this service, in a form suitable for error reporting or debugging. | |||||||
Protected Member Functions | |
applyAuthResponse (array $req) | |
needsAuthRequest () | |
Protected Attributes | |
string null | $authCachedReason = null |
int null | $authCachedStatus = null |
array | $authCreds |
int null | $authErrorTimestamp = null |
UNIX timestamp. | |
int | $authSessionTimestamp = 0 |
UNIX timestamp. | |
Protected Attributes inherited from VirtualRESTService | |
array | $params = [] |
Key/value map. | |
Example virtual rest service for OpenStack Swift.
Definition at line 29 of file SwiftVirtualRESTService.php.
SwiftVirtualRESTService::__construct | ( | array | $params | ) |
array | $params | Key/value map
|
Reimplemented from VirtualRESTService.
Definition at line 48 of file SwiftVirtualRESTService.php.
References VirtualRESTService\$params, and wfDeprecated().
|
protected |
Definition at line 75 of file SwiftVirtualRESTService.php.
Referenced by onResponses().
|
protected |
Definition at line 60 of file SwiftVirtualRESTService.php.
References $authCachedStatus.
Referenced by onRequests().
SwiftVirtualRESTService::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:
array[] | $reqs | Map of Virtual HTTP request arrays |
Closure | $idGeneratorFunc | Method to generate unique keys for new requests |
Reimplemented from VirtualRESTService.
Definition at line 102 of file SwiftVirtualRESTService.php.
References $authCachedReason, $authCachedStatus, and needsAuthRequest().
Referenced by onResponses().
SwiftVirtualRESTService::onResponses | ( | array | $reqs, |
Closure | $idGeneratorFunc ) |
Mangle or replace virtual HTTP(S) requests which have been responded to.
This method may mangle any of the $reqs entry 'response' fields as needed:
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(); its response may be filled in as with other requests. All requests added to $reqs will be passed through onRequests() to handle any munging required as normal.
The incoming URL parameter will be relative to the service mount point.
array | $reqs | Map of Virtual HTTP request arrays with 'response' set |
Closure | $idGeneratorFunc | Method to generate unique keys for new requests |
Reimplemented from VirtualRESTService.
Definition at line 157 of file SwiftVirtualRESTService.php.
References $authCachedReason, $authCachedStatus, applyAuthResponse(), and onRequests().
|
protected |
Definition at line 39 of file SwiftVirtualRESTService.php.
Referenced by onRequests(), and onResponses().
|
protected |
Definition at line 37 of file SwiftVirtualRESTService.php.
Referenced by needsAuthRequest(), onRequests(), and onResponses().
|
protected |
Definition at line 31 of file SwiftVirtualRESTService.php.
|
protected |
UNIX timestamp.
Definition at line 35 of file SwiftVirtualRESTService.php.
|
protected |
UNIX timestamp.
Definition at line 33 of file SwiftVirtualRESTService.php.