此包已被废弃,不再维护。作者建议使用cvo-technologies/cakephp-github包。

GitHub的CakePHP Web服务实现

安装: 131

依赖项: 0

建议者: 0

安全性: 0

星标: 8

关注者: 3

分支: 3

开放问题: 1

类型:cakephp-plugin

1.1.1 2016-08-08 00:12 UTC

This package is not auto-updated.

Last update: 2022-02-01 12:36:14 UTC


README

Software License Build Status Coverage Status Total Downloads Latest Stable Version

安装

使用Composer

确保在composer.json中存在require。这将把插件安装到Plugin/GitHub

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

使用方法

如果您想获取有关特定仓库的信息

Web服务配置

将以下内容添加到您的应用程序配置中的Webservice部分。

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

控制器

<?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);
    }
}