alpharecon19/cloudflare-php

There is no license information available for the latest version (v0.2) of this package.

v0.2 2016-06-15 09:44 UTC

This package is auto-updated.

Last update: 2024-04-08 09:38:20 UTC


README

Scrutinizer Code Quality

A simple PHP Library that allows you to interact with Cloudflare's API using guzzle. More information about endpoints can be found here.

Authentication

Information required to connect to Cloudflare's API are your API Key and Email, these can be found in your My Account page within cloudflare. This by default is stored in the Cloudflare.yml file located in the root of your project. You can just copy the Cloudflare.yml.dist file replacing your credentials there.

Alternatively, if this is not an option you can just pass these variables into the Cloudflare class when you create it.

$APIKEY = "1234567893feefc5f0q5000bfo0c38d90bbeb";
$Email = "example@example.com";

$Cloudflare = new Cloudflare\Cloudflare($APIKEY, $Email);

Example - Getting users details

<?php
require 'vendor/autoload.php';

$Cloudflare = new Cloudflare\Cloudflare();
$User = new Cloudflare\User($Cloudflare);

var_dump($User->get());