syedgalibahmed/bunny-cdn.php.storage
最新稳定版本:1.0
Composer 安装命令:
composer require syedgalibahmed/bunny-cdn.php.storage
包简介
The official PHP library used for interacting with the BunnyCDN Storage API.
README 文档
README
The official PHP library used for interacting with the BunnyCDN Storage API.
How to use:
The storage library is very simple to use. First, create the basic BunnyCDNStorage object with the authentication details. It's the basic object for interaction with the API.
$bunnyCDNStorage = new BunnyCDNStorage("storagezonename", "MyAccessKey", "sg");
The BunnyCDNStorage constructor takes the following parameters:
- storageZoneName - The name of your storage zone
- apiAccessKey - The API access key (password)
- storageZoneRegion - The storage zone region code (de, ny, or sg)
Navigation:
Uploading objects:
To upload a file to the storage, you can use the uploadFile method. If the path to the object does not exist yet, it will be automatically created.
$bunnyCDNStorage->uploadFile("local/file/path/helloworld.txt", "/storagezonename/helloworld.txt");
Listing objects:
Get a list of of all objects on the given path.
$bunnyCDNStorage->getStorageObjects("/storagezonename/");
The StorageObject contains the following properties:
- Guid - The unique GUID of the file
- UserId - The ID of the BunnyCDN user that holds the file
- DateCreated - The date when the file was created
- LastChanged - The date when the file was last modified
- StorageZoneName - The name of the storage zone to which the file is linked
- Path - The path to the object
- ObjectName - The name of the object
- Length - The total of the object in bytes
- IsDirectory - True if the object is a directory, otherwise false.
- ServerId - The ID of the storage server that the file resides on
- StorageZoneId - The ID of the storage zone that the object is linked to
- FullPath - The full path to the file
Downloading objects:
To download an object from the storage to a local file, you can use the downloadFile method.
$bunnyCDNStorage->downloadFile("/storagezonename/helloworld.txt", "local/file/path/helloworld.txt");
Deleting objects:
Deleting supports both files and directories. If the target object is a directory, the directory content will also be deleted.
$bunnyCDNStorage->deleteObject("/storagezonename/helloworld.txt");
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-10-22