定制 fgrosse/gitlab-api 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

fgrosse/gitlab-api

最新稳定版本:0.9.0

Composer 安装命令:

composer require fgrosse/gitlab-api

包简介

A guzzle 5 client for the gitlab API using service descriptions

README 文档

README

PHP Gitlab API

Build Status HHVM Status PHP 7 ready Coverage Status Scrutinizer Code Quality

Latest Stable Version Latest Unstable Version License

This is a php client for the gitlab API. This client bases on Guzzle 5 with service descriptions. You can have a quick overview of the implemented gitlab APIs in the yml files in lib/Client/ServiceDescription.

Implemented APIs (Gitlab ~7.7)

Dependencies

Gitlab-api requires at least PHP 5.5 and also been successfully tested using PHP 7 and HHVM. Furthermore the whole client is build upon the awesome Guzzle Services by Michael Dowling.

Installation

The preferred way to install this library is to rely on Composer:

$ composer require fgrosse/gitlab-api

Usage

The API is still work in progress and the actual usage might change in the future.

The stable part of this API is available through the GitlabClient interface:

$guzzleClient = GitlabGuzzleClient::factory([
    'base_url'  => $baseUrl,
    'api_token' => $token,
]);

$client = new HttpGitlabClient($guzzleClient);

$mergeRequests = $client->listMergeRequests($project,
    $state='closed',
    $order='updated_at',
    $sort='asc',
    $page=1, $perPage=5
);

If you want to access more functionality consider using the GitlabClient directly:

$client = GitlabClient::factory([
    'base_url'  => $baseUrl,
    'api_token' => $token,
]);

$mergeRequests = $client->listMergeRequests([
    'project_id' => $project,
    'state'      => 'closed',
    'order_by'   => 'updated_at',
    'sort'       => 'asc',
    'page'       => 0,
    'per_page'   => 5,
]);

Checkout the lib/Client/ServiceDescription to see the available parameters for each API call. An executable example can be found in examples/merge_requests/api.php.

Not implemented APIs (yet)

  • deploy_key_multiple_projects API
  • deploy_keys API
  • groups API
  • milestones API
  • notes API
  • oauth2 API
  • project_snippets API
  • projects API
  • repositories API
  • repository_files API
  • services API
  • session API
  • system_hooks API
  • users API

License

This library is distributed under the MIT License.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-09-26