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])
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$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