Download the PHP package corbpie/bunny-cdn-api without Composer
On this page you can find all versions of the php package corbpie/bunny-cdn-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download corbpie/bunny-cdn-api
More information about corbpie/bunny-cdn-api
Files in corbpie/bunny-cdn-api
Package bunny-cdn-api
Short Description Bunny net CDN API class for handling pull zones, storage zones, video streaming and DNS.
License MIT
Rated 5.00 based on 1 reviews
Informations about the package bunny-cdn-api
BunnyNET CDN API Class
The most comprehensive, feature-packed and easy to use PHP class for bunny.net ( BunnyCDN) pull, video streaming, DNS and storage zones API.
This class whilst having a main focus on storage zone interaction includes pull zone features, DNS, Video streaming and more. Combining API with FTP managing and using your BunnyNet storage zones just got easier.
[]() []()
Table of contents
- Features
- Installing & usage
- Setting API key
- Pullzone
- List all pullzones
- List a pullzone
- Purge pullzone
- Delete pullzone
- List pullzone hostnames
- Add hostname to pullzone
- Remove hostname from pullzone
- Change ssl status for pullzone
- Add IP block for pullzone
- Remove IP block for pullzone
- List blocked IPs for pullzone
- Purge cache for a URL
- Pullzone logs are array
- Storage
- Connect to storage zone
- List all storage zones
- Add storage zone
- Delete storage zone
- Get directory size
- Return current directory
- Change directory
- Check folder exists
- Check file exists
- Move to parent directory
- Create folder in current directory
- Delete folder
- Delete file
- Delete all files in a folder
- Rename a file
- Move a file
- Download a file
- Download all files in a directory
- Upload a file
- Upload all files from a local folder
- Return storage zone files and folder data
- Return storage zone directory files formatted
- Return storage zone directory folders formatted
- Return storage zone directory file and folders formatted
- Video streaming
- Set video library
- Get video collections
- Set video collection GUID
- Get streams for collection
- Update stream collection
- Delete stream collection
- Create stream collection
- List videos in library
- Get video information
- Delete video
- Create video
- Create video for collection
- Upload video
- Set thumbnail
- Get video resolutions
- Get video size
- Add captions
- Delete captions
- DNS
- Get all DNS zones
- Get DNS zone
- Add DNS zone
- Add DNS zone full
- Delete DNS zone
- Get DNS zone statistics
- Update DNS zone nameservers
- Update DNS zone SOA email
- Add DNS record
- Add DNS A record
- Add DNS AAAA record
- Add DNS CNAME record
- Add DNS MX record
- Add DNS TXT record
- Add DNS NS record
- Add DNS redirect record
- Update DNS A record
- Update DNS AAAA record
- Disable DNS record
- Enable DNS record
- Delete DNS record
- [Misc]()
1.9.7 changes
14th May 2024
- Fixed dirSize() needing a slash
- Fixed createFolder() throwing warning messages
- Added fileExists()
Requirements
- PHP 8.2
For Pull zone, billing and statistics API interaction you will need your BunnyNet API key, this is found in your dashboard in the My Account section.
The video streaming API you need the video stream library access key which is found in the settings for the library at bunny.net.
If you want to interact with storage zones you will need your BunnyCDN API key set and the name of the storage zone.
You can get this with as it returns all the storage zone data/info for the account.
Features & abilities
- List storage zones
- Add/create storage zone
- Delete storage zone
- Create folder in storage zone
- Delete folder in storage zone
- Delete file in storage zone
- Delete all files in a folder in storage zone
- Download a file from storage zone
- Download a file from storage zone with progress percentage
- Download all files in a folder from storage zone
- Upload file to storage zone
- Upload file to storage zone with progress percentage
- Upload all files in a folder to storage zone
- Rename file or folder in storage zone
- Move file in storage zone
- Get file size in storage zone
- Get directory size in storage zone
- Navigate/List directories in storage zone
- List all from storage zone directory
- List all files formatted from storage zone directory
- List all folders formatted from storage zone directory
- List all formatted from storage zone directory
- Create, edit and delete videos
- Create, edit and delete DNS zones
- Get usage statistics
- Get billing data
- View balance
- View monthly charge
- View monthly charge breakdown
- Apply coupon code
- List pull zones
- Get pull zone
- Add pull zone
- Update pull zone
- Delete pull zone
- Purge pull zone
- Add hostname to pull zone
- Remove hostname from pull zone
- Set force SSL for pull zone
- List pull zone HTTP access logs
- Calculate costs
Usage
Install with composer:
Use like:
Setting API key:
option 1 (preferred)
Line 12
option 2
With (needs setting with each calling of class)
Storage zone interaction
Storage zone name and access key for storage zone interaction (not needed if just using pull zone functions)
Set to obtain key automatically (storage name must be accurate)
$storagename
name of storage zone string
$access_key
key/password to storage zone optional
List storage zones
returns array
Add a storage zone
$newstoragezone
name of storage zone to create string
Delete a storage zone
$id
id of storage zone to delete int
Get directory size
$dir
directory to get size of string
Return current directory
returns string
Change directory
$dir
directory navigation (FTP rules) string
Check folder exists
$path
the folder path string
Returns bool
Check file exists
$file
the full file path including the filename string
Returns bool
Move to the parent directory
Create a folder in the current directory
$new_folder
Create a folder in the current directory string
Delete folder
$folder_name
Name of the folder to delete (folder must be empty) string
Delete a file
$name
Name of file to delete string
Delete all files in a folder
$dir
Directory to delete all files in string
Rename a file
BunnyCDN does not allow for ftp_rename so file copied to a new name and then the old file is deleted.
$directory
Directory that contains the file string
$old_name
Object that is being renamed string
$new_name
New name for object string
Move a file
$file
File to move string
$move_to
Directory to move file to string
Download a file
$save_as
Save file as string
$get_file
File to download string
$mode
FTP mode to use INT
Download all files in a directory
$dir_dl_from
Directory to download all from string
$dl_into
Download into string
$mode
FTP mode to use INT
Upload a file
$upload
File to upload string
$upload_as
Upload as string
$mode
FTP mode to use INT
Upload all files from a local folder
$dir
Upload all files from this directory string
$place
Upload to string
$mode
FTP mode to use INT
Return storage zone files and folder data (Original)
returns array
Return storage zone directory files formatted
$location
Directory to get and return data string
returns array
Return storage zone directory folders formatted
$location
Directory to get and return data string
returns array
Return storage zone directory file and folders formatted
$location
Directory to get and return data string
returns array
List all pull zones and data
returns array
List pull zones data for id
$id
Pull zone to get data from int
returns array
Purge pull zone data
$id
Pull zone to purge int
Delete pull zone data
$id
Pull zone to delete int
Lists pullzone hostnames and amount
Add hostname to pull zone
$id
Pull zone hostname will be added to int
$hostname
Hostname to add string
Remove a hostname from pull zone
$id
Pull zone hostname be removed from int
$hostname
Hostname to remove string
Change force SSL status for pull zone
$id
Pull zone hostname change status int
$hostname
Affected hostname string
$force_ssl
True = on, FALSE = off bool
Add ip to block for pullzone
Un block an ip for pullzone
List all blocked ip's for pullzone
Purge cache for a URL
$url
Purge cache for this url string
$async
Dont wait for the purge before returning result bool
Pull zone logs as formatted array
$id
Pull zone id int
$date
Date for logs, only past 3 days (mm-dd-yy) string
Get usage statistics
returns array
Get billing data
returns array
Get account balance
returns float
Get monthly charge
returns float
Get monthly charge breakdown for region
returns array
Lists total billing amount and first date time
returns array
Apply a coupon code
Set Json header
Convert/format bytes to other data types
Convert bool to int value
returns int
Close connection (Optional)
Video streaming zone interaction
Calling and setting stream library access key
You can only get the video library id from your bunny.net stream library page Set video stream library id
$library_id
stream library id int
Get video collections
Requires to be set.
Set video collection guid
$collection_guid
video collection guid string
Set video guid
$video_guid
video guid string
Get video collections for library id
Requires to be set.
$page
page number int
$items_pp
items to show int
$order_by
order by string
Get streams for a collection
Requires and to be set.
Update stream collection
Requires and to be set.
$updated_collection_name
the name to update video collection to string
Delete stream collection
Requires and to be set.
Create stream collection
Requires to be set.
$new_collection_name
the name for your new video collection string
List videos for library
Requires to be set.
$collection_guid
video collection guid string
Get video information
Requires to be set.
$collection_guid
video collection guid string
Delete video
Requires to be set.
$library_id
library id int
$collection_guid
video collection guid string
Create video
Requires to be set.
$video_title
video title string
Create video for collection
Requires and to be set.
$video_title
video title string
Upload video
Requires to be set.
Need to use first to get video guid
$video_guid
video guid string
$video_to_upload
video filename string
Set thumbnail for video
Requires to be set.
$video_guid
video guid string
$thumbnail_url
image url string
Get video resolutions
Requires to be set.
Get video size
Requires to be set.
Add captions
Requires to be set.
$video_guid
video guid string
$srclang
caption srclang string
$label
label for captions string
$captions_file
caption file URL string
Delete captions
Requires to be set.
$video_guid
video guid string
$srclang
captions srclang string
DNS zone interaction
Get DNS all zones
$library_id
stream library id int
Get DNS zone
$zone_id
DNS zone id int
Add a DNS zone
$domain
domain name string
$logging
use logging bool
Add a DNS zone full
$parameters
parameters to create array
Delete DNS zone
$zone_id
DNS zone id int
DNS zone statistics
$zone_id
DNS zone id int
Update DNS nameservers
$zone_id
DNS zone id int
$custom_ns
use custom nameservers bool
$ns_one
NS one string
$ns_two
NS two string
Update DNS SOA email
$zone_id
DNS zone id int
$soa_email
NS one string
Add a DNS record by using parameters https://docs.bunny.net/reference/dnszonepublic_addrecord
$zone_id
DNS zone id int
$name
name string
$value
IP address string
$parameters
array
Add DNS A record
$zone_id
DNS zone id int
$hostname
hostname string
$ipv4
IPv4 address string
Add DNS AAAA record
$zone_id
DNS zone id int
$hostname
hostname string
$ipv6
IPv6 address string
Add DNS CNAME record
$zone_id
DNS zone id int
$hostname
hostname string
$target
string
Add DNS MX record
$zone_id
DNS zone id int
$hostname
hostname string
$mail
mail server string
$priority
int
Add DNS TXT record
$zone_id
DNS zone id int
$hostname
hostname string
$content
txt contents string
Add DNS NS record
$zone_id
DNS zone id int
$hostname
hostname string
$target
string
Add DNS redirect
$zone_id
DNS zone id int
$hostname
hostname string
$url
redirect to string
Update DNS A record
$zone_id
DNS zone id int
$dns_id
DNS record id int
$hostname
hostname string
$ipv4
ipv4 address string
Update DNS AAAA record
$zone_id
DNS zone id int
$dns_id
DNS record id int
$hostname
hostname string
$ipv6
ipv6 address string
Disable DNS record
$zone_id
DNS zone id int
$dns_id
DNS record id int
Enable DNS record
$zone_id
DNS zone id int
$dns_id
DNS record id int
Delete DNS record
$zone_id
DNS zone id int
$dns_id
DNS record id int
All versions of bunny-cdn-api with dependencies
ext-ftp Version *
ext-curl Version *