Skip to content

Commit 5a86c0c

Browse files
author
Henry Smith
committed
First commit
0 parents  commit 5a86c0c

File tree

13 files changed

+950
-0
lines changed

13 files changed

+950
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
vendor
2+
tmp

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
language: php
2+
php:
3+
- 5.3
4+
- 5.4
5+
script: make build

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2014 BaseKit Platform Ltd
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
build: lint test
2+
3+
lint: vendor
4+
./vendor/bin/phpcs --standard=PSR2 src/
5+
./vendor/bin/phpcs --standard=PSR2 tests/
6+
7+
test: vendor
8+
./vendor/bin/phpunit
9+
10+
vendor:
11+
php composer.phar install
12+
13+
.PHONY: build lint test

README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
BaseKit REST API Client
2+
=======================
3+
4+
[![Build Status](https://secure.travis-ci.org/basekit/php-api-client.png)](http://travis-ci.org/basekit/php-api-client)
5+
[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/basekit/php-api-client/badges/quality-score.png?s=1ebfb26b984131090693ffca1ba26ede5354a037)](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

composer.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
3+
"name": "basekit/php-api-client",
4+
"description": "BaseKit PHP API client.",
5+
6+
"authors": [
7+
{
8+
"name": "Simon Best",
9+
"email": "simon@basekit.com"
10+
},
11+
{
12+
"name": "Ade Slade",
13+
"email": "adrian.slade@basekit.com"
14+
}
15+
],
16+
17+
"minimum-stability": "dev",
18+
19+
"autoload": {
20+
"psr-0": {
21+
"BaseKit": "src/"
22+
}
23+
},
24+
25+
"require": {
26+
"guzzle/guzzle": ">=v3.7.4"
27+
},
28+
29+
"require-dev": {
30+
"phpunit/phpunit": "3.7.*@dev",
31+
"squizlabs/php_codesniffer": "1.4.6"
32+
}
33+
34+
}

0 commit comments

Comments
 (0)