guillermoandrae / php-github
A PHP client library for the GitHub API.
0.3.0
2015-03-11 02:08 UTC
Requires
- php: >=5.4.0
- doctrine/cache: @stable
- guzzlehttp/cache-subscriber: 0.1.*@dev
- guzzlehttp/guzzle: ~5.0
- icanboogie/inflector: @stable
Requires (Dev)
- phing/phing: @stable
- phpunit/phpunit: ~4.0
- squizlabs/php_codesniffer: @stable
This package is auto-updated.
Last update: 2024-10-29 04:59:06 UTC
README
A PHP client library for the GitHub API.
Installation
The recommended way to install this library is via Composer:
{
"require": {
"guillermoandrae/php-github": "*"
}
}
Basic Usage
The basic client uses Guzzle to communicate with the GitHub API. Instantiation of the client is straight-forward:
// create the client $client = new GitHub\Client\Client();
Resources are represented as objects, and resource data is fetched through the use of object mappers:
// pick a resource and get some useful data, like so... $users = $client->resource('user')->findAll(); foreach ($users as $user) { printf('%s has %d followers.', $user->getLogin(), $user->getNumFollowers()); echo PHP_EOL; } // or like so... $org = $client->resource('organization')->find('github'); echo $org->getLocation(); // .. and rejoice! echo 'YEESSSSSSSSSSSS!';