Skip to content

Commit 017f278

Browse files
authored
Merge pull request #19 from cp6/Development
Development v1.8
2 parents 8fb7a9f + e7906c2 commit 017f278

File tree

5 files changed

+429
-100
lines changed

5 files changed

+429
-100
lines changed

README.md

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,44 @@
11
# BunnyCDN API Class
22

33
The most comprehensive, feature packed and easy to use PHP class for [bunny.net](https://bunny.net?ref=qxdxfxutxf) (
4-
BunnyCDN) pull, video streaming and storage zones [API](https://docs.bunny.net/reference/bunnynet-api-overview).
4+
BunnyCDN) pull, video streaming, DNS and storage zones [API](https://docs.bunny.net/reference/bunnynet-api-overview).
55

66
This class whilst having a main focus on storage zone interaction includes pull zone features. Combining API with FTP,
77
managing and using BunnyNet storage zones just got easier.
88

9-
[![Generic badge](https://img.shields.io/badge/version-1.7-blue.svg)]()
10-
[![Generic badge](https://img.shields.io/badge/PHP-8-purple.svg)]()
11-
12-
**Note video streaming API is seemingly not finalized and changes from time to time**
9+
[![Generic badge](https://img.shields.io/badge/version-1.8-blue.svg)]()
10+
[![Generic badge](https://img.shields.io/badge/PHP-8.1-purple.svg)]()
11+
12+
### 1.8 changes
13+
* Added DNS zone interaction
14+
* Added `dns_example.php` file
15+
* Added getStreamCollectionSize function
16+
* Added getVideoStatistics function
17+
* Added getVideoHeatmap function
18+
* Added reEncodeVideo function
19+
* Added fetchVideo function
20+
* Added getCountries function
21+
* Added getRegions function
22+
* Added getAbuseCases function
23+
* Added checkAbuseCase function
24+
* Added getSupportTickets function
25+
* Added getSupportTicketDetails function
26+
* Added closeSupportTicket function
27+
* Added createSupportTicket function
28+
* Updated APIcall function (bool $storage_call replaced with string $url_type)
29+
* Updated functions that use APIcall to use new $url_type parameter
30+
* Updated listPullZones function
31+
* Updated getStatistics function
32+
* Updated findStorageZoneAccessKey function return type
33+
* Updated getVideoCollections function
34+
* Updated API_URL and VIDEO_STREAM_URL const strings
35+
* Removed boolToInt function
36+
* Removed jsonHeader function
37+
38+
### TODO
39+
* Sort (features) and index the readme
40+
* Create separate example files for each (pull, storage, video/stream and DNS)
41+
* Create separate classes and src files for each (pull, storage, video/stream and DNS)
1342

1443
### Requirements
1544

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "corbpie/bunny-cdn-api",
3-
"description": "Bunny CDN API class for handling pull and storage zones plus video streaming.",
3+
"description": "Bunny net CDN API class for handling pull zones, video streaming, DNS and storage zones.",
44
"type": "library",
55
"license": "MIT",
66
"minimum-stability": "stable",

dns_example.php

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?php
2+
require __DIR__ . '/vendor/autoload.php';
3+
4+
use Corbpie\BunnyCdn\BunnyAPI;
5+
6+
$bunny = new BunnyAPI();
7+
8+
//Returns all DNS zones
9+
$bunny->getDNSZones();
10+
11+
//Returns all single DNS zone details
12+
$bunny->getDNSZone(1234);
13+
14+
//Create a DNS zone with logging enable
15+
$bunny->addDNSZone('zonedomain.com', true);
16+
17+
//Delete DNS zone (1234 is the DNS zone id)
18+
$bunny->deleteDNSZone(1234);
19+
20+
//Returns DNS zone statistics
21+
$bunny->getDNSZoneStatistics(1234);
22+
23+
//Update DNS nameservers
24+
$bunny->updateDNSZoneNameservers(12345, true, 'nameserverone.com', 'nameservertwo.com');
25+
26+
//Update DNS SOA email
27+
$bunny->updateDNSZoneSoaEmail(12345, '[email protected]');
28+
29+
//Add DNS A record
30+
$bunny->addDNSRecordA(12345, 'thehost.com', '199.99.99.99');
31+
32+
//Add DNS AAAA record
33+
$bunny->addDNSRecordAAAA(12345, 'thehost.com', '2001:0db8:85a3:0000:0000:8a2e:0370:7334');
34+
35+
//Add DNS CNAME record
36+
$bunny->addDNSRecordCNAME(12345, 'thehost.com', 'sometarget.com');
37+
38+
//Add DNS MX record (priority of 600)
39+
$bunny->addDNSRecordMX(12345, 'thehost.com', 'mailserver.com', 600);
40+
41+
//Add DNS TXT record
42+
$bunny->addDNSRecordTXT(12345, 'thehost.com', 'the TXT content');
43+
44+
//Add DNS NS record
45+
$bunny->addDNSRecordNS(12345, 'thehost.com', 'targetns.com');
46+
47+
//Add DNS redirect record
48+
$bunny->addDNSRecordRedirect(12345, 'thehost.com', 'theurl.com');
49+
50+
//Update DNS A record (9876 is the DNS record id)
51+
$bunny->updateDNSRecordA(12345, 9876,'diffdomain.com', '162.55.44.12');
52+
53+
//Update DNS AAAA record (9876 is the DNS record id)
54+
$bunny->updateDNSRecordA(12345, 9876,'thehost.com', '12001:0db8:85a3:0000:0000:8a2e:0370:6225');
55+
56+
//Disable a DNS record
57+
$bunny->disableDNSRecord(12345, 9876);
58+
59+
//Enable a DNS record
60+
$bunny->enableDNSRecord(12345, 9876);
61+
62+
//Delete DNS record
63+
$bunny->deleteDNSRecord(12345, 9876);

example.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use Corbpie\BunnyCdn\BunnyAPI;
55

66
$bunny = new BunnyAPI();
7-
//Make sure API_KEY is set at line 12 bunnyAPI.php
7+
//Make sure API_KEY is set at line 9 bunnyAPI.php
88

99
/*
1010
*

0 commit comments

Comments
 (0)