Skip to content

Integrating ornicar's php-github-api into Symfony 2 in order to persist data received and limit Github API calls

Notifications You must be signed in to change notification settings

ihqs/GithubBundle

Repository files navigation

This bundle provides persistency for your Github API requests

Todo

  • Update readme file
  • Add mongodb configuration files
  • Add unit tests
  • Comment methods and attributes

Features

  • Compatible with Doctrine ORM and ODM thanks to a generic repository.
  • Authentication
  • Command lines to retrieve github data, useful to work with crontabs

Installation

Add GithubBundle to your src/ dir

    $ git submodule add git://github.com/ihqs/GithubBundle.git    src/IHQS/GithubBundle
    $ git submodule add git://github.com/ihqs/php-github-api.git  src/vendor/php-github-api

Add the php-github-api class to your project's autoload boostrap

    // src/autoload.php
    $loader->registerPrefixes(array(
        'phpGitHubApi' => $vendorDir.'/php-github-api/lib',
    ));

Add the IHQS namespace to your autoloader

    // app/autoload.php
    $loader->registerNamespaces(array(
        'IHQS' => __DIR__,
        // your other namespaces
    );

Add UserBundle to your application kernel

    // app/AppKernel.php

    public function registerBundles()
    {
        return array(
            // ...
            new IHQS\GithubBundle\IHQSGithubBundle(),
            // ...
        );
    }

Configuration

Config file config.yml

ihqs_github:
	db_driver: [orm|mongodb]
	github:
		login: [your login]
		secret: [your password]
		type: [user|organization] (by default: user)

Update your schema

    app/console doctrine:schema:update --force

Retreiving data

If the path to your sf2 console is "app/console", then you'll just have to type

	app/console ihqs:github:refresh

About

Integrating ornicar's php-github-api into Symfony 2 in order to persist data received and limit Github API calls

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages