A simple Object Oriented wrapper for GitHub API, written with PHP5.
Uses GitHub API v3. The object API is very similar to the RESTful API.
- Follows PSR-0 conventions and coding standard: autoload friendly
- Light and fast thanks to lazy loading of API classes
- Extensively tested and documented
- PHP >= 5.4
- (optional) php-httplug/guzzle5-adapter to use with a guzzle 5 http client
- (optional) php-httplug/guzzle6-adapter to use with a guzzle 6 http client
The first step to use php-github-api
is to download composer:
$ curl -s http://getcomposer.org/installer | php
Then run the following command to require the library:
$ php composer.phar require knplabs/github-api
php-github-api
follows the PSR-4 convention names for its classes, which means you can easily integratephp-github-api
classes loading in your own autoloader.
Laravel GitHub by Graham Campbell might interest you.
<?php
// This file is generated by Composer
require_once 'vendor/autoload.php';
$client = new \Github\Client(
new \Github\HttpClient\HttplugClient(
new \Http\Adapter\Guzzle6\Client( // Only available when you require the php-httplug/guzzle6-adapter lib
new \GuzzleHttp\Client()
),
new \Github\Factory\RequestFactory()
)
);
$users = $client->api('user')->all();
From $client
object, you can access to all GitHub.
TBD
See the doc
directory for more detailed documentation.
php-github-api
is licensed under the MIT License - see the LICENSE file for details
- Thanks to Thibault Duplessis aka. ornicar for his first version of this library.
- Thanks to Joseph Bielawski aka. stloyd for his contributions and support.
- Thanks to noloh for his contribution on the Object API.
- Thanks to bshaffer for his contribution on the Repo API.
- Thanks to Rolf van de Krol for his countless contributions.
- Thanks to Nicolas Pastorino for his contribution on the Pull Request API.
- Thanks to Edoardo Rivello for his contribution on the Gists API.
Thanks to GitHub for the high quality API and documentation.