2017 © Pedro Peláez
 

yii-extension yii2-keycdn

A Yii2 extension for some keyCDN lovin'

image

sammaye/yii2-keycdn

A Yii2 extension for some keyCDN lovin'

  • Wednesday, March 30, 2016
  • by Sammaye
  • Repository
  • 1 Watchers
  • 0 Stars
  • 415 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 3 % Grown

The README.md

yii2-keycdn

A Yii2 extension for some KeyCDN lovin' that's so simple even your cat will be able to use it., (*1)

Defining the Extension

Here is the full definition, from an example:, (*2)

'keycdn' => [
    'class' => 'sammaye\keycdn\KeyCdn',
    'apiKey' => 'your_api_key'
]

Using It

Everything is quite self explanatory. Let's dive straight in and use this sucker with examples., (*3)

Example 1: GET zones

var_dump(Yii::$app->keycdn->get('zones.json'));

Example 2: DELETE purgezone by URL

var_dump(Yii::$app->keycdn->delete(
    'zones/purgeurl/xxx.json', 
    [
        'urls' => 
        [
            'xxx-111.kxcdn.com/css/all-e007231ec83260807e00650a0c274b86.css'
        ]
    ]
));

Responses

Responses are raw, converted from JSON to the stdClass primative in PHP, for example: here is the response from purgeurl:, (*4)

object(stdClass)[194]
  public 'status' => string 'success' (length=7)
  public 'description' => string 'Cache has been cleared for URL(s).' (length=34)

Errors

The extension will throw a yii\base\Exception when the body of the response cannot be decoded from JSON or if the JSON field status is error., (*5)

The Versions

30/03 2016

dev-master

9999999-dev

A Yii2 extension for some keyCDN lovin'

  Sources   Download

BSD-3-Clause

The Requires

 

yii2 yii keycdn