PHP 클래스 Zend_Http_Client_Adapter_Socket

상속: implements Zend_Http_Client_Adapter_Interface, implements Zend_Http_Client_Adapter_Stream
파일 보기 프로젝트 열기: dbpatch/dbpatch 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_context resource Stream context
$config array Parameters array
$connected_to array What host/port are we connected to?
$method string Request method - will be set by write() and might be used by read()
$out_stream resource Stream for storing output
$socket resource | null The socket for server connection

공개 메소드들

메소드 설명
__construct ( ) Adapter constructor, currently empty. Config is set using setConfig()
__destruct ( ) Destructor: make sure the socket is disconnected
close ( ) Close the connection to the server
connect ( string $host, integer $port = 80, boolean $secure = false ) Connect to the remote server
getConfig ( ) : array Retrieve the array of all configuration options
getStreamContext ( ) : resource Get the stream context for the TCP connection to the server.
read ( ) : string Read response from server
setConfig ( $config = [] ) Set the configuration array for the adapter
setOutputStream ( resource $stream ) : Zend_Http_Client_Adapter_Socket Set output stream for the response
setStreamContext ( mixed $context ) : Zend_Http_Client_Adapter_Socket Set the stream context for the TCP connection to the server
write ( string $method, Zend_Uri_Http $uri, string $http_ver = '1.1', array $headers = [], string $body = '' ) : string Send request to the remote server

보호된 메소드들

메소드 설명
_checkSocketReadTimeout ( ) Check if the socket has timed out - if so close connection and throw an exception

메소드 상세

__construct() 공개 메소드

Adapter constructor, currently empty. Config is set using setConfig()
public __construct ( )

__destruct() 공개 메소드

If we are in persistent TCP mode, will not close the connection
public __destruct ( )

_checkSocketReadTimeout() 보호된 메소드

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

close() 공개 메소드

Close the connection to the server
public close ( )

connect() 공개 메소드

Connect to the remote server
public connect ( string $host, integer $port = 80, boolean $secure = false )
$host string
$port integer
$secure boolean

getConfig() 공개 메소드

Retrieve the array of all configuration options
public getConfig ( ) : array
리턴 array

getStreamContext() 공개 메소드

If no stream context is set, will create a default one.
public getStreamContext ( ) : resource
리턴 resource

read() 공개 메소드

Read response from server
public read ( ) : string
리턴 string

setConfig() 공개 메소드

Set the configuration array for the adapter
public setConfig ( $config = [] )

setOutputStream() 공개 메소드

Set output stream for the response
public setOutputStream ( resource $stream ) : Zend_Http_Client_Adapter_Socket
$stream resource
리턴 Zend_Http_Client_Adapter_Socket

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.
public setStreamContext ( mixed $context ) : Zend_Http_Client_Adapter_Socket
$context mixed Stream context or array of context options
리턴 Zend_Http_Client_Adapter_Socket

write() 공개 메소드

Send request to the remote server
public write ( string $method, Zend_Uri_Http $uri, string $http_ver = '1.1', array $headers = [], string $body = '' ) : string
$method string
$uri Zend_Uri_Http
$http_ver string
$headers array
$body string
리턴 string Request as string

프로퍼티 상세

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

Stream context
protected resource $_context
리턴 resource

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

Parameters array
protected array $config
리턴 array

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

What host/port are we connected to?
protected array $connected_to
리턴 array

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

Request method - will be set by write() and might be used by read()
protected string $method
리턴 string

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

Stream for storing output
protected resource $out_stream
리턴 resource

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

The socket for server connection
protected resource|null $socket
리턴 resource | null