Public Member Functions | |
setUrl ($url) | |
addCookie ($name, $value) | |
addCookies (array $cookies) | |
addHeader ($header) | |
addHeaders (array $headers) | |
makePost () | |
setPostBody ($body) | |
setSslCaCert ($caCertPath) | |
send () | |
getResponseHeaders () | |
getResponseBody () | |
getErrorMessage () | |
Protected Member Functions | |
_sendRequest () | |
storeResponseHeaders (array $headers) | |
storeResponseHeader ($header) | |
storeResponseBody ($body) | |
storeErrorMessage ($message) | |
Protected Attributes | |
$url = null | |
$cookies = array() | |
$headers = array() | |
$isPost = FALSE | |
$postBody = null | |
$caCertPath = null | |
Private Attributes | |
$sent = FALSE | |
$responseHeaders = array() | |
$responseBody = null | |
$errorMessage = '' |
Provides support for performing web-requests via curl
Definition at line 36 of file AbstractRequest.php.
CAS_AbstractRequest::_sendRequest | ( | ) | [abstract, protected] |
Send the request and store the results.
Referenced by send().
CAS_AbstractRequest::addCookie | ( | $ | name, | |
$ | value | |||
) |
Add a cookie to the request.
string | $name | |
string | $value |
CAS_OutOfSequenceException | If called after the Request has been sent. |
Implements CAS_RequestInterface.
Definition at line 77 of file AbstractRequest.php.
CAS_AbstractRequest::addCookies | ( | array $ | cookies | ) |
Add an array of cookies to the request. The cookie array is of the form array('cookie_name' => 'cookie_value', 'cookie_name2' => cookie_value2')
array | $cookies |
CAS_OutOfSequenceException | If called after the Request has been sent. |
Implements CAS_RequestInterface.
Definition at line 93 of file AbstractRequest.php.
CAS_AbstractRequest::addHeader | ( | $ | header | ) |
Add a header string to the request.
string | $header |
CAS_OutOfSequenceException | If called after the Request has been sent. |
Implements CAS_RequestInterface.
Definition at line 107 of file AbstractRequest.php.
CAS_AbstractRequest::addHeaders | ( | array $ | headers | ) |
Add an array of header strings to the request.
array | $headers |
CAS_OutOfSequenceException | If called after the Request has been sent. |
Implements CAS_RequestInterface.
Definition at line 121 of file AbstractRequest.php.
CAS_AbstractRequest::getErrorMessage | ( | ) |
Answer a message describing any errors if the request failed.
CAS_OutOfSequenceException | If called before the Request has been sent. |
Implements CAS_RequestInterface.
Definition at line 274 of file AbstractRequest.php.
CAS_AbstractRequest::getResponseBody | ( | ) |
Answer the body of response.
CAS_OutOfSequenceException | If called before the Request has been sent. |
Implements CAS_RequestInterface.
Definition at line 261 of file AbstractRequest.php.
CAS_AbstractRequest::getResponseHeaders | ( | ) |
Answer the headers of the response.
CAS_OutOfSequenceException | If called before the Request has been sent. |
Implements CAS_RequestInterface.
Definition at line 248 of file AbstractRequest.php.
CAS_AbstractRequest::makePost | ( | ) |
Make the request a POST request rather than the default GET request.
CAS_OutOfSequenceException | If called after the Request has been sent. |
Implements CAS_RequestInterface.
Definition at line 134 of file AbstractRequest.php.
CAS_AbstractRequest::send | ( | ) |
Perform the request.
CAS_OutOfSequenceException | If called multiple times. |
Implements CAS_RequestInterface.
Definition at line 181 of file AbstractRequest.php.
References _sendRequest().
CAS_AbstractRequest::setPostBody | ( | $ | body | ) |
Add a POST body to the request
string | $body |
CAS_OutOfSequenceException | If called after the Request has been sent. |
Implements CAS_RequestInterface.
Definition at line 148 of file AbstractRequest.php.
CAS_AbstractRequest::setSslCaCert | ( | $ | caCertPath | ) |
Specify the path to an SSL CA certificate to validate the server with.
string | $sslCertPath |
CAS_OutOfSequenceException | If called after the Request has been sent. |
Implements CAS_RequestInterface.
Definition at line 164 of file AbstractRequest.php.
References $caCertPath.
CAS_AbstractRequest::setUrl | ( | $ | url | ) |
Set the URL of the Request
string | $url |
CAS_OutOfSequenceException | If called after the Request has been sent. |
Implements CAS_RequestInterface.
Definition at line 62 of file AbstractRequest.php.
References $url.
CAS_AbstractRequest::storeErrorMessage | ( | $ | message | ) | [protected] |
Add a string to our error message.
string | $message |
Definition at line 234 of file AbstractRequest.php.
Referenced by CAS_CurlRequest::_sendRequest().
CAS_AbstractRequest::storeResponseBody | ( | $ | body | ) | [protected] |
Store the response body.
string | $body |
Definition at line 224 of file AbstractRequest.php.
Referenced by CAS_CurlRequest::_sendRequest().
CAS_AbstractRequest::storeResponseHeader | ( | $ | header | ) | [protected] |
Store a single response header to our array.
string | $header |
Definition at line 214 of file AbstractRequest.php.
Referenced by CAS_CurlRequest::_curlReadHeaders().
CAS_AbstractRequest::storeResponseHeaders | ( | array $ | headers | ) | [protected] |
Store the response headers.
array | $headers |
Definition at line 204 of file AbstractRequest.php.
CAS_AbstractRequest::$caCertPath = null [protected] |
Definition at line 45 of file AbstractRequest.php.
Referenced by setSslCaCert().
CAS_AbstractRequest::$cookies = array() [protected] |
Definition at line 41 of file AbstractRequest.php.
CAS_AbstractRequest::$errorMessage = '' [private] |
Definition at line 49 of file AbstractRequest.php.
CAS_AbstractRequest::$headers = array() [protected] |
Definition at line 42 of file AbstractRequest.php.
CAS_AbstractRequest::$isPost = FALSE [protected] |
Definition at line 43 of file AbstractRequest.php.
CAS_AbstractRequest::$postBody = null [protected] |
Definition at line 44 of file AbstractRequest.php.
CAS_AbstractRequest::$responseBody = null [private] |
Definition at line 48 of file AbstractRequest.php.
CAS_AbstractRequest::$responseHeaders = array() [private] |
Definition at line 47 of file AbstractRequest.php.
CAS_AbstractRequest::$sent = FALSE [private] |
Definition at line 46 of file AbstractRequest.php.
CAS_AbstractRequest::$url = null [protected] |
Definition at line 40 of file AbstractRequest.php.
Referenced by setUrl().