This release comes with breaking changes to a couple of methods regarding uploading of files. To allow
for more flexibility when uploading file contents, instead of passing the path to the local file,
you are now required to read in the file contents before passing it to these methods. This change grants users more
freedom on how to read file contents/streams (e.g. external sources) as it will now allow any of the following
types string|resource|StreamInterface|null
as $body
parameter (previously $localFilePath
).
The 3.x
branch will now no longer be maintained.
- File contents/stream should now be explicitly read before passing to the following methods. Examples in
the documentation have been updated.
BaseAPI::importDnsRecords
- Changed
$localFilePath
to$body
.
- Changed
EdgeStorageAPI::uploadFile
- Changed
$localFilePath
to$body
.
- Changed
StreamAPI::uploadVideo
- Changed
$localFilePath
to$body
.
- Changed
BodyContentHelper::openFileStream
andFileDoesNotExistException::class
have been removed.- While previously only used internally for the above-mentioned methods, the
openFileStream
was a public static method and could've theoretically been used by users, which is the reason for explicitly stating it here.
- While previously only used internally for the above-mentioned methods, the
This release reworks (almost) the entire codebase, and therefore results in quite some breaking changes. Please read the following notes carefully before upgrading.
The 2.x
branch will now no longer be maintained.
- Request (PSR-18)
- Addition of
Psr\Http\Client\ClientInterface
requires the user to construct aBunnyClient
, and supply theBunnyClient
to the API classes. Examples can be found in the documentation website.
- Addition of
- Response
- Return type for public API methods changed from
array
toToshY\BunnyNet\Model\Client\BunnyClientResponse
:- Change from
$response['content']
to$response->getContents()
- Change from
$response['headers']
to$response->getHeaders()
- Change from
$response['status']['code']
to$response->getStatusCode()
- Change from
$response['status']['info']
to$response->getReasonPhrase()
- A new method
getBody()
was added.
- Change from
- Return type for public API methods changed from
- Endpoints
- The following public classes have been renamed:
- The class
BaseRequest
was renamed toBaseAPI
. - The class
EdgeStorageRequest
was renamed toEdgeStorageAPI
. - The class
PullZoneLogRequest
was renamed toLoggingAPI
. - The class
VideoStreamRequest
was renamed toStreamAPI
. - The class
SecureUrlGenerator
was renamed toTokenAuthentication
.- The method
generate
was renamed tosign
.
- The method
- The class
ImageOptimizer
was renamed toImageProcessor
.- The argument
$optimizationCollection
was renamed to$optimization
.
- The argument
- The class
PricingCalculator
was removed.
- The class
- The following public methods have been renamed:
- The method
listStorageZone
was renamed tolistStorageZones
. - The method
resetStorageZonePasswordByPath
was renamed toresetStorageZonePassword
. - The method
getCollectionList
was renamed tolistCollections
. - The method
purgeCache
was renamed topurgePullZoneCache
. - The method
addCustomCertificate
was renamed toaddCertificate
. - The method(s) having
the
in the name have been renamed.closeTheAccount
=>closeAccount
- The method(s) having lowercase abbreviations have been renamed to uppercase abbreviations.
getDpaDetails
=>getDPADetails
- The method
- The following public methods have been changed:
- The method
fetchVideoToCollection
was renamed tofetchVideo
, therefore removing the originalfetchVideo
method.- The new
fetchVideo
method has the same argumentsfetchVideoToCollection
used to have.
- The new
- The method
- Base API
- The argument
$accountApiKey
was renamed to$apiKey
.
- The argument
- Logging API
- The argument
$accountApiKey
was renamed to$apiKey
.
- The argument
- Edge Storage API
- The argument
$hostCode
was changed to$region
and now only accepts aRegion
case.- Example: For the
Falkenstein
region (previously'FS'
code) this would now beRegion::FS
(default). - For a complete list of available
Region
cases, see the example in the documentation website.
- Example: For the
- The argument
- The following public classes have been renamed:
Note: Please take in consideration that due to the impact of this release I cannot fully guarantee this list of breaking changes is complete. Thank you for your understanding.
- Styleguide
- Regarding PHP RFC: Class Naming, class names with initialism, e.g.
API
, will be uppercase for the initialism part.- Variable names for instances of these classes will follow the camelCase naming convention.
- E.g.
$baseApi
for theBaseAPI
class.
- E.g.
- Method names including an initialism will (still) follow the camelCase naming convention.
- Example: get DPA details =>
getDpaDetails
. - Example: get DNS zone =>
getDnsZone
.
- Example: get DPA details =>
- Variable names for instances of these classes will follow the camelCase naming convention.
- Regarding PHP RFC: Class Naming, class names with initialism, e.g.
- Base API
- Notes:
- Updating to the latest API specifications.
- Notes:
- Edge Storage API
- Notes:
- Updating to the latest API specifications.
- Changes:
- Manage Files
- Updated:
- Download File
- The arguments
$path
and$fileName
switched order to$fileName
and$path
; The$path
argument now has a default value''
, denoting the root directory.
- The arguments
- Upload File
- The arguments
$path
,$fileName
and$localFilePath
switched order to$fileName
,$path
and$localFilePath
; The$path
argument now has a default value''
, denoting the root directory. - Additional headers argument added (e.g SHA256).
- The arguments
- Download File
- The arguments
$path
and$fileName
switched order to$fileName
and$path
; The$path
argument now has a default value''
, denoting the root directory.
- The arguments
- Download File
- Updated:
- Manage Files
- Notes:
- Stream API
- Notes:
- Updating to the latest API specifications.
- Changes:
- Manage Videos
- Added:
- Get Video Heatmap
- Get Video Statistics
- Updated:
- Update Video
- Body parameters
- Upload Video
- Query parameters
- Fetch Video
- Input arguments
- Add Caption
- Body parameters
- Update Video
- Deleted:
- Fetch Video (to Collection)
- Added:
- Manage Videos
- Notes:
- Token Authentication
- Notes:
- Added optional argument
$speedLimit
. Limits download speed in kB/s.
- Added optional argument
- Notes:
- Image Processor
- Notes:
- Bug fix when supplying boolean values (e.g. flip/flop) were converted to integers.
- Notes:
- Migration to PHP 8.1.
- Addition of (backed) enum types.
- Internal usage of named arguments.
- Transforming from old "enum" classes to more explicit endpoint specific classes.
- Internal changes of array for query/body parameter templates to
AbstractParameter
class.
- Internal changes of array for query/body parameter templates to
- Decided on composition over inheritance when implementing PSR feature.
- Added issue templates for creating bug/feature reports.
- Updated/added phpmd, phpcs, phpstan, phpunit for contributions and in pipelines.
- Added documentation website to GitHub pages with the help of mkdocs (material).