PHP 클래스 linslin\yii2\curl\Curl

파일 보기 프로젝트 열기: linslin/yii2-curl 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$errorCode null | integer Error code holder: https://curl.haxx.se/libcurl/c/libcurl-errors.html
$response string Holds response data right after sending a request.
$responseCharset HTTP Response Charset (taken from Content-type header)
$responseCode HTTP-Status Code This value will hold HTTP-Status Code. False if request was not successful.
$responseLength HTTP Response Length (taken from Content-length header, or strlen() of downloaded content)
$responseType HTTP Response Content Type (taken from Content-type header)

공개 메소드들

메소드 설명
delete ( string $url, boolean $raw = true ) : mixed Start performing DELETE-HTTP-Request
get ( string $url, boolean $raw = true ) : mixed Start performing GET-HTTP-Request
getInfo ( null $opt = null ) : array | mixed Get curl info according to http://php.net/manual/de/function.curl-getinfo.php
getOption ( string | integer $key ) : mixed | boolean Return a single option
getOptions ( ) : array Return merged curl options and keep keys!
head ( string $url ) : mixed Start performing HEAD-HTTP-Request
patch ( string $url, boolean $raw = true ) : mixed Start performing PATCH-HTTP-Request
post ( string $url, boolean $raw = true ) : mixed Start performing POST-HTTP-Request
put ( string $url, boolean $raw = true ) : mixed Start performing PUT-HTTP-Request
reset ( ) Total reset of options, responses, etc.
setOption ( string $key, mixed $value ) Set curl option
setOptions ( array $options ) Set curl options
unsetOption ( string $key ) Unset a single curl option
unsetOptions ( ) Unset all curl option, excluding default options.

비공개 메소드들

메소드 설명
_extractAdditionalCurlParameter ( ) Extract additional curl params private class helper
_httpRequest ( string $method, string $url, boolean $raw = false ) : mixed Performs HTTP request

메소드 상세

delete() 공개 메소드

Start performing DELETE-HTTP-Request
public delete ( string $url, boolean $raw = true ) : mixed
$url string
$raw boolean if response body contains JSON and should be decoded
리턴 mixed response

get() 공개 메소드

Start performing GET-HTTP-Request
public get ( string $url, boolean $raw = true ) : mixed
$url string
$raw boolean if response body contains JSON and should be decoded
리턴 mixed response

getInfo() 공개 메소드

Get curl info according to http://php.net/manual/de/function.curl-getinfo.php
public getInfo ( null $opt = null ) : array | mixed
$opt null
리턴 array | mixed

getOption() 공개 메소드

Return a single option
public getOption ( string | integer $key ) : mixed | boolean
$key string | integer
리턴 mixed | boolean

getOptions() 공개 메소드

Return merged curl options and keep keys!
public getOptions ( ) : array
리턴 array

head() 공개 메소드

Start performing HEAD-HTTP-Request
public head ( string $url ) : mixed
$url string
리턴 mixed response

patch() 공개 메소드

Start performing PATCH-HTTP-Request
public patch ( string $url, boolean $raw = true ) : mixed
$url string
$raw boolean if response body contains JSON and should be decoded
리턴 mixed response

post() 공개 메소드

Start performing POST-HTTP-Request
public post ( string $url, boolean $raw = true ) : mixed
$url string
$raw boolean if response body contains JSON and should be decoded
리턴 mixed response

put() 공개 메소드

Start performing PUT-HTTP-Request
public put ( string $url, boolean $raw = true ) : mixed
$url string
$raw boolean if response body contains JSON and should be decoded
리턴 mixed response

reset() 공개 메소드

Total reset of options, responses, etc.
public reset ( )

setOption() 공개 메소드

Set curl option
public setOption ( string $key, mixed $value )
$key string
$value mixed

setOptions() 공개 메소드

Set curl options
public setOptions ( array $options )
$options array

unsetOption() 공개 메소드

Unset a single curl option
public unsetOption ( string $key )
$key string

unsetOptions() 공개 메소드

Unset all curl option, excluding default options.
public unsetOptions ( )

프로퍼티 상세

$errorCode 공개적으로 프로퍼티

Error code holder: https://curl.haxx.se/libcurl/c/libcurl-errors.html
public null|int $errorCode
리턴 null | integer

$response 공개적으로 프로퍼티

Holds response data right after sending a request.
public string $response
리턴 string

$responseCharset 공개적으로 프로퍼티

HTTP Response Charset (taken from Content-type header)
public $responseCharset

$responseCode 공개적으로 프로퍼티

HTTP-Status Code This value will hold HTTP-Status Code. False if request was not successful.
public $responseCode

$responseLength 공개적으로 프로퍼티

HTTP Response Length (taken from Content-length header, or strlen() of downloaded content)
public $responseLength

$responseType 공개적으로 프로퍼티

HTTP Response Content Type (taken from Content-type header)
public $responseType