|
| 1 | +BaseKit REST API Client |
| 2 | +======================= |
| 3 | + |
| 4 | +[](http://travis-ci.org/basekit/php-api-client) |
| 5 | +[](https://scrutinizer-ci.com/g/basekit/php-api-client/) |
| 6 | + |
| 7 | +A PHP client for [BaseKit]'s REST API. This client will provide documentation of |
| 8 | +the services available from the BaseKit API, describing URIs, HTTP methods and |
| 9 | +input parameters. |
| 10 | + |
| 11 | +Installation |
| 12 | +------------ |
| 13 | + |
| 14 | +The recommended way of including this package in your project is by using |
| 15 | +Composer. Add it to the `require` section of your project's `composer.json`. |
| 16 | + |
| 17 | + "basekit/php-api-client": "dev-master" |
| 18 | + |
| 19 | +Usage |
| 20 | +----- |
| 21 | + |
| 22 | +```php |
| 23 | +<?php |
| 24 | + |
| 25 | +require 'vendor/autoload.php'; |
| 26 | +use BaseKit\Api\Client; |
| 27 | + |
| 28 | +$client = Client::factory( |
| 29 | + array( |
| 30 | + 'base_url' => 'http://api.example.org', |
| 31 | + 'consumer_key' => '1234567890', |
| 32 | + 'consumer_secret' => 'qwertyuiop', |
| 33 | + 'token' => 'asdfghjkl', |
| 34 | + 'token_secret' => 'zxcvbnm', |
| 35 | + ) |
| 36 | +); |
| 37 | + |
| 38 | +$createSite = $client->getCommand( |
| 39 | + 'CreateSite', |
| 40 | + array( |
| 41 | + 'accountHolderRef' => 123, |
| 42 | + 'brandRef' => 456, |
| 43 | + 'domain' => 'test.example.org', |
| 44 | + ) |
| 45 | +); |
| 46 | +$response = $createSite->execute(); |
| 47 | +print_r($response); |
| 48 | +``` |
| 49 | + |
| 50 | +Contributing |
| 51 | +------------ |
| 52 | + |
| 53 | +This project adheres to the [PSR2] coding style guide. Checking your |
| 54 | +contribution's correctness is easy. |
| 55 | + |
| 56 | +```bash |
| 57 | +$ make lint |
| 58 | +``` |
| 59 | + |
| 60 | +There's a very small unit test suite, using [PHPUnit]. Making sure you haven't |
| 61 | +broken any tests is easy too. |
| 62 | + |
| 63 | +```bash |
| 64 | +$ make test |
| 65 | +``` |
| 66 | + |
| 67 | +License |
| 68 | +------- |
| 69 | + |
| 70 | +This software is released under the [MIT License]. |
| 71 | + |
| 72 | +[BaseKit]: http://basekit.com/ |
| 73 | +[PHPUnit]: http://phpunit.de/ |
| 74 | +[PSR2]: http://www.php-fig.org/psr/psr-2/ |
| 75 | +[MIT License]: http://www.opensource.org/licenses/MIT |
0 commit comments