pachico / belugacdn

Light client for BelugaCDN API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BelugaCDN

Build Status codecov License: MIT

Simple library to interact with BelugaCDN API. Current version only includes cache invalidation functionality.

Install

Via Composer

$ composer require pachico/belugacdn

Usage

With token authorization

use Pachico\BelugaCDN;

try {

    $auth = new BelugaCDN\Auth\Token('mytoken');
    $client = new BelugaCDN\CacheInvalidation($auth);

    $response = $client->invalidateCache([
        'http://cdn.mysite.com/picture.jpg',
        'http://cdn.mysite.com/html.html'
        ]);

    print_r($response);

} catch (\Exception $exc) {
    echo $exc->getMessage();
}

With username and password

use Pachico\BelugaCDN;

try {

    $auth = new BelugaCDN\Auth\Credential('username', 'password');
    $client = new BelugaCDN\CacheInvalidation($auth);

    $response = $client->invalidateCache([
        'http://cdn.mysite.com/picture.jpg',
        'http://cdn.mysite.com/html.html'
        ]);

    print_r($response);

} catch (\Exception $exc) {
    echo $exc->getMessage();
}

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email pachicodev@gmail.com instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.

About

Light client for BelugaCDN API

License:MIT License


Languages

Language:PHP 100.0%