ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
|
This class implements common methods for ProxiedService implementations included with phpCAS. More...
Public Member Functions | |
__construct (CAS_Request_RequestInterface $requestHandler, CAS_CookieJar $cookieJar) | |
Constructor. More... | |
getServiceUrl () | |
Answer a service identifier (URL) for whom we should fetch a proxy ticket. More... | |
setUrl ($url) | |
Set the URL of the Request. More... | |
send () | |
Perform the request. More... | |
getResponseHeaders () | |
Answer the headers of the response. More... | |
getResponseStatusCode () | |
Answer HTTP status code of the response. More... | |
getResponseBody () | |
Answer the body of response. More... | |
getCookies () | |
Answer the cookies from the response. More... | |
Public Member Functions inherited from CAS_ProxiedService_Abstract | |
setProxyTicket ($proxyTicket) | |
Register a proxy ticket with the Proxy that it can use when making requests. More... | |
setCasClient (CAS_Client $casClient) | |
Use a particular CAS_Client->initializeProxiedService() rather than the static phpCAS::initializeProxiedService(). More... | |
Public Member Functions inherited from CAS_ProxiedService | |
getServiceUrl () | |
Answer a service identifier (URL) for whom we should fetch a proxy ticket. More... | |
setProxyTicket ($proxyTicket) | |
Register a proxy ticket with the ProxiedService that it can use when making requests. More... | |
Public Member Functions inherited from CAS_ProxiedService_Http | |
setUrl ($url) | |
Set the URL of the Request. More... | |
send () | |
Perform the request. More... | |
getResponseHeaders () | |
Answer the headers of the response. More... | |
getResponseBody () | |
Answer the body of response. More... | |
Protected Member Functions | |
makeRequest ($url) | |
Build and perform a request, following redirects. More... | |
populateRequest (CAS_Request_RequestInterface $request) | |
Add any other parts of the request needed by concrete classes. More... | |
getRedirectUrl (array $responseHeaders) | |
Answer a redirect URL if a redirect header is found, otherwise null. More... | |
hasBeenSent () | |
Answer true if our request has been sent yet. More... | |
Protected Member Functions inherited from CAS_ProxiedService_Abstract | |
getProxyTicket () | |
Answer the proxy ticket to be used when making requests. More... | |
initializeProxyTicket () | |
Fetch our proxy ticket. More... | |
Protected Attributes | |
$requestHandler | |
The HTTP request mechanism talking to the target service. More... | |
Private Attributes | |
$_cookieJar | |
The storage mechanism for cookies set by the target service. More... | |
$_url | |
The target service url. More... | |
$_numRequests = 0 | |
Indicator of the number of requests (including redirects performed. More... | |
$_responseHeaders = array() | |
The response headers. More... | |
$_responseStatusCode = '' | |
The response status code. More... | |
$_responseBody = '' | |
The response headers. More... | |
This class implements common methods for ProxiedService implementations included with phpCAS.
Definition at line 41 of file Abstract.php.
CAS_ProxiedService_Http_Abstract::__construct | ( | CAS_Request_RequestInterface | $requestHandler, |
CAS_CookieJar | $cookieJar | ||
) |
Constructor.
CAS_Request_RequestInterface | $requestHandler | request handler object |
CAS_CookieJar | $cookieJar | cookieJar object |
Definition at line 66 of file Abstract.php.
References $requestHandler.
CAS_ProxiedService_Http_Abstract::getCookies | ( | ) |
Answer the cookies from the response.
This may include cookies set during redirect responses.
Definition at line 354 of file Abstract.php.
|
protected |
Answer a redirect URL if a redirect header is found, otherwise null.
array | $responseHeaders | response header to extract a redirect from |
Definition at line 271 of file Abstract.php.
CAS_ProxiedService_Http_Abstract::getResponseBody | ( | ) |
Answer the body of response.
CAS_OutOfSequenceException | If called before the Request has been sent. |
Definition at line 337 of file Abstract.php.
CAS_ProxiedService_Http_Abstract::getResponseHeaders | ( | ) |
Answer the headers of the response.
CAS_OutOfSequenceException | If called before the Request has been sent. |
Definition at line 303 of file Abstract.php.
CAS_ProxiedService_Http_Abstract::getResponseStatusCode | ( | ) |
Answer HTTP status code of the response.
CAS_OutOfSequenceException | If called before the Request has been sent. |
Definition at line 320 of file Abstract.php.
CAS_ProxiedService_Http_Abstract::getServiceUrl | ( | ) |
Answer a service identifier (URL) for whom we should fetch a proxy ticket.
Exception | If no service url is available. |
Definition at line 85 of file Abstract.php.
References $_url.
Referenced by send().
|
protected |
Answer true if our request has been sent yet.
Definition at line 292 of file Abstract.php.
Referenced by send(), CAS_ProxiedService_Http_Post\setBody(), CAS_ProxiedService_Http_Post\setContentType(), and setUrl().
|
protected |
Build and perform a request, following redirects.
string | $url | url for the request |
CAS_ProxyTicketException | If there is a proxy-ticket failure. The code of the Exception will be one of: PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE PHPCAS_SERVICE_PT_FAILURE |
CAS_ProxiedService_Exception | If there is a failure sending the request to the target service. |
Definition at line 208 of file Abstract.php.
References $requestHandler, $url, populateRequest(), and phpCAS\trace().
Referenced by send().
|
abstractprotected |
Add any other parts of the request needed by concrete classes.
CAS_Request_RequestInterface | $request | request interface object |
Referenced by makeRequest().
CAS_ProxiedService_Http_Abstract::send | ( | ) |
Perform the request.
CAS_OutOfSequenceException | If called multiple times. |
CAS_ProxyTicketException | If there is a proxy-ticket failure. The code of the Exception will be one of: PHPCAS_SERVICE_PT_NO_SERVER_RESPONSE PHPCAS_SERVICE_PT_BAD_SERVER_RESPONSE PHPCAS_SERVICE_PT_FAILURE |
CAS_ProxiedService_Exception | If there is a failure sending the request to the target service. |
Definition at line 139 of file Abstract.php.
References $url, CAS_ProxiedService_Abstract\getProxyTicket(), getServiceUrl(), hasBeenSent(), CAS_ProxiedService_Abstract\initializeProxyTicket(), makeRequest(), phpCAS\traceBegin(), and phpCAS\traceEnd().
CAS_ProxiedService_Http_Abstract::setUrl | ( | $url | ) |
Set the URL of the Request.
string | $url | url to set |
CAS_OutOfSequenceException | If called after the Request has been sent. |
Definition at line 108 of file Abstract.php.
References $url, and hasBeenSent().
|
private |
The storage mechanism for cookies set by the target service.
Definition at line 56 of file Abstract.php.
|
private |
Indicator of the number of requests (including redirects performed.
Definition at line 171 of file Abstract.php.
|
private |
The response headers.
Definition at line 192 of file Abstract.php.
The response headers.
Definition at line 178 of file Abstract.php.
|
private |
The response status code.
Definition at line 185 of file Abstract.php.
|
private |
|
protected |
The HTTP request mechanism talking to the target service.
Definition at line 49 of file Abstract.php.
Referenced by __construct(), and makeRequest().