2017 © Pedro Peláez
 

yii2-extension yii2-cloudflare-api

Simple Yii2 cloudflare extension without any requirements.

image

biozahard/yii2-cloudflare-api

Simple Yii2 cloudflare extension without any requirements.

  • Tuesday, April 11, 2017
  • by biozahard
  • Repository
  • 0 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 100 % Grown

The README.md

Cloudflare API

Yii2 Component for CloudFlare api v4.0. https://www.cloudflare.com/, (*1)

Minimum requirements: Yii2, Curl, (*2)

Installation via Composer:, (*3)

composer require biozahard/yii2-cloudflare-api, (*4)

Configuring in config.php:, (*5)

'components' => [
//...
        'cloudflare' => [
            'class'         => 'biozahard\cloudflare\CloudflareApi',
            'apiurl'   => 'https://api.cloudflare.com/client/v4/',
            'authkey'       => '5gds0kfdsc024ndsofsj049jisdofjsd034jw',
            'authemail'     => 'admin@mail.com',
            'sites'         => [
                'mysite.com',
                'thebest-country.ua',
                'anotheronesite.biz',
            ],
        ],
//...
]

After this configuring you can use: \Yii::$app->cloudflare, (*6)

So, let's see some examples:, (*7)

  1. Purge all cloudflare cache:
//get the CloudFlare api component
$cf = \Yii::$app->cloudflare;

//purge cache for specific website:
$cf->purgeCache('thebest-country.ua');

//Clear the cache for the first site from the specified list:
$cf->purgeCache();

License: LGPL v3 or later, (*8)

The Versions

11/04 2017

dev-master

9999999-dev https://github.com/biozahard/yii2-cloudflare

Simple Yii2 cloudflare extension without any requirements.

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

by Zakharii Fesenko