Stable\Cdn\Client
Stable.cz CDN client
Basic usage examples:
// construct
$client = new \Stable\Cdn\Client(YOUR_API_KEY);
// create some local file
file_put_contents('localfile', date('Y-m-d'));
// upload file
$client->upload('localfile', 'path/to/remotefile');
// verify file exists
$client->ls('path/to/remotefile');
// list files in directory
$client->ls('path/to');
// delete remote file
$client->delete('path/to/remotefile');
- Author: Evzen Eiba <evzen.eiba@stable.cz>
- Copyright: Stable.cz
Synopsis
class Client
{
- // members
- protected string $url = 'https://cdn.stable.cz/';
- protected $apikey;
- public $curlLastInfo = NULL;
- public $curlLastResult = NULL;
- public object $chunkFileSize = 5 * 1024 * 102;
- public array $calls = ;
- // methods
- public null __construct()
- protected ?stdClass call()
- public ?stdClass upload()
- public ?stdClass delete()
- public ?stdClass ls()
- public ?stdClass configure()
Members
protected
- $apikey — string
- $url — string
public
- $calls — array
- $chunkFileSize — int
- $curlLastInfo — string
- $curlLastResult — string
Methods
protected
- call() — API request call (via cURL)
public
- __construct() — Constructor
- configure() — Configure CDN (currently resizer sizes only)
- delete() — Delete an existing file
- ls() — List an existing file or directory - get a file info or a directory and its files
- upload() — Uploads a file to target