Zend Framework
1.12
|
Public Member Functions | |
setAuthSubPrivateKeyFile ($file, $passphrase=null, $useIncludePath=false) | |
Sets the PEM formatted private key, as read from a file. | |
setAuthSubPrivateKey ($key, $passphrase=null) | |
Sets the PEM formatted private key to be used for secure AuthSub auth. | |
getAuthSubPrivateKeyId () | |
Gets the openssl private key id. | |
getAuthSubToken () | |
Gets the AuthSub token used for authentication. | |
setAuthSubToken ($token) | |
Sets the AuthSub token used for authentication. | |
getClientLoginToken () | |
Gets the ClientLogin token used for authentication. | |
setClientLoginToken ($token) | |
Sets the ClientLogin token used for authentication. | |
filterHttpRequest ($method, $url, $headers=array(), $body=null, $contentType=null) | |
Filters the HTTP requests being sent to add the Authorization header. | |
filterHttpResponse ($response) | |
Method for filtering the HTTP response, though no filtering is currently done. | |
getAdapter () | |
Return the current connection adapter. | |
setAdapter ($adapter) | |
Load the connection adapter. | |
setStreamingRequest ($value) | |
Set the streamingRequest variable which controls whether we are sending the raw (already encoded) POST data from a stream source. | |
getStreamingRequest () | |
Check whether the client is set to perform streaming requests. | |
resetParameters ($clearAll=false) | |
Clear all custom parameters we set. | |
setRawDataStream ($data, $enctype=null) | |
Set the raw (already encoded) POST data from a stream source. | |
![]() | |
__construct ($uri=null, $config=null) | |
Constructor method. | |
setUri ($uri) | |
Set the URI for the next request. | |
getUri ($as_string=false) | |
Get the URI for the next request. | |
setConfig ($config=array()) | |
Set configuration parameters for this HTTP client. | |
setMethod ($method=self::GET) | |
Set the next request's method. | |
setHeaders ($name, $value=null) | |
Set one or more request headers. | |
getHeader ($key) | |
Get the value of a specific header. | |
setParameterGet ($name, $value=null) | |
Set a GET parameter for the request. | |
setParameterPost ($name, $value=null) | |
Set a POST parameter for the request. | |
getRedirectionsCount () | |
Get the number of redirections done on the last request. | |
setAuth ($user, $password= '', $type=self::AUTH_BASIC) | |
Set HTTP authentication parameters. | |
setCookieJar ($cookiejar=true) | |
Set the HTTP client's cookie jar. | |
getCookieJar () | |
Return the current cookie jar or null if none. | |
setCookie ($cookie, $value=null) | |
Add a cookie to the request. | |
setFileUpload ($filename, $formname, $data=null, $ctype=null) | |
Set a file to upload (using a POST request) | |
setEncType ($enctype=self::ENC_URLENCODED) | |
Set the encoding type for POST data. | |
setRawData ($data, $enctype=null) | |
Set the raw (already encoded) POST data. | |
setUnmaskStatus ($status=true) | |
Set the unmask feature for GET parameters as array. | |
getUnmaskStatus () | |
Returns the currently configured unmask status. | |
resetParameters ($clearAll=false) | |
Clear all GET and POST parameters. | |
getLastRequest () | |
Get the last HTTP request as string. | |
getLastResponse () | |
Get the last HTTP response received by this client. | |
setAdapter ($adapter) | |
Load the connection adapter. | |
getAdapter () | |
Load the connection adapter. | |
setStream ($streamfile=true) | |
Set streaming for received data. | |
getStream () | |
Get status of streaming for received data. | |
request ($method=null) | |
Send the HTTP request and return an HTTP response object. | |
Protected Member Functions | |
_prepareBody () | |
Prepare the request body (for POST and PUT requests) | |
![]() | |
_setParameter ($type, $name, $value) | |
Set a GET or POST parameter - used by SetParameterGet and SetParameterPost. | |
_openTempStream () | |
Create temporary stream. | |
_prepareHeaders () | |
Prepare the request headers. | |
_prepareBody () | |
Prepare the request body (for POST and PUT requests) | |
_getParametersRecursive ($parray, $urlencode=false) | |
Helper method that gets a possibly multi-level parameters array (get or post) and flattens it. | |
_detectFileMimeType ($file) | |
Attempt to detect the MIME type of a file using available extensions. | |
Protected Attributes | |
$_streamingRequest = null | |
![]() | |
$config | |
$adapter = null | |
$uri = null | |
$headers = array() | |
$method = self::GET | |
$paramsGet = array() | |
$paramsPost = array() | |
$enctype = null | |
$raw_post_data = null | |
$auth | |
$files = array() | |
$body_field_order = array() | |
$cookiejar = null | |
$last_request = null | |
$last_response = null | |
$redirectCounter = 0 | |
$_unmaskStatus = false | |
$_queryBracketsEscaped = true | |
Additional Inherited Members | |
![]() | |
static | encodeFormData ($boundary, $name, $value, $filename=null, $headers=array()) |
static | encodeAuthHeader ($user, $password, $type=self::AUTH_BASIC) |
Create a HTTP authentication "Authorization:" header according to the specified user, password and authentication method. | |
![]() | |
const | GET = 'GET' |
HTTP request methods. | |
const | POST = 'POST' |
const | PUT = 'PUT' |
const | HEAD = 'HEAD' |
const | DELETE = 'DELETE' |
const | TRACE = 'TRACE' |
const | OPTIONS = 'OPTIONS' |
const | CONNECT = 'CONNECT' |
const | MERGE = 'MERGE' |
const | PATCH = 'PATCH' |
const | AUTH_BASIC = 'basic' |
Supported HTTP Authentication methods. | |
const | HTTP_1 = '1.1' |
HTTP protocol versions. | |
const | HTTP_0 = '1.0' |
const | CONTENT_TYPE = 'Content-Type' |
Content attributes. | |
const | CONTENT_LENGTH = 'Content-Length' |
const | ENC_URLENCODED = 'application/x-www-form-urlencoded' |
POST data encoding methods. | |
const | ENC_FORMDATA = 'multipart/form-data' |
const | VTYPE_SCALAR = 'SCALAR' |
Value types for Body key/value pairs. | |
const | VTYPE_FILE = 'FILE' |
![]() | |
static | _flattenParametersArray ($parray, $prefix=null) |
Convert an array of parameters into a flat array of (key, value) pairs. | |
![]() | |
static | $_fileInfoDb = null |
|
protected |
Prepare the request body (for POST and PUT requests)
Zend_Http_Client_Exception |
filterHttpRequest | ( | $method, | |
$url, | |||
$headers = array() , |
|||
$body = null , |
|||
$contentType = null |
|||
) |
Filters the HTTP requests being sent to add the Authorization header.
If both AuthSub and ClientLogin tokens are set, AuthSub takes precedence. If an AuthSub key is set, then secure AuthSub authentication is used, and the request is signed. Requests must be signed only with the private key corresponding to the public key registered with Google. If an AuthSub key is set, but openssl support is not enabled in the PHP installation, an exception is thrown.
string | $method | The HTTP method |
string | $url | The URL |
array | $headers | An associate array of headers to be sent with the request or null |
string | $body | The body of the request or null |
string | $contentType | The MIME content type of the body or null |
Zend_Gdata_App_Exception | if there was a signing failure |
filterHttpResponse | ( | $response | ) |
Method for filtering the HTTP response, though no filtering is currently done.
Zend_Http_Response | $response | The response object to filter |
getAdapter | ( | ) |
Return the current connection adapter.
getAuthSubPrivateKeyId | ( | ) |
Gets the openssl private key id.
getAuthSubToken | ( | ) |
Gets the AuthSub token used for authentication.
getClientLoginToken | ( | ) |
Gets the ClientLogin token used for authentication.
getStreamingRequest | ( | ) |
Check whether the client is set to perform streaming requests.
resetParameters | ( | $clearAll = false | ) |
Clear all custom parameters we set.
setAdapter | ( | $adapter | ) |
setAuthSubPrivateKey | ( | $key, | |
$passphrase = null |
|||
) |
Sets the PEM formatted private key to be used for secure AuthSub auth.
In order to call this method, openssl must be enabled in your PHP installation. Otherwise, a Zend_Gdata_App_InvalidArgumentException will be thrown.
string | $key | The private key |
string | $passphrase | The optional private key passphrase |
Zend_Gdata_App_InvalidArgumentException |
setAuthSubPrivateKeyFile | ( | $file, | |
$passphrase = null , |
|||
$useIncludePath = false |
|||
) |
Sets the PEM formatted private key, as read from a file.
This method reads the file and then calls setAuthSubPrivateKey() with the file contents.
string | $file | The location of the file containing the PEM key |
string | $passphrase | The optional private key passphrase |
bool | $useIncludePath | Whether to search the include_path for the file |
setAuthSubToken | ( | $token | ) |
Sets the AuthSub token used for authentication.
string | $token | The token |
setClientLoginToken | ( | $token | ) |
Sets the ClientLogin token used for authentication.
string | $token | The token |
setRawDataStream | ( | $data, | |
$enctype = null |
|||
) |
Set the raw (already encoded) POST data from a stream source.
This is used to support POSTing from open file handles without caching the entire body into memory. It is a wrapper around Zend_Http_Client::setRawData().
string | $data | The request data |
string | $enctype | The encoding type |
setStreamingRequest | ( | $value | ) |
Set the streamingRequest variable which controls whether we are sending the raw (already encoded) POST data from a stream source.
boolean | $value | The value to set. |
|
protected |