rbayliss/bitbucket-api

Bitbucket.org 的 API 提供商

0.1.0 2015-01-25 08:11 UTC

This package is not auto-updated.

Last update: 2024-09-10 15:37:09 UTC


README

此库使用 Guzzle HTTP 库实现了 Bitbucket V2 API。

目前没有尝试实现任何 V1 功能。

使用方法

#!php
// Access the Bitbucket APIs without authentication
$api = new \rbayliss\BitbucketAPI\Bitbucket();

// Access the APIs using username/password authentication:
$api = new \rbayliss\BitbucketAPI\Bitbucket([
  'login' => [
    'yourusername',
    'yourpassword',
  ]
]);

// Access the APIs using OAuth authentication:
$api = new \rbayliss\BitbucketAPI\Bitbucket([
  'oauth' => [
    'key' => 'YOURKEY',
    'secret' => 'YOURSECRET',
  ]
]);

该项目实现了所有 V2 Bitbucket 端点。这些端点是

  • 用户 - $api->users()
  • 团队 - $api->teams()
  • 仓库 - $api->repositories()
  • 提交 - $api->commits()
  • 分支限制 - $api->branchRestrictions()