codappix / bitbucket-client
A Modern Bitbucket API 2.0 Client
Requires
- php: ^7.1.3
- graham-campbell/cache-plugin: ^1.0
- php-http/client-common: ^1.7
- php-http/client-implementation: ^1.0
- php-http/discovery: ^1.4
- php-http/httplug: ^1.1
- php-http/multipart-stream-builder: ^1.0
- psr/cache: ^1.0
- psr/http-message: ^1.0
Requires (Dev)
- graham-campbell/analyzer: ^2.0
- php-http/guzzle6-adapter: ^1.0
- phpunit/phpunit: ^7.0
Replaces
This package is not auto-updated.
Last update: 2019-10-17 14:01:35 UTC
README
We present a modern Bitbucket API 2.0 client, by Graham Campbell.
This is strongly based on php-github-api by KnpLabs. With this in mind, we now have very similar clients for:
- GitHub - knplabs/github-api by KnpLabs.
- GitLab - m4tthumphrey/php-gitlab-api by Matt Humphrey et al.
- Bitbucket - bitbucket/client which is this package!
Installation
This version requires PHP 7.1 or 7.2.
To get the latest version, simply require the project using Composer:
$ composer require bitbucket/client
Usage
The main point of entry is the Bitbucket\Client
class. Simply create a new instance of that, and you're good to go!
Practically, you will also want to set authentication details before calling any of the endpoint, however, this is not required to call endpoints for which authentication is not needed. We support logging in with an OAuth2 token, or with a username and password.
<?php use Bitbucket\Client; $c = new Client(); $c->authenticate(Client::AUTH_OAUTH_TOKEN, 'your-token-here'); // $c->authenticate(Client::AUTH_HTTP_PASSWORD, 'your-username', 'your-password'); var_dump($c->currentUser()->show());
As of time of writing (Monday 4th April 2018), every endpoint available on the Bitbucket API 2.0 is also available through this PHP client. I'd recommend looking through the Bitbucket documentation, and also the generated documentation.
Security
If you discover a security vulnerability within this package, please send an e-mail to Graham Campbell at graham@alt-three.com. All security vulnerabilities will be promptly addressed.
License
Alt Three Storage is licensed under The MIT License (MIT).