This is a simple, object oriented PHP5 client for GitHub's API (v3), implemented with an intentionally similar API to GitHub's native RESTful API.
- Code Standards: Implements PSR-0 code and structure standards to accommodate auto-loading using Composer or another class auto-loading solution.
- Speed and Familiarity: Lightweight, fast, and friendly object model utilizing lazy loading with an intentional similarly to GitHub's own RESTful API.
- Tests and Continuous Integration: Extensive PHPUnit tests utilizing Travis CI as our continuous integration service.
- Quality, Coverage and Dependencies: Code quality reports with Code Climate, coverage reports with Coveralls, and dependency version monitoring using Gemnasium.
- Documentation and Examples: Comprehensive examples written in markdown and automatically generated API documentationn.
This library requires a short list of dependencies for both a production installation or a development build.
- PHP >= 5.5 or HHVM
- The Curl extension
- The Guzzle HTTP request framework
- PHPUnit >= 4.0
- Coveralls Reporter >= 0.6.1
- Code Climate Reporter >= 0.1.2
- Sami >= 2.0
This library can be included into your project easily using Composer by adding the dependency to the require
section of your composer.json
project file.
{
"require": {
"scribe/github-api-library": "dev-master"
}
}
<?php
require_once 'vendor/autoload.php';
$client = new \Github\Client();
$repositories = $client->api('user')->repositories('ornicar');
<?php
require_once 'vendor/autoload.php';
$client = new \Github\Client(
new \Github\HttpClient\CachedHttpClient(array('cache_dir' => '/tmp/github-api-cache'))
);
$client = new \Github\HttpClient\CachedHttpClient();
$client->setCache(
new \Github\HttpClient\Cache\FilesystemCache('/tmp/github-api-cache')
);
$client = new \Github\Client($client);
For general usage and examples, you can check the doc directory. For a comprehensive API reference, check this project's github.io webpage.
This project has code contributed from an array of individuals.