happyr/cloud-flare-bundle

This Symfony2 bundle lets you talk to the CloudFlare client API

Installs: 18 618

Dependents: 0

Suggesters: 0

Security: 0

Stars: 5

Watchers: 3

Forks: 3

Open Issues: 1

Type:symfony-bundle

0.2.1 2015-11-28 15:58 UTC

This package is auto-updated.

Last update: 2024-03-25 06:14:10 UTC


README

This Symfony2 bundle lets you talk to the CloudFlare client API. For API reference please visit the CloudFlare website.

Installation and Configuration

Install it like any other bundle with composer:

composer require happyr/cloud-flare-bundle

Once install and activated in the AppKernel.php you have to add your CloudFlare email and token in the configuration.

# app/config/config.yml

happyr_cloud_flare:
  email: tobias@happyr.com
  token: abcdefghijklmnop

Usage example

Here below is an example how you clear the cache for the http://my-domain.com/static/style.css url.

$cloudFlare=$this->container->get('happyr.cloudflare.service.cloudflare');
$cloudFlare->api('zone_file_purge', array('z'=>'my-domain.com', 'url'=>'http://my-domain.com/static/style.css'));