This bundle provides a simple integration of the KnpLabs PHP GitHub API client into Symfony2.
Installation is very easy, it makes use of Composer.
Add GithubApiBundle to your composer.json
"require": {
"erivello/github-api-bundle": "dev-master"
}
Register the bundle in app/AppKernel.php
:
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Erivello\GithubApiBundle\ErivelloGithubApiBundle(),
);
}
erivello_github_api: ~
erivello_github_api:
cache:
# Select cache dir
dir: '/tmp/dir'
# Or select directly which cache you want to use
file: '/tmp/file'
You can access the php-github-api
by the github_api
service:
<?php
$service = $this->container->get('github_api');
$client = $service->getClient();
$repositories = $client->api('user')->repositories('ornicar');
The GithubApiBundle is licensed under the MIT license.