Gdata/HttpAdapterStreamingProxy.php

Show: inherited
Table of Contents

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 [email protected] so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Gdata  
Subpackage
Gdata  
Version
$Id: HttpAdapterStreamingProxy.php 24593 2012-01-05 20:35:02Z matthew $  

\Zend_Gdata_HttpAdapterStreamingProxy

Package: Zend\Gdata\Gdata

Extends the proxy HTTP adapter to handle streams instead of discrete body strings.

Should be used if proxy HTTP access is required. If no proxy is set, will fall back to Zend_Http_Client_Adapter_Socket behavior. Just like the default Socket adapter, this adapter does not require any special extensions installed.

Parent(s)
\Zend_Http_Client_Adapter_Proxy < \Zend_Http_Client_Adapter_Socket
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

Constantinteger  CHUNK_SIZE = 1024

The amount read from a stream source at a time.

integer

Properties

Propertyprotectedresource $_context = null
Default valuenullDetails
Type
resource
Inherited_from
\Zend_Http_Client_Adapter_Socket::$$_context  
Inherited_from
\Zend_Http_Client_Adapter_Proxy::$$_context  
Propertyprotectedarray $config = array('ssltransport' => 'ssl', 'sslcert' => null, 'sslpassphrase' => null, 'sslusecontext' => false, 'proxy_host' => '', 'proxy_port' => 8080, 'proxy_user' => '', 'proxy_pass' => '', 'proxy_auth' => \Zend_Http_Client::AUTH_BASIC, 'persistent' => false)
inherited

Parameters array

Inherited from: \Zend_Http_Client_Adapter_Proxy::$$config
Default valuearray('ssltransport' => 'ssl', 'sslcert' => null, 'sslpassphrase' => null, 'sslusecontext' => false, 'proxy_host' => '', 'proxy_port' => 8080, 'proxy_user' => '', 'proxy_pass' => '', 'proxy_auth' => \Zend_Http_Client::AUTH_BASIC, 'persistent' => false)Details
Type
array
Inherited_from
\Zend_Http_Client_Adapter_Proxy::$$config  
Propertyprotectedstring $connectHandshakeRequest =
inherited

Stores the last CONNECT handshake request

Inherited from: \Zend_Http_Client_Adapter_Proxy::$$connectHandshakeRequest
Details
Type
string
Inherited_from
\Zend_Http_Client_Adapter_Proxy::$$connectHandshakeRequest  
Propertyprotectedarray $connected_to = array(null, null)
Default valuearray(null, null)Details
Type
array
Inherited_from
\Zend_Http_Client_Adapter_Socket::$$connected_to  
Inherited_from
\Zend_Http_Client_Adapter_Proxy::$$connected_to  
Propertyprotectedstring $method = null
inherited

Request method - will be set by write() and might be used by read()

Inherited from: \Zend_Http_Client_Adapter_Socket::$$method\Zend_Http_Client_Adapter_Proxy::$$method
Default valuenullDetails
Type
string
Inherited_from
\Zend_Http_Client_Adapter_Socket::$$method  
Inherited_from
\Zend_Http_Client_Adapter_Proxy::$$method  
Propertyprotectedboolean $negotiated = false
inherited

Whether HTTPS CONNECT was already negotiated with the proxy or not

Inherited from: \Zend_Http_Client_Adapter_Proxy::$$negotiated
Default valuefalseDetails
Type
boolean
Inherited_from
\Zend_Http_Client_Adapter_Proxy::$$negotiated  
Propertyprotectedresource $out_stream = null
Default valuenullDetails
Type
resource
Inherited_from
\Zend_Http_Client_Adapter_Socket::$$out_stream  
Inherited_from
\Zend_Http_Client_Adapter_Proxy::$$out_stream  
Propertyprotectedresource|null $socket = null
inherited

The socket for server connection

Inherited from: \Zend_Http_Client_Adapter_Socket::$$socket\Zend_Http_Client_Adapter_Proxy::$$socket
Default valuenullDetails
Type
resource | null
Inherited_from
\Zend_Http_Client_Adapter_Socket::$$socket  
Inherited_from
\Zend_Http_Client_Adapter_Proxy::$$socket  

Methods

methodpublic__construct() : void
inherited

Adapter constructor, currently empty.

Inherited from: \Zend_Http_Client_Adapter_Socket::__construct()\Zend_Http_Client_Adapter_Proxy::__construct()

Config is set using setConfig()

methodpublic__destruct() : void
inherited

Destructor: make sure the socket is disconnected

Inherited from: \Zend_Http_Client_Adapter_Proxy::__destruct()

If we are in persistent TCP mode, will not close the connection

methodprotected_checkSocketReadTimeout() : void
inherited

Check if the socket has timed out - if so close connection and throw an exception

Inherited from: \Zend_Http_Client_Adapter_Socket::_checkSocketReadTimeout()\Zend_Http_Client_Adapter_Proxy::_checkSocketReadTimeout()
Throws
Exception Description
\Zend_Http_Client_Adapter_Exception with READ_TIMEOUT code
methodpublicclose() : void
inherited

Close the connection to the server

Inherited from: \Zend_Http_Client_Adapter_Proxy::close()
methodpublicconnect(string $host, int $port = 80, boolean $secure = false) : void
inherited

Connect to the remote server

Inherited from: \Zend_Http_Client_Adapter_Proxy::connect()

Will try to connect to the proxy server. If no proxy was set, will fall back to the target server (behave like regular Socket adapter)

Parameters
Name Type Description
$host string
$port int
$secure boolean
methodprotectedconnectHandshake(string $host, integer $port = 443, string $http_ver = '1.1', array $headers = array()) : void
inherited

Preform handshaking with HTTPS proxy using CONNECT method

Inherited from: \Zend_Http_Client_Adapter_Proxy::connectHandshake()
Parameters
Name Type Description
$host string
$port integer
$http_ver string
$headers array
Throws
Exception Description
\Zend_Http_Client_Adapter_Exception
methodpublicgetConfig() : array
inherited

Retrieve the array of all configuration options

Inherited from: \Zend_Http_Client_Adapter_Socket::getConfig()\Zend_Http_Client_Adapter_Proxy::getConfig()
Returns
Type Description
array
methodpublicgetStreamContext() : resource
inherited

Get the stream context for the TCP connection to the server.

Inherited from: \Zend_Http_Client_Adapter_Socket::getStreamContext()\Zend_Http_Client_Adapter_Proxy::getStreamContext()

If no stream context is set, will create a default one.

Returns
Type Description
resource
methodpublicread() : string
inherited

Read response from server

Inherited from: \Zend_Http_Client_Adapter_Socket::read()\Zend_Http_Client_Adapter_Proxy::read()
Returns
Type Description
string
methodpublicsetConfig(\Zend_Config $config = array()) : void
inherited

Set the configuration array for the adapter

Inherited from: \Zend_Http_Client_Adapter_Socket::setConfig()\Zend_Http_Client_Adapter_Proxy::setConfig()
Parameters
Name Type Description
$config \Zend_Config

| array $config

methodpublicsetOutputStream(resource $stream) : \Zend_Http_Client_Adapter_Socket

This function sets output stream where the result will be stored.

Parameters
Name Type Description
$stream resource
Returns
Type Description
\Zend_Http_Client_Adapter_Socket
methodpublicsetStreamContext(mixed $context) : \Zend_Http_Client_Adapter_Socket
inherited

Set the stream context for the TCP connection to the server

Inherited from: \Zend_Http_Client_Adapter_Socket::setStreamContext()\Zend_Http_Client_Adapter_Proxy::setStreamContext()

Can accept either a pre-existing stream context resource, or an array of stream options, similar to the options array passed to the stream_context_create() PHP function. In such case a new stream context will be created using the passed options.

Parameters
Name Type Description
$context mixed

Stream context or array of context options

Returns
Type Description
\Zend_Http_Client_Adapter_Socket
Details
Since
Zend Framework 1.9  
methodpublicwrite(string $method, \Zend_Uri_Http $uri, string $http_ver = '1.1', array $headers = array(), string $body = '') : string

Send request to the proxy server with streaming support

Parameters
Name Type Description
$method string
$uri \Zend_Uri_Http
$http_ver string
$headers array
$body string
Returns
Type Description
string Request as string
Throws
Exception Description
\Zend_Http_Client_Adapter_Exception
Documentation was generated by phpDocumentor 2.0.0a8.