PHP 클래스 CloudFlare\Api

A work in progress library for the Cloudflare API. The documentation for the API can be found at https://www.cloudflare.com/docs/.
저자: James Bell ([email protected])
파일 보기 프로젝트 열기: jamesryanbell/cloudflare 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$auth_key string Holds the provided auth_key for API authentication
$curl_options array Holds the curl options
$email string Holds the provided email address for API authentication

공개 메소드들

메소드 설명
__construct ( ) Make a new instance of the API client This can be done via providing the email address and api key as seperate parameters or by passing in an already instantiated object from which the details will be extracted
delete ( string $path, array $data = null ) : mixed API call method for sending requests using DELETE
get ( string $path, array $data = null ) : mixed API call method for sending requests using GET
patch ( string $path, array $data = null ) : mixed API call method for sending requests using PATCH
post ( string $path, array $data = null ) : mixed API call method for sending requests using POST
put ( string $path, array $data = null ) : mixed API call method for sending requests using PUT
setAuthKey ( string $token ) Setter to allow the setting of the Authentication Key
setCurlOption ( integer $key, mixed $value ) Setter to allow the adding / changing of the Curl options that will be used within the HTTP requests
setEmail ( string $email ) Setter to allow the setting of the email address

보호된 메소드들

메소드 설명
request ( string $path, array $data = null, string | null $method = null ) : mixed

메소드 상세

__construct() 공개 메소드

Make a new instance of the API client This can be done via providing the email address and api key as seperate parameters or by passing in an already instantiated object from which the details will be extracted
public __construct ( )

delete() 공개 메소드

API call method for sending requests using DELETE
public delete ( string $path, array $data = null ) : mixed
$path string Path of the endpoint
$data array Data to be sent along with the request
리턴 mixed

get() 공개 메소드

API call method for sending requests using GET
public get ( string $path, array $data = null ) : mixed
$path string Path of the endpoint
$data array Data to be sent along with the request
리턴 mixed

patch() 공개 메소드

API call method for sending requests using PATCH
public patch ( string $path, array $data = null ) : mixed
$path string Path of the endpoint
$data array Data to be sent along with the request
리턴 mixed

post() 공개 메소드

API call method for sending requests using POST
public post ( string $path, array $data = null ) : mixed
$path string Path of the endpoint
$data array Data to be sent along with the request
리턴 mixed

put() 공개 메소드

API call method for sending requests using PUT
public put ( string $path, array $data = null ) : mixed
$path string Path of the endpoint
$data array Data to be sent along with the request
리턴 mixed

request() 보호된 메소드

protected request ( string $path, array $data = null, string | null $method = null ) : mixed
$path string Path of the endpoint
$data array Data to be sent along with the request
$method string | null Type of method that should be used ('GET', 'POST', 'PUT', 'DELETE', 'PATCH')
리턴 mixed

setAuthKey() 공개 메소드

Setter to allow the setting of the Authentication Key
public setAuthKey ( string $token )
$token string Authentication key, this can be retrieve from the 'My Account' section of the Cloudflare account

setCurlOption() 공개 메소드

Setter to allow the adding / changing of the Curl options that will be used within the HTTP requests
public setCurlOption ( integer $key, mixed $value )
$key integer The CURLOPT_XXX option to set e.g. CURLOPT_TIMEOUT
$value mixed The value to be set on option e.g. 10

setEmail() 공개 메소드

Setter to allow the setting of the email address
public setEmail ( string $email )
$email string The email address associated with the Cloudflare account

프로퍼티 상세

$auth_key 공개적으로 프로퍼티

Holds the provided auth_key for API authentication
public string $auth_key
리턴 string

$curl_options 공개적으로 프로퍼티

Holds the curl options
public array $curl_options
리턴 array

$email 공개적으로 프로퍼티

Holds the provided email address for API authentication
public string $email
리턴 string