API Documentation

Gdata/HttpClient.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Gdata
subpackage
Gdata
version
$Id: HttpClient.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Gdata_HttpClient

Description

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Zend_Gdata_HttpClient

Extends from
Zend_Http_Client
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Gdata
subpackage
Gdata
Properties
$_authSubPrivateKeyId
$_authSubToken
$_clientLoginToken
$_clientLoginKey
$_streamingRequest
Methods
setAuthSubPrivateKeyFile
setAuthSubPrivateKey
getAuthSubPrivateKeyId
getAuthSubToken
setAuthSubToken
getClientLoginToken
setClientLoginToken
filterHttpRequest
filterHttpResponse
getAdapter
setAdapter
setStreamingRequest
getStreamingRequest
_prepareBody
resetParameters
setRawDataStream

Description

Gdata Http Client object.

Class to extend the generic Zend Http Client with the ability to perform secure AuthSub requests

Properties

$_authSubPrivateKeyId

resource $_authSubPrivateKeyId = 'null'

OpenSSL private key resource id This key is used for AuthSub authentication. If this value is set, it is assuemd that secure AuthSub is desired.

Details

$_authSubPrivateKeyId
resource
visibility
private
default
null
final
false
static
false

$_authSubToken

string $_authSubToken = 'null'

Token for AuthSub authentication.

If this token is set, AuthSub authentication is used.

Details

$_authSubToken
string
visibility
private
default
null
final
false
static
false

$_clientLoginKey

string $_clientLoginKey = 'null'

Token for ClientLogin authentication.

If this token is set, and the AuthSub key is not set, ClientLogin authentication is used

Details

$_clientLoginKey
string
visibility
private
default
null
final
false
static
false

$_clientLoginToken

string $_clientLoginToken = 'null'

Token for ClientLogin authentication.

If only this token is set, ClientLogin authentication is used.

Details

$_clientLoginToken
string
visibility
private
default
null
final
false
static
false

$_streamingRequest

bool $_streamingRequest = 'null'

True if this request is being made with data supplied by a stream object instead of a raw encoded string.

Details

$_streamingRequest
bool
visibility
protected
default
null
final
false
static
false

Methods

_prepareBody

_prepareBody( ) : string

Prepare the request body (for POST and PUT requests)

Output
string
Details
visibility
protected
final
false
static
false
throws

filterHttpRequest

filterHttpRequest( string $method, string $url, array $headers = array, string $body = null, string $contentType = null ) : array

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.

Arguments
$method
string
The HTTP method
$url
string
The URL
$headers
array
An associate array of headers to be sent with the request or null
$body
string
The body of the request or null
$contentType
string
The MIME content type of the body or null
Output
array
The processed values in an associative array, using the same names as the params
Details
visibility
public
final
false
static
false
throws
if there was a signing failure

filterHttpResponse

filterHttpResponse( Zend_Http_Response $response ) : Zend_Http_Response

Method for filtering the HTTP response, though no filtering is currently done.

Arguments
$response
Zend_Http_Response
The response object to filter
Output
Zend_Http_Response
The filterd response object
Details
visibility
public
final
false
static
false

getAdapter

getAdapter( ) : Zend_Http_Client_Adapter_Interface|string

Return the current connection adapter

Output
Zend_Http_Client_Adapter_Interface|string
$adapter
Details
visibility
public
final
false
static
false

getAuthSubPrivateKeyId

getAuthSubPrivateKeyId( ) : string

Gets the openssl private key id

Output
string
The private key
Details
visibility
public
final
false
static
false

getAuthSubToken

getAuthSubToken( ) : string

Gets the AuthSub token used for authentication

Output
string
The token
Details
visibility
public
final
false
static
false

getClientLoginToken

getClientLoginToken( ) : string

Gets the ClientLogin token used for authentication

Output
string
The token
Details
visibility
public
final
false
static
false

getStreamingRequest

getStreamingRequest( ) : boolean

Check whether the client is set to perform streaming requests.

Output
boolean
True if yes, false otherwise.
Details
visibility
public
final
false
static
false

resetParameters

resetParameters(  $clearAll = false ) : Zend_Http_Client

Clear all custom parameters we set.

Arguments
$clearAll
Details
visibility
public
final
false
static
false

setAdapter

setAdapter( Zend_Http_Client_Adapter_Interface $adapter ) : void

Load the connection adapter

Arguments
$adapter
Zend_Http_Client_Adapter_Interface
Details
visibility
public
final
false
static
false

setAuthSubPrivateKey

setAuthSubPrivateKey( string $key, string $passphrase = null ) : Zend_Gdata_HttpClient

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.

Arguments
$key
string
The private key
$passphrase
string
The optional private key passphrase
Output
Zend_Gdata_HttpClient
Provides a fluent interface
Details
visibility
public
final
false
static
false
throws

setAuthSubPrivateKeyFile

setAuthSubPrivateKeyFile( string $file, string $passphrase = null, bool $useIncludePath = false ) : void

Sets the PEM formatted private key, as read from a file.

This method reads the file and then calls setAuthSubPrivateKey() with the file contents.

Arguments
$file
string
The location of the file containing the PEM key
$passphrase
string
The optional private key passphrase
$useIncludePath
bool
Whether to search the include_path for the file
Details
visibility
public
final
false
static
false

setAuthSubToken

setAuthSubToken( string $token ) : Zend_Gdata_HttpClient

Sets the AuthSub token used for authentication

Arguments
$token
string
The token
Output
Zend_Gdata_HttpClient
Provides a fluent interface
Details
visibility
public
final
false
static
false

setClientLoginToken

setClientLoginToken( string $token ) : Zend_Gdata_HttpClient

Sets the ClientLogin token used for authentication

Arguments
$token
string
The token
Output
Zend_Gdata_HttpClient
Provides a fluent interface
Details
visibility
public
final
false
static
false

setRawDataStream

setRawDataStream( string $data, string $enctype = null ) : Zend_Http_Client

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().

Arguments
$data
string
The request data
$enctype
string
The encoding type
Details
visibility
public
final
false
static
false

setStreamingRequest

setStreamingRequest( boolean $value ) : void

Set the streamingRequest variable which controls whether we are sending the raw (already encoded) POST data from a stream source.

Arguments
$value
boolean
The value to set.
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.