TYPO3
7.6
|
Public Member Functions | |
sendRequest (HTTP_Request2 $request) | |
Public Member Functions inherited from HTTP_Request2_Adapter | |
sendRequest (HTTP_Request2 $request) | |
Public Attributes | |
const | REGEXP_TOKEN = '[^\x00-\x1f\x7f-\xff()<>@,;:\\\\"/\[\]?={}\s]+' |
const | REGEXP_QUOTED_STRING = '"(?>[^"\\\\]+|\\\\.)*"' |
Protected Member Functions | |
connect () | |
establishTunnel () | |
canKeepAlive ($requestKeepAlive, HTTP_Request2_Response $response) | |
disconnect () | |
handleRedirect (HTTP_Request2 $request, HTTP_Request2_Response $response) | |
shouldUseServerDigestAuth (HTTP_Request2_Response $response) | |
shouldUseProxyDigestAuth (HTTP_Request2_Response $response) | |
parseDigestChallenge ($headerValue) | |
updateChallenge (&$challenge, $headerValue) | |
createDigestResponse ($user, $password, $url, &$challenge) | |
addAuthorizationHeader (&$headers, $requestHost, $requestUrl) | |
addProxyAuthorizationHeader (&$headers, $requestUrl) | |
prepareHeaders () | |
updateExpectHeader (&$headers) | |
writeBody () | |
readResponse () | |
readChunked ($bufferSize) | |
Protected Member Functions inherited from HTTP_Request2_Adapter | |
calculateRequestLength (&$headers) | |
Protected Attributes | |
$socket | |
$serverChallenge | |
$proxyChallenge | |
$chunkLength = 0 | |
$redirectCountdown = null | |
$expect100Continue = false | |
Protected Attributes inherited from HTTP_Request2_Adapter | |
$request | |
$requestBody | |
$contentLength | |
Static Protected Attributes | |
static | $sockets = array() |
static | $challenges = array() |
Static Protected Attributes inherited from HTTP_Request2_Adapter | |
static | $bodyDisallowed = array('TRACE') |
static | $bodyRequired = array('POST', 'PUT') |
Definition at line 40 of file Socket.php.
|
protected |
Adds 'Authorization' header (if needed) to request headers array
array | &$headers | request headers |
string | $requestHost | request host (needed for digest authentication) |
string | $requestUrl | request URL (needed for digest authentication) |
HTTP_Request2_NotImplementedException |
Definition at line 729 of file Socket.php.
References HTTP_Request2\AUTH_BASIC, HTTP_Request2\AUTH_DIGEST, and createDigestResponse().
Referenced by prepareHeaders().
|
protected |
Adds 'Proxy-Authorization' header (if needed) to request headers array
array | &$headers | request headers |
string | $requestUrl | request URL (needed for digest authentication) |
HTTP_Request2_NotImplementedException |
Definition at line 774 of file Socket.php.
References HTTP_Request2\AUTH_BASIC, HTTP_Request2\AUTH_DIGEST, createDigestResponse(), and HTTP_Request2\METHOD_CONNECT.
Referenced by prepareHeaders().
|
protected |
Checks whether current connection may be reused or should be closed
boolean | $requestKeepAlive | whether connection could be persistent in the first place |
HTTP_Request2_Response | $response | response object to check |
Definition at line 372 of file Socket.php.
References HTTP_Request2_Response\getHeader(), HTTP_Request2_Response\getStatus(), HTTP_Request2_Response\getVersion(), HTTP_Request2\METHOD_CONNECT, and HTTP_Request2\METHOD_HEAD.
Referenced by sendRequest().
|
protected |
Connects to the remote server
HTTP_Request2_Exception |
Definition at line 195 of file Socket.php.
References $socket, elseif, establishTunnel(), HTTP_Request2\METHOD_CONNECT, HTTP_Request2_Exception\MISCONFIGURATION, HTTP_Request2_Exception\MISSING_VALUE, and HTTP_Request2_SocketWrapper\setDeadline().
Referenced by sendRequest().
|
protected |
Creates a value for [Proxy-]Authorization header when using digest authentication
string | $user | user name |
string | $password | password |
string | $url | request URL |
array | &$challenge | digest challenge parameters |
Definition at line 683 of file Socket.php.
References $url.
Referenced by addAuthorizationHeader(), and addProxyAuthorizationHeader().
|
protected |
Disconnects from the remote server
Definition at line 395 of file Socket.php.
Referenced by sendRequest().
|
protected |
Establishes a tunnel to a secure remote server via HTTP CONNECT request
This method will fail if 'ssl_verify_peer' is enabled. Probably because PHP sees that we are connected to a proxy server (duh!) rather than the server that presents its certificate.
Definition at line 344 of file Socket.php.
References $response, and HTTP_Request2\METHOD_CONNECT.
Referenced by connect().
|
protected |
Handles HTTP redirection
This method will throw an Exception if redirect to a non-HTTP(S) location is attempted, also if number of redirects performed already is equal to 'max_redirects' configuration parameter.
HTTP_Request2 | $request | Original request |
HTTP_Request2_Response | $response | Response containing redirect |
HTTP_Request2_Exception |
Definition at line 416 of file Socket.php.
References HTTP_Request2_Adapter\$request, HTTP_Request2\getConfig(), HTTP_Request2_Response\getHeader(), HTTP_Request2_Response\getStatus(), HTTP_Request2\getUrl(), HTTP_Request2\METHOD_GET, HTTP_Request2_Exception\NON_HTTP_REDIRECT, Net_URL2\OPTION_USE_BRACKETS, sendRequest(), and HTTP_Request2_Exception\TOO_MANY_REDIRECTS.
Referenced by sendRequest().
|
protected |
Extracts digest method challenge from (WWW|Proxy)-Authenticate header value
There is a problem with implementation of RFC 2617: several of the parameters are defined as quoted-string there and thus may contain backslash escaped double quotes (RFC 2616, section 2.2). However, RFC 2617 defines unq(X) as just value of quoted-string X without surrounding quotes, it doesn't speak about removing backslash escaping.
Now realm parameter is user-defined and human-readable, strange things happen when it contains quotes:
HTTP_Request2 follows IE and Firefox (and hopefully RFC 2617) in quoted-string handling, unfortunately that means failure to authorize sometimes
string | $headerValue | value of WWW-Authenticate or Proxy-Authenticate header |
HTTP_Request2_NotImplementedException | in case of unsupported challenge parameters |
Definition at line 600 of file Socket.php.
Referenced by shouldUseProxyDigestAuth(), and shouldUseServerDigestAuth().
|
protected |
Creates the string with the Request-Line and request headers
HTTP_Request2_Exception |
Definition at line 820 of file Socket.php.
References $url, addAuthorizationHeader(), addProxyAuthorizationHeader(), HTTP_Request2_Adapter\calculateRequestLength(), HTTP_Request2\METHOD_CONNECT, and updateExpectHeader().
Referenced by sendRequest().
|
protected |
Reads a part of response body encoded with chunked Transfer-Encoding
int | $bufferSize | buffer size to use for reading |
HTTP_Request2_MessageException |
Definition at line 1093 of file Socket.php.
References HTTP_Request2_Exception\DECODE_ERROR.
Referenced by readResponse().
|
protected |
Reads the remote server's response
HTTP_Request2_Exception |
Definition at line 1002 of file Socket.php.
References $expect100Continue, $response, elseif, HTTP_Request2\METHOD_CONNECT, HTTP_Request2\METHOD_HEAD, readChunked(), and HTTP_Request2_Exception\TIMEOUT.
Referenced by sendRequest().
sendRequest | ( | HTTP_Request2 | $request | ) |
Sends request to the remote server and returns its response
HTTP_Request2 | $request | HTTP request message |
HTTP_Request2_Exception |
Definition at line 123 of file Socket.php.
References HTTP_Request2_Adapter\$request, $response, canKeepAlive(), connect(), disconnect(), HTTP_Request2\getConfig(), HTTP_Request2\getCookieJar(), HTTP_Request2\getUrl(), handleRedirect(), prepareHeaders(), readResponse(), shouldUseProxyDigestAuth(), shouldUseServerDigestAuth(), updateChallenge(), and writeBody().
Referenced by handleRedirect().
|
protected |
Checks whether another request should be performed with proxy digest auth
Several conditions should be satisfied for it to return true:
The method stores challenge values in $challenges static property
HTTP_Request2_Response | $response | response to check |
HTTP_Request2_Exception | in case of unsupported challenge parameters |
Definition at line 548 of file Socket.php.
References HTTP_Request2_Response\getHeader(), HTTP_Request2_Response\getStatus(), and parseDigestChallenge().
Referenced by sendRequest().
|
protected |
Checks whether another request should be performed with server digest auth
Several conditions should be satisfied for it to return true:
The method stores challenge values in $challenges static property
HTTP_Request2_Response | $response | response to check |
HTTP_Request2_Exception | in case of unsupported challenge parameters |
Definition at line 483 of file Socket.php.
References $url, HTTP_Request2_Response\getHeader(), HTTP_Request2_Response\getStatus(), and parseDigestChallenge().
Referenced by sendRequest().
|
protected |
Parses [Proxy-]Authentication-Info header value and updates challenge
array | &$challenge | challenge to update |
string | $headerValue | value of [Proxy-]Authentication-Info header |
Definition at line 651 of file Socket.php.
Referenced by sendRequest().
|
protected |
Adds or removes 'Expect: 100-continue' header from request headers
Also sets the $expect100Continue property. Parsing of existing header is somewhat needed due to its complex structure and due to the requirement in section 8.2.3 of RFC 2616:
A client MUST NOT send an Expect request-header field (section 14.20) with the "100-continue" expectation if it does not intend to send a request body.
array | &$headers | Array of headers prepared for the request |
Definition at line 898 of file Socket.php.
References elseif, and HTTP_Request2_Exception\INVALID_ARGUMENT.
Referenced by prepareHeaders().
|
protected |
Sends the request body
HTTP_Request2_MessageException |
Definition at line 959 of file Socket.php.
References elseif.
Referenced by sendRequest().
|
staticprotected |
Definition at line 71 of file Socket.php.
|
protected |
Definition at line 97 of file Socket.php.
|
protected |
Definition at line 113 of file Socket.php.
Referenced by readResponse().
|
protected |
Definition at line 90 of file Socket.php.
|
protected |
Definition at line 107 of file Socket.php.
|
protected |
Definition at line 84 of file Socket.php.
|
protected |
Definition at line 78 of file Socket.php.
Referenced by connect().
|
staticprotected |
Definition at line 57 of file Socket.php.
const REGEXP_QUOTED_STRING = '"(?>[^"\\\\]+|\\\\.)*"' |
Regular expression for 'quoted-string' rule from RFC 2616
Definition at line 50 of file Socket.php.
const REGEXP_TOKEN = '[^\x00-\x1f\x7f-\xff()<>@,;:\\\\"/\[\]?={}\s]+' |
Regular expression for 'token' rule from RFC 2616
Definition at line 45 of file Socket.php.