dev-master
9999999-devA Yii2 extension for some keyCDN lovin'
BSD-3-Clause
The Requires
by Sammaye
yii2 yii keycdn
A Yii2 extension for some keyCDN lovin'
A Yii2 extension for some KeyCDN lovin' that's so simple even your cat will be able to use it., (*1)
Here is the full definition, from an example:, (*2)
'keycdn' => [ 'class' => 'sammaye\keycdn\KeyCdn', 'apiKey' => 'your_api_key' ]
Everything is quite self explanatory. Let's dive straight in and use this sucker with examples., (*3)
GET
zonesvar_dump(Yii::$app->keycdn->get('zones.json'));
DELETE
purgezone
by URLvar_dump(Yii::$app->keycdn->delete( 'zones/purgeurl/xxx.json', [ 'urls' => [ 'xxx-111.kxcdn.com/css/all-e007231ec83260807e00650a0c274b86.css' ] ] ));
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)
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)
A Yii2 extension for some keyCDN lovin'
BSD-3-Clause
yii2 yii keycdn