CVO-Technologies / cakephp-github

GitHub webservice plugin for CakePHP

Home Page:https://cvo-technologies.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitHub plugin

Software License Build Status Coverage Status Total Downloads Latest Stable Version

Installation

Using Composer

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

{
    "require": {
        "cvo-technologies/cakephp-github": "~1.1"
    }
}

Usage

If you want to get information about a specific repository

Webservice config

Add the following to the Webservice section of your application config.

        'git_hub' => [
            'className' => 'Muffin\Webservice\Connection',
            'service' => 'CvoTechnologies/GitHub.GitHub',
        ]

Controller

<?php

namespace CvoTechnologies\GitHub\Controller;

use Cake\Controller\Controller;
use Cake\Event\Event;

class IssuesController extends Controller
{

    public function beforeFilter(Event $event)
    {
        $this->loadModel('CvoTechnologies/GitHub.Issues', 'Endpoint');
    }

    public function index()
    {
        $issues = $this->Issues->find()->where([
            'owner' => 'cakephp',
            'repo' => 'cakephp'
        ]);

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

About

GitHub webservice plugin for CakePHP

https://cvo-technologies.com

License:MIT License


Languages

Language:PHP 100.0%