PHP 클래스 lithium\net\socket\Curl

This curl adapter provides the required method implementations of the abstract Socket class for open, close, read, write, timeout eof and encoding. Your PHP installation must have been compiled with the --with-curl[=DIR] directive. If this is not the case, you must either recompile PHP with the proper configuration flags to enable curl, or you may use the Stream adapter that is also included with the Lithium core.
또한 보기: lithium\net\socket\Stream
상속: extends lithium\net\Socket
파일 보기 프로젝트 열기: unionofrad/lithium 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$options array Contains options that will be passed to curl_setopt_array before read and write operations. These options should be set by using the set method.

공개 메소드들

메소드 설명
__construct ( array $config = [] ) : void Constructor.
close ( ) : boolean Closes the curl connection.
encoding ( string $charset ) encoding() is currently unimplemented for this socket adapter
eof ( ) : null EOF is unimplemented for this socket adapter.
open ( array $options = [] ) : mixed Opens a curl connection and initializes the internal resource handle.
read ( ) : mixed Reads data from the curl connection.
set ( array $flags, array $value = null ) : void Sets the options to be used in subsequent curl requests.
timeout ( integer $time ) : boolean A convenience method to set the curl CURLOPT_CONNECTTIMEOUT setting for the current connection. This determines the number of seconds to wait while trying to connect.
write ( array | Message $data = null ) : boolean Writes data to curl options

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( array $config = [] ) : void
$config array
리턴 void

close() 공개 메소드

Closes the curl connection.
public close ( ) : boolean
리턴 boolean True on closed connection

encoding() 공개 메소드

encoding() is currently unimplemented for this socket adapter
public encoding ( string $charset )
$charset string

eof() 공개 메소드

EOF is unimplemented for this socket adapter.
public eof ( ) : null
리턴 null

open() 공개 메소드

Opens a curl connection and initializes the internal resource handle.
public open ( array $options = [] ) : mixed
$options array update the config settings if $options['options'] exists, will be passed to $this->set()
리턴 mixed Returns `false` if the socket configuration does not contain the `'scheme'` or `'host'` settings, or if configuration fails, otherwise returns a resource stream.

read() 공개 메소드

The read method will utilize the curl options that have been set.
public read ( ) : mixed
리턴 mixed Boolean false if the resource handle is unavailable, and the result of `curl_exec` otherwise.

set() 공개 메소드

Sets the options to be used in subsequent curl requests.
public set ( array $flags, array $value = null ) : void
$flags array If $values is an array, $flags will be used as the keys to an associative array of curl options. If $values is not set, then $flags will be used as the associative array.
$value array If set, this array becomes the values for the associative array of curl options.
리턴 void

timeout() 공개 메소드

Note: A value of 0 may be used to specify an indefinite wait time.
public timeout ( integer $time ) : boolean
$time integer The timeout value in seconds
리턴 boolean False if the resource handle is unavailable or the option could not be set, true otherwise.

write() 공개 메소드

Writes data to curl options
public write ( array | Message $data = null ) : boolean
$data array | lithium\net\Message
리턴 boolean

프로퍼티 상세

$options 공개적으로 프로퍼티

Contains options that will be passed to curl_setopt_array before read and write operations. These options should be set by using the set method.
또한 보기: lithium\net\socket\Curl::set()
public array $options
리턴 array