Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
PHP
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
Model
.gitignore
README.md
composer.json

README.md

GitHub plugin

Installation

  • Clone/Copy the files in this directory into app/Plugin/GitHub

This can be done with the git submodule command

git submodule add https://github.com/mms-projects/cakephp-github-plugin.git app/Plugin/DebugKit
  • Ensure the plugin is loaded in app/Config/bootstrap.php by calling CakePlugin::load('GitHub');

Using Composer

Ensure require is present in composer.json. This will install the plugin into Plugin/GitHub:

{
    "require": {
        "cvo-technologies/github": "*"
    }
}

Usage

If you want to get information about a specific repository

Database config

<?php

class DATABASE_CONFIG {
    public $cakephpRepository = array(
        'datasource' => 'GitHub.RepositorySource',
        'owner'      => 'cakephp',
        'repository' => 'cakephp'
    );
}

Controller

<?php

App::uses('AppController', 'Controller');

class IssuesController extends AppController {

    public $uses = array('GitHub.Issue');

    public function index() {
        $this->Issue->setDataSource('cakephpRepository');

        $issues = $this->Issue->find('all', array(
            'conditions' => array(
                'Issue.state' => 'open'
            )
        ));

        $this->set(compact('issues'));
    }

}
Something went wrong with that request. Please try again.