Download the PHP package timacdonald/kumulos without Composer
On this page you can find all versions of the php package timacdonald/kumulos. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download timacdonald/kumulos
More information about timacdonald/kumulos
Files in timacdonald/kumulos
Informations about the package kumulos
Kumulos PHP API SDK Package
This package is a modern PHP SDK for the Kumulos API.
Installation
You can install using composer from Packagist.
Although it is not recommended, because this package does not contain any dependencies, you can simply download and include the files in your project.
Versioning
This package uses Semantic Versioning. You can find out more about what this is and why it matters by reading the spec or for something more readable, check out this post.
Usage
Create a Kumulos API object and then simply call the methods you've created in your API on the API object.
Normalized Status Codes
Kumulos responds with custom status codes, but if you would like to normalize these status codes to the standard HTTP response codes, you can simply call the following methods:
Wiring Up DI in Laravel
If you are utilising the Laravel framework, you will want to put you API key and secret in you environment (.env) file.
The in your ./config/services.php
file, you can add the Kumulos service like so:
Great. Now the config is sorted, lets bind it to the IOC container. In your app service provider's register method, simply add the following binding method:
Now you can have the container resolve your API class for you without having to 'new' up an instance.
What Next
- Add ability to force standardised response messages and code.
- Add Laravel service provider for binding as per docs.
- Throw exceptions instead of checking for failure.
Thanksware
You are free to use this package, but I ask that you reach out to someone (not me) who has previously, or is currently, maintaining or contributing to an open source library you are using in your project and thank them for their work. Consider your entire tech stack: packages, frameworks, languages, databases, operating systems, frontend, backend, etc.