platformcommunity/bunnycdn-storage 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

platformcommunity/bunnycdn-storage

最新稳定版本:v0.2

Composer 安装命令:

composer require platformcommunity/bunnycdn-storage

包简介

Library for BunnyCDN Storage

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");

统计信息

  • 总下载量: 31.55k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 0
  • Forks: 29
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-12-08