muffin/github 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

muffin/github

最新稳定版本:1.0

Composer 安装命令:

composer require muffin/github

包简介

Github Webservice (API) for CakePHP 3.

README 文档

README

Build Status Coverage Total Downloads License

Github Webservice (API) for CakePHP 3.

Install

Using Composer:

composer require muffin/github:dev-master

You then need to load the plugin. You can use the shell command:

bin/cake plugin load Muffin/Github

or by manually adding statement shown below to boostrap.php:

Plugin::load('Muffin/Github');

Usage

In your app.php, configure your github service like any other configuration, by adding a new element to the configure array:

    'Webservices' => [
        'github' => [
            'className' => 'Muffin\Webservice\Connection',
            'service' => 'Muffin/Github.Github',
        ]
    ]

or, to use a token for example (and full namespaced driver):

    'Webservices' => [
        'github' => [
            'className' => 'Muffin\Webservice\Connection',
            'service' => 'Muffin\Github\Webservice\Driver\Github',
            'token' => env('GITHUB_TOKEN'),
        ]
    ]

or using your username/password combination:

    'Webservices' => [
        'github' => [
            'className' => 'Muffin\Webservice\Connection',
            'service' => 'Muffin/Github.Github',
            'username' => env('GITHUB_USERNAME'),
            'password' => env('GITHUB_PASSWORD'),
        ]
    ]

or using your client ID and secret:

    'Webservices' => [
        'github' => [
            'className' => 'Muffin\Webservice\Connection',
            'service' => 'Muffin/Github.Github',
            'clientId' => env('GITHUB_CLIENT_ID'),
            'secret' => env('GITHUB_SECRET'),
        ]
    ]

You will also need to load the webservices if you haven't already done that in your bootstrap.php file:

ConnectionManager::config(Configure::consume('Webservices'));

Now, from anywhere, you could call the webservice like so:

$connection = ConnectionManager:get('github');
$repo = $connection->api('repo')->show('usemuffin', 'github');

Patches & Features

  • Fork
  • Mod, fix
  • Test - this is important, so it's not unintentionally broken
  • Commit - do not mess with license, todo, version, etc. (if you do change any, bump them into commits of their own that I can ignore when I pull)
  • Pull request - bonus point for topic branches

To ensure your PRs are considered for upstream, you MUST follow the CakePHP coding standards.

Bugs & Feedback

http://github.com/usemuffin/github/issues

License

Copyright (c) 2015, [Use Muffin] and licensed under The MIT License.

统计信息

  • 总下载量: 1.18k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-04-29