[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/lib/zend/Zend/Http/Client/Adapter/ -> Socket.php (summary)

Zend Framework LICENSE

Copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
License: http://framework.zend.com/license/new-bsd New BSD License
Version: $Id$
File Size: 543 lines (18 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Zend_Http_Client_Adapter_Socket:: (12 methods):
  __construct()
  setConfig()
  getConfig()
  setStreamContext()
  getStreamContext()
  connect()
  write()
  read()
  close()
  _checkSocketReadTimeout()
  setOutputStream()
  __destruct()


Class: Zend_Http_Client_Adapter_Socket  - X-Ref

A sockets based (stream_socket_client) adapter class for Zend_Http_Client. Can be used
on almost every PHP environment, and does not require any special extensions.

__construct()   X-Ref
Adapter constructor, currently empty. Config is set using setConfig()


setConfig($config = array()   X-Ref
Set the configuration array for the adapter

param: Zend_Config | array $config

getConfig()   X-Ref
Retrieve the array of all configuration options

return: array

setStreamContext($context)   X-Ref
Set the stream context for the TCP connection to the server

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.

param: mixed $context Stream context or array of context options
return: Zend_Http_Client_Adapter_Socket

getStreamContext()   X-Ref
Get the stream context for the TCP connection to the server.

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

return: resource

connect($host, $port = 80, $secure = false)   X-Ref
Connect to the remote server

param: string  $host
param: int     $port
param: boolean $secure

write($method, $uri, $http_ver = '1.1', $headers = array()   X-Ref
Send request to the remote server

param: string        $method
param: Zend_Uri_Http $uri
param: string        $http_ver
param: array         $headers
param: string        $body
return: string Request as string

read()   X-Ref
Read response from server

return: string

close()   X-Ref
Close the connection to the server


_checkSocketReadTimeout()   X-Ref
Check if the socket has timed out - if so close connection and throw
an exception


setOutputStream($stream)   X-Ref
Set output stream for the response

param: resource $stream
return: Zend_Http_Client_Adapter_Socket

__destruct()   X-Ref
Destructor: make sure the socket is disconnected

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




Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1