\Zend_Oauth_Client
- Copyright: Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
- License: http://framework.zend.com/license/new-bsd New BSD License
Synopsis
class Zend_Oauth_Client
extends Zend_Http_Client
{
- // Inherited constants from Zend_Http_Client
- const GET = 'GET';
- 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 AUTH_BASIC = 'basic';
- const HTTP_1 = '1.1';
- const HTTP_0 = '1.0';
- const CONTENT_TYPE = 'Content-Type';
- const CONTENT_LENGTH = 'Content-Length';
- const ENC_URLENCODED = 'application/x-www-form-urlencoded';
- const ENC_FORMDATA = 'multipart/form-data';
- // members
- public static boolean $supportsRevisionA = false;
- protected Zend_Oauth_Config $_config = NULL;
- protected bool $_streamingRequest = NULL;
- // Inherited members from Zend_Http_Client
- protected array $config;
- protected Zend_Http_Client_Adapter_Interface $adapter;
- protected Zend_Uri_Http $uri;
- protected array $headers;
- protected string $method;
- protected array $paramsGet;
- protected array $paramsPost;
- protected $enctype;
- protected $raw_post_data;
- protected array|null $auth;
- protected array $files;
- protected Zend_Http_CookieJar $cookiejar;
- protected $last_request;
- protected Zend_Http_Response $last_response;
- protected integer $redirectCounter;
- protected static $_fileInfoDb;
- // methods
- public void __construct()
- public Zend_Http_Client_Adapter_Interface|string getAdapter()
- public void setAdapter()
- public void setStreamingRequest()
- public boolean getStreamingRequest()
- protected string _prepareBody()
- public Zend_Http_Client resetParameters()
- public Zend_Http_Client setRawDataStream()
- public Zend_Http_Client setMethod()
- public Zend_Http_Response request()
- public void prepareOauth()
- protected string _getSignableParametersAsQueryString()
- public mixed __call()
- // Inherited methods from Zend_Http_Client
- public void __construct()
- public Zend_Http_Client setUri()
- public Zend_Uri_Http|string getUri()
- public Zend_Http_Client setConfig()
- public Zend_Http_Client setMethod()
- public Zend_Http_Client setHeaders()
- public string|array|null getHeader()
- public Zend_Http_Client setParameterGet()
- public Zend_Http_Client setParameterPost()
- protected null _setParameter()
- public int getRedirectionsCount()
- public Zend_Http_Client setAuth()
- public Zend_Http_Client setCookieJar()
- public Zend_Http_CookieJar|null getCookieJar()
- public Zend_Http_Client setCookie()
- public Zend_Http_Client setFileUpload()
- public Zend_Http_Client setEncType()
- public Zend_Http_Client setRawData()
- public Zend_Http_Client resetParameters()
- public string getLastRequest()
- public Zend_Http_Response getLastResponse()
- public null setAdapter()
- public Zend_Http_Client_Adapter_Interface getAdapter()
- public Zend_Http_Client setStream()
- public boolean|string getStream()
- protected resource _openTempStream()
- public Zend_Http_Response request()
- protected array _prepareHeaders()
- protected string _prepareBody()
- protected array _getParametersRecursive()
- protected string _detectFileMimeType()
- public static string encodeFormData()
- public static string encodeAuthHeader()
- protected static array _flattenParametersArray()
Hierarchy
Extends
Constants
Name | Value |
---|---|
GET | 'GET' |
POST | 'POST' |
PUT | 'PUT' |
HEAD | 'HEAD' |
DELETE | 'DELETE' |
TRACE | 'TRACE' |
OPTIONS | 'OPTIONS' |
CONNECT | 'CONNECT' |
MERGE | 'MERGE' |
AUTH_BASIC | 'basic' |
HTTP_1 | '1.1' |
HTTP_0 | '1.0' |
CONTENT_TYPE | 'Content-Type' |
CONTENT_LENGTH | 'Content-Length' |
ENC_URLENCODED | 'application/x-www-form-urlencoded' |
ENC_FORMDATA | 'multipart/form-data' |
Members
protected
- $_config
—
Zend_Oauth_Config
Holds the current OAuth Configuration set encapsulated in an instance of Zend_Oauth_Config; it's not a Zend_Config instance since that level of abstraction is unnecessary and doesn't let me escape the accessors and mutators anyway! - $_fileInfoDb
—
resource
Fileinfo magic database resource - $_streamingRequest
—
bool
True if this request is being made with data supplied by a stream object instead of a raw encoded string. - $adapter
—
Zend_Http_Client_Adapter_Interface
The adapter used to perform the actual connection to the server - $auth
—
array|null
HTTP Authentication settings - $config
—
array
Configuration array, set using the constructor or using ::setConfig() - $enctype
—
string
Request body content type (for POST requests) - $files
—
array
File upload arrays (used in POST requests) - $headers
—
array
Associative array of request headers - $last_request
—
string
The last HTTP request sent by the client, as string - $last_response
—
Zend_Http_Response
The last HTTP response received by the client - $method
—
string
HTTP request method - $paramsGet
—
array
Associative array of GET parameters - $paramsPost
—
array
Associative array of POST parameters - $raw_post_data
—
string
The raw post data to send. Could be set by setRawData($data, $enctype). - $redirectCounter
—
int
Redirection counter - $uri
—
Zend_Uri_Http
Request URI
public
-
$supportsRevisionA
Flag to indicate that the client has detected the server as supporting OAuth 1.0a
Methods
protected
- _getSignableParametersAsQueryString() — Collect all signable parameters into a single array across query string and POST body. These are returned as a properly formatted single query string.
- _prepareBody() — Prepare the request body (for POST and PUT requests)
public
- __construct() — Constructor; creates a new HTTP Client instance which itself is just a typical Zend_Http_Client subclass with some OAuth icing to assist in automating OAuth parameter generation, addition and cryptographioc signing of requests.
- __call() — Simple Proxy to the current Zend_Oauth_Config method. It's that instance which holds all configuration methods and values this object also presents as it's API.
- getAdapter() — Return the current connection adapter
- getStreamingRequest() — Check whether the client is set to perform streaming requests.
- prepareOauth() — Performs OAuth preparation on the request before sending.
- request() — Same as Zend_Http_Client::request() except just before the request is executed, we automatically append any necessary OAuth parameters and sign the request using the relevant signature method.
- resetParameters() — Clear all custom parameters we set.
- setAdapter() — Load the connection adapter
- setMethod() — Same as Zend_Http_Client::setMethod() except it also creates an Oauth specific reference to the method type.
- setRawDataStream() — Set the raw (already encoded) POST data from a stream source.
- setStreamingRequest() — Set the streamingRequest variable which controls whether we are sending the raw (already encoded) POST data from a stream source.
Inherited from Zend_Http_Client
protected
- _detectFileMimeType() — Attempt to detect the MIME type of a file using available extensions
- _flattenParametersArray() — Convert an array of parameters into a flat array of (key, value) pairs
- _getParametersRecursive() — Helper method that gets a possibly multi-level parameters array (get or post) and flattens it.
- _openTempStream() — Create temporary stream
- _prepareBody() — Prepare the request body (for POST and PUT requests)
- _prepareHeaders() — Prepare the request headers
- _setParameter() — Set a GET or POST parameter - used by SetParameterGet and SetParameterPost
public
- encodeAuthHeader() — Create a HTTP authentication "Authorization:" header according to the specified user, password and authentication method.
- encodeFormData() — Encode data to a multipart/form-data part suitable for a POST request.
- getAdapter() — Load the connection adapter
- getCookieJar() — Return the current cookie jar or null if none.
- getHeader() — Get the value of a specific header
- getLastRequest() — Get the last HTTP request as string
- getLastResponse() — Get the last HTTP response received by this client
- getRedirectionsCount() — Get the number of redirections done on the last request
- getStream() — Get status of streaming for received data
- getUri() — Get the URI for the next request
- request() — Send the HTTP request and return an HTTP response object
- resetParameters() — Clear all GET and POST parameters
- setAdapter() — Load the connection adapter
- setAuth() — Set HTTP authentication parameters
- setConfig() — Set configuration parameters for this HTTP client
- setCookie() — Add a cookie to the request. If the client has no Cookie Jar, the cookies will be added directly to the headers array as "Cookie" headers.
- setCookieJar() — Set the HTTP client's cookie jar.
- setEncType() — Set the encoding type for POST data
- setFileUpload() — Set a file to upload (using a POST request)
- setHeaders() — Set one or more request headers
- setMethod() — Set the next request's method
- setParameterGet() — Set a GET parameter for the request. Wrapper around _setParameter
- setParameterPost() — Set a POST parameter for the request. Wrapper around _setParameter
- setRawData() — Set the raw (already encoded) POST data.
- setStream() — Set streaming for received data
- setUri() — Set the URI for the next request