All Projects → BitbucketPHP → Client

BitbucketPHP / Client

Licence: MIT license
Bitbucket API 2.0 client for PHP

Programming Languages

PHP
23972 projects - #3 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to Client

go-bitbucket-v1
Bitbucket-server API (v1.0) library for Golang.
Stars: ✭ 45 (-47.06%)
Mutual labels:  bitbucket, bitbucket-api
migrate bitbucket server to bitbucket cloud
Migrate Atlassian Bitbucket Server to Bitbucket Cloud
Stars: ✭ 13 (-84.71%)
Mutual labels:  bitbucket, bitbucket-api
Env Ci
Get environment variables exposed by CI services
Stars: ✭ 180 (+111.76%)
Mutual labels:  bitbucket
playwright-ci
☁️ Set up Playwright in CI
Stars: ✭ 27 (-68.24%)
Mutual labels:  bitbucket
Git Link
Emacs package to get the GitHub/Bitbucket/GitLab/... URL for a buffer location
Stars: ✭ 239 (+181.18%)
Mutual labels:  bitbucket
Grav Plugin Git Sync
Collaboratively Synchronize your Grav `user` folder hosted on GitHub, BitBucket or GitLab
Stars: ✭ 183 (+115.29%)
Mutual labels:  bitbucket
Docker Android Build Box
An optimized docker image includes Android, Kotlin, Flutter sdk.
Stars: ✭ 245 (+188.24%)
Mutual labels:  bitbucket
Source Integration
Source control integration plugin framework for MantisBT, including support for Github, Gitlab, Bitbucket, Gitweb, Cgit, Subversion, Mercurial and more
Stars: ✭ 167 (+96.47%)
Mutual labels:  bitbucket
gitcolombo
🧬 Extract and analyze contributors info from git repos
Stars: ✭ 55 (-35.29%)
Mutual labels:  bitbucket
Git Open
Type `git open` to open the GitHub page or website for a repository in your browser.
Stars: ✭ 2,694 (+3069.41%)
Mutual labels:  bitbucket
Bitbucket.Net
C# client for Atlassian Bitbucket Server
Stars: ✭ 29 (-65.88%)
Mutual labels:  bitbucket
Pronto
Quick automated code review of your changes
Stars: ✭ 2,450 (+2782.35%)
Mutual labels:  bitbucket
Rabbit
⚡️ A lightweight service that will build and store your go projects binaries, Integrated with Github, Gitlab, Bitbucket and Bitbucket Server.
Stars: ✭ 185 (+117.65%)
Mutual labels:  bitbucket
Git Auto Deploy
Deploy your GitHub, GitLab or Bitbucket projects automatically on Git push events or web hooks
Stars: ✭ 251 (+195.29%)
Mutual labels:  bitbucket
Hooka
😎 A webhook server with zero coding
Stars: ✭ 180 (+111.76%)
Mutual labels:  bitbucket
10-days-of-git-and-github
asabeneh.github.io/10-days-of-git-and-github/
Stars: ✭ 786 (+824.71%)
Mutual labels:  bitbucket
Bitbucket Branch Source Plugin
Bitbucket Branch Source Plugin
Stars: ✭ 172 (+102.35%)
Mutual labels:  bitbucket
Showingithub
Xcode plugin to open the GitHub page of the commit of the currently selected line in the editor window.
Stars: ✭ 243 (+185.88%)
Mutual labels:  bitbucket
Cgx
💻🔥CLI to generate the recommended documentation/files to improve contribution (Github, Gitlab, CodeCommit and Bitbucket)
Stars: ✭ 190 (+123.53%)
Mutual labels:  bitbucket
badwolf
Docker based continuous integration, continuous deployment and code lint review system for BitBucket
Stars: ✭ 88 (+3.53%)
Mutual labels:  bitbucket

Bitbucket PHP API Client

We present a modern Bitbucket API 2.0 client for PHP.

Banner

Build Status StyleCI Status Software License Packagist Downloads Latest Version

This is strongly based on php-github-api by KnpLabs. With this in mind, we now have very similar clients for:

Check out the change log, releases, security policy, license, code of conduct, and contribution guidelines.

Installation

This version supports PHP 7.4-8.1. To get started, simply require the project using Composer. You will also need to install packages that "provide" psr/http-client-implementation and psr/http-factory-implementation.

Standard Installation

$ composer require "bitbucket/client:^4.2" "guzzlehttp/guzzle:^7.4" "http-interop/http-factory-guzzle:^1.2"

Framework Integration

Laravel:

$ composer require "graham-campbell/bitbucket:^9.0"

We are decoupled from any HTTP messaging client by using PSR-7, PSR-17, PSR-18, and HTTPlug. You can visit HTTPlug for library users to get more information about installing HTTPlug related packages. The framework integration graham-campbell/bitbucket is by Graham Campbell.

Usage

The main point of entry is the Bitbucket\Client class. Simply create a new instance of that, authenticate, and you're good to go! As of time of writing (Tuesday 29th June 2020), every endpoint (excluding issue export and import, and various deprecated endpoints) available on the Bitbucket API 2.0 is also available through this PHP client. We'd recommend looking through the Bitbucket documentation, and also the source code to get a full picture of what is available to use.

Authentication

There are three ways to authenticate our client:

OAuth 2 Token

The most common way to authenticate is using an OAuth 2 token. You will need to generate this by some means outside of the library, and then provide it as below:

$client = new Bitbucket\Client();

$client->authenticate(
    Bitbucket\Client::AUTH_OAUTH_TOKEN,
    'your-token-here'
);

HTTP Password

It is possible to login using a username and password combination. This method is not recommended for production use, however you may find it useful never the less:

$client = new Bitbucket\Client();

$client->authenticate(
    Bitbucket\Client::AUTH_HTTP_PASSWORD,
    'your-username-here',
    'your-password-here'
);

If you have two-factor authentication enabled on your account, then you must use an application password.

JSON Web Token

Finally, we support logging in using JSON web tokens (JWTs). This method is exclusively required by some of Bitbucket's API endpoints, such as the addons API. Generate your JWT, perahps using lcobucci/jwt, then provide it as below:

$client = new Bitbucket\Client();

$client->authenticate(
    Bitbucket\Client::AUTH_JWT,
    'your-jwt-here'
);

Examples

In the following examples, $client will be an authenticated client, as above.

Example 1

It is possible to show basic information about the currently logged in user:

$currentUser = $client->currentUser()->show();

Example 2

It is possible to grab a repository as follows:

$repository = $client->repositories()
    ->workspaces('atlassian')
    ->show('stash-example-plugin');

Example 3

We support automatic pagination without you having to lift a finger. The following example gets all branches of a repository:

$paginator = new Bitbucket\ResultPager($client);

$branchesClient = $client->repositories()
    ->workspaces('atlassianlabs')
    ->refs('stash-log-parser'])
    ->branches();

$branches = $paginator->fetchAll($branchesClient, 'list');

Contributing

We will gladly receive issue reports and review and accept pull requests, in accordance with our code of conduct and contribution guidelines!

$ make install
$ make test

Security

If you discover a security vulnerability within this package, please send an email to Graham Campbell at [email protected]. All security vulnerabilities will be promptly addressed. You may view our full security policy here.

License

Bitbucket PHP API Client is licensed under The MIT License (MIT).

For Enterprise

Available as part of the Tidelift Subscription

The maintainers of bitbucket/client and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].