halo-api / halo-api
A simple Object Oriented PHP API client for the halo api.
v0.4.0
2019-06-14 10:33 UTC
Requires
- php: ^5.6 || ^7.0
- php-http/client-common: ^1.5
- php-http/discovery: ^1.2
- php-http/httplug: ^1.1
Requires (Dev)
- php-http/guzzle6-adapter: ^1.1
- phpunit/phpunit: ^5.7 || ^6.0
This package is auto-updated.
Last update: 2025-04-20 12:27:39 UTC
README
A simple Object Oriented wrapper for Halo API
Getting started
Features
- Follows PSR-4 conventions and coding standard
- Light and fast by lazy loading of API classes
- Extensively tested
- Decoupled from specific HTTP transport protocols by using HTTPlug
Install
Then run the following command to require the library and install a http transport adapter:
composer require halo-api/halo-api php-http/guzzle6-adapter "^1.1"
Usage
Example code on how to use the api client
<?php require_once '/vendor/autoload.php'; $guzzleClient = new \Http\Adapter\Guzzle6\Client(); $builder = new \HaloApi\HttpClient\Builder($guzzleClient); // Constructing and passing the builder is optional. The client will use // auto discovery of the available http client to construct the builder (See mininal example) $client = new \HaloApi\Client('apikey', $builder); $result = $client->halo5Metadata()->campaignMissions(); // Or with minimal setup (an httplug client adapter must be installed) $client = new \HaloApi\Client('apikey'); $result = $client->halo5Metadata()->campaignMissions();
Contribute
Please do! The source code is hosted at GitHub. If you want a feature or discover a bug, open an issue or a pull request.
For other updates, follow me on Twitter: @jeroenthora.
License
This project is released under the MIT License.