Easily integrates GitHub API in your site, in a Object Oriented way

dmGithubPlugin allows to connect your site with GitHub.
It bundles php-github-api, an object oriented GitHub API for PHP5.
It packages two Diem front widgets to display issues and commits.

See it in action on Diem Development page.

Installation

  • In a console, from your project root dir, run:
git clone git://github.com/ornicar/dmGithubPlugin.git plugins/dmGithubPlugin  
  • In config/ProjectConfiguration.class.php, add dmGithubPlugin to the list of enabled plugins:
class ProjectConfiguration extends dmProjectConfiguration
{  
  public function setup()  
  {  
    parent::setup();  
 
    $this->enablePlugins(array(  
      // your enabled plugins  
      'dmGithubPlugin'  
    ));  
  • In a console, from your project root dir, run:
php symfony dm:setup  

Front Widgets

GitHub List Issues widget

This widget lists issues for a given repository.
To use it, just drag&drop a GitHub/List Issues widget somewhere on your site.

Options

Configure the widget on the widget edition dialog:
- user The repository user
- repo The repository name
- state The issue state. Can be "closed" or "open".
- nb_issues Number of issues to display.
- life_time Duration of the cache in seconds.

Customize the template

Copy
plugins/dmGithubPlugin/modules/dmWidget/templates/_dmWidgetGithubListIssues.php
to
apps/front/modules/dmWidget/templates/_dmWidgetGithubListIssues.php
then modify it.

GitHub List Commits widget

This widget lists commits for a given repository and branch.
To use it, just drag&drop a GitHub/List Commits widget somewhere on your site.

Options

Configure the widget on the widget edition dialog:
- user The repository user
- repo The repository name
- branch The branch name. Defaults to "master".
- nb_commits Number of commits to display.
- life_time Duration of the cache in seconds.

Customize the template

Copy
plugins/dmGithubPlugin/modules/dmWidget/templates/_dmWidgetGithubListCommits.php
to
apps/front/modules/dmWidget/templates/_dmWidgetGithubListCommits.php
then modify it.

GitHub API

This plugin provides php-github-api. It allows you to request any GitHub service.

Exemple:

$api = new phpGitHubApi();
$issues = $api->listIssues('diem-project', 'diem', 'closed');  

View php-github-api documentation.

    Add a comment

    Open issues

      Closed issues

        dmGithubPlugin, created on February 15, 2010 by Thibault D, used by 65 projects

        Fork Diem on GitHub