PHP Class 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/.
Author: James Bell ([email protected])
Afficher le fichier Open project: jamesryanbell/cloudflare Class Usage Examples

Méthodes publiques

Свойство Type Description
$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

Méthodes publiques

Méthode Description
__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

Méthodes protégées

Méthode Description
request ( string $path, array $data = null, string | null $method = null ) : mixed

Method Details

__construct() public méthode

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() public méthode

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
Résultat mixed

get() public méthode

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
Résultat mixed

patch() public méthode

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
Résultat mixed

post() public méthode

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
Résultat mixed

put() public méthode

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
Résultat mixed

request() protected méthode

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')
Résultat mixed

setAuthKey() public méthode

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() public méthode

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() public méthode

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

Property Details

$auth_key public_oe property

Holds the provided auth_key for API authentication
public string $auth_key
Résultat string

$curl_options public_oe property

Holds the curl options
public array $curl_options
Résultat array

$email public_oe property

Holds the provided email address for API authentication
public string $email
Résultat string