Skip to content

AlphaRecon19/Cloudflare-PHP

Repository files navigation

Cloudflare-PHP

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 = "[email protected]";

$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());

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages