tinycdn/cdn-api
最新稳定版本:1.3.3
Composer 安装命令:
composer require tinycdn/cdn-api
包简介
Library for works with tinycdn.cloud service API
README 文档
README
This package work with GraphQL API of TinyCDN Service
More info you can find on TinyCDN Service
Install
composer require "tinycdn/cdn-api"
Usage
<?php $cdn = new \Tinycdn\CdnApi('your-api-token'); try { //////////// // Upload // //////////// // simple upload $data1 = $cdn->upload('path/to/file.ext'); var_dump($data1); // more options $params = [ 'is_public' => false, // default true 'type' => 'image', // default file 'filename' => 'my-img.jpg', // if not set, filename will be detected automatically 'rule_key' => 'my-rule', // see docs for details 'folder_id' => 555, // 0 - root folder. See more about folders ]; $data2 = $cdn->upload('https://images.local/image.jpg', $params); var_dump($data2); ///////////// // Folders // ///////////// $filters = [ 'title' => 'Avatars', 'idp' => 0, ]; $list = $cdn->getFoldersList($filters); $folder = $list[0] ?? $cdn->addFolder('Avatars'); var_dump($folder); } catch (Exception $e) { echo $e->getMessage(); }
统计信息
- 总下载量: 149
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-06-05