erivello/github-api-bundle

Bundle around PHP GitHub API client from KnpLabs

dev-develop 2013-02-16 21:40 UTC

This package is auto-updated.

Last update: 2024-04-27 20:10:23 UTC


README

This bundle provides a simple integration of the KnpLabs PHP GitHub API client into Symfony2.

Build Status

Installation

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(),
    );
}

Configure

Basic usage

erivello_github_api: ~

Cache usage

erivello_github_api:
    cache:
        # Select cache dir
        dir: '/tmp/dir'
        # Or select directly which cache you want to use
        file: '/tmp/file'

Usage

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');

License

The GithubApiBundle is licensed under the MIT license.