pachico/belugacdn

This package is abandoned and no longer maintained. No replacement package was suggested.

Light client for BelugaCDN API

0.1.0 2017-04-20 06:54 UTC

This package is auto-updated.

Last update: 2022-01-21 22:23:42 UTC


README

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.