PHP 클래스 Zend_Gdata_HttpClient

Class to extend the generic Zend Http Client with the ability to perform secure AuthSub requests
상속: extends Zend_Http_Client
파일 보기 프로젝트 열기: kimai/kimai 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_streamingRequest boolean True if this request is being made with data supplied by a stream object instead of a raw encoded string.

공개 메소드들

메소드 설명
filterHttpRequest ( string $method, string $url, array $headers = [], string $body = null, string $contentType = null ) : array Filters the HTTP requests being sent to add the Authorization header.
filterHttpResponse ( Zend_Http_Response $response ) : Zend_Http_Response Method for filtering the HTTP response, though no filtering is currently done.
getAdapter ( ) : Zend_Http_Client_Adapter_Interface | string Return the current connection adapter
getAuthSubPrivateKeyId ( ) : string Gets the openssl private key id
getAuthSubToken ( ) : string Gets the AuthSub token used for authentication
getClientLoginToken ( ) : string Gets the ClientLogin token used for authentication
getStreamingRequest ( ) : boolean Check whether the client is set to perform streaming requests.
resetParameters ( $clearAll = false ) : Zend_Http_Client Clear all custom parameters we set.
setAdapter ( Zend_Http_Client_Adapter_Interface $adapter ) : void Load the connection adapter
setAuthSubPrivateKey ( string $key, string $passphrase = null ) : Zend_Gdata_HttpClient Sets the PEM formatted private key to be used for secure AuthSub auth.
setAuthSubPrivateKeyFile ( string $file, string $passphrase = null, boolean $useIncludePath = false ) : void Sets the PEM formatted private key, as read from a file.
setAuthSubToken ( string $token ) : Zend_Gdata_HttpClient Sets the AuthSub token used for authentication
setClientLoginToken ( string $token ) : Zend_Gdata_HttpClient Sets the ClientLogin token used for authentication
setRawDataStream ( string $data, string $enctype = null ) : Zend_Http_Client Set the raw (already encoded) POST data from a stream source.
setStreamingRequest ( boolean $value ) : void Set the streamingRequest variable which controls whether we are sending the raw (already encoded) POST data from a stream source.

보호된 메소드들

메소드 설명
_prepareBody ( ) : string Prepare the request body (for POST and PUT requests)

메소드 상세

_prepareBody() 보호된 메소드

Prepare the request body (for POST and PUT requests)
protected _prepareBody ( ) : string
리턴 string

filterHttpRequest() 공개 메소드

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.
public filterHttpRequest ( string $method, string $url, array $headers = [], string $body = null, string $contentType = null ) : array
$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
리턴 array The processed values in an associative array, using the same names as the params

filterHttpResponse() 공개 메소드

Method for filtering the HTTP response, though no filtering is currently done.
public filterHttpResponse ( Zend_Http_Response $response ) : Zend_Http_Response
$response Zend_Http_Response The response object to filter
리턴 Zend_Http_Response The filterd response object

getAdapter() 공개 메소드

Return the current connection adapter
public getAdapter ( ) : Zend_Http_Client_Adapter_Interface | string
리턴 Zend_Http_Client_Adapter_Interface | string $adapter

getAuthSubPrivateKeyId() 공개 메소드

Gets the openssl private key id
public getAuthSubPrivateKeyId ( ) : string
리턴 string The private key

getAuthSubToken() 공개 메소드

Gets the AuthSub token used for authentication
public getAuthSubToken ( ) : string
리턴 string The token

getClientLoginToken() 공개 메소드

Gets the ClientLogin token used for authentication
public getClientLoginToken ( ) : string
리턴 string The token

getStreamingRequest() 공개 메소드

Check whether the client is set to perform streaming requests.
public getStreamingRequest ( ) : boolean
리턴 boolean True if yes, false otherwise.

resetParameters() 공개 메소드

Clear all custom parameters we set.
public resetParameters ( $clearAll = false ) : Zend_Http_Client
리턴 Zend_Http_Client

setAdapter() 공개 메소드

Load the connection adapter
public setAdapter ( Zend_Http_Client_Adapter_Interface $adapter ) : void
$adapter Zend_Http_Client_Adapter_Interface
리턴 void

setAuthSubPrivateKey() 공개 메소드

In order to call this method, openssl must be enabled in your PHP installation. Otherwise, a Zend_Gdata_App_InvalidArgumentException will be thrown.
public setAuthSubPrivateKey ( string $key, string $passphrase = null ) : Zend_Gdata_HttpClient
$key string The private key
$passphrase string The optional private key passphrase
리턴 Zend_Gdata_HttpClient Provides a fluent interface

setAuthSubPrivateKeyFile() 공개 메소드

This method reads the file and then calls setAuthSubPrivateKey() with the file contents.
public setAuthSubPrivateKeyFile ( string $file, string $passphrase = null, boolean $useIncludePath = false ) : void
$file string The location of the file containing the PEM key
$passphrase string The optional private key passphrase
$useIncludePath boolean Whether to search the include_path for the file
리턴 void

setAuthSubToken() 공개 메소드

Sets the AuthSub token used for authentication
public setAuthSubToken ( string $token ) : Zend_Gdata_HttpClient
$token string The token
리턴 Zend_Gdata_HttpClient Provides a fluent interface

setClientLoginToken() 공개 메소드

Sets the ClientLogin token used for authentication
public setClientLoginToken ( string $token ) : Zend_Gdata_HttpClient
$token string The token
리턴 Zend_Gdata_HttpClient Provides a fluent interface

setRawDataStream() 공개 메소드

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().
public setRawDataStream ( string $data, string $enctype = null ) : Zend_Http_Client
$data string The request data
$enctype string The encoding type
리턴 Zend_Http_Client

setStreamingRequest() 공개 메소드

Set the streamingRequest variable which controls whether we are sending the raw (already encoded) POST data from a stream source.
public setStreamingRequest ( boolean $value ) : void
$value boolean The value to set.
리턴 void

프로퍼티 상세

$_streamingRequest 보호되어 있는 프로퍼티

True if this request is being made with data supplied by a stream object instead of a raw encoded string.
protected bool $_streamingRequest
리턴 boolean