Download the PHP package bitbucket/client without Composer

On this page you can find all versions of the php package bitbucket/client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package client

Bitbucket PHP API Client

We present a modern Bitbucket API 2.0 client for PHP.

Banner

Build Status StyleCI Status 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 contribution guidelines.

Installation

This version supports PHP 8.1-8.5. 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

Framework Integration

Laravel:

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! This client exposes Bitbucket API 2.0 endpoints through fluent resource classes. 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:

HTTP Basic

It is possible to authenticate using HTTP Basic credentials. For Bitbucket API tokens, use your Atlassian account email as the username and the API token as the password:

Bitbucket API tokens are the long-term replacement for app passwords, which Bitbucket has deprecated. Do not use your Atlassian account password here.

JSON Web Token

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

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:

Example 2

It is possible to grab a repository as follows:

Example 3

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

Filtering and sorting parameters can be passed through the third argument to fetchAll():

Bitbucket includes those query parameters in the next pagination URL, so subsequent pages preserve them automatically.

To list files from a specific branch or commit, use the source API with ResultPager. Directory listings include both commit_file and commit_directory entries, so filter the returned values by type if you only need files:

Migrating Deprecated Bitbucket Endpoints

Bitbucket is removing or deprecating several cross-workspace endpoints. This client keeps the older methods available in v5.1, but marks them as deprecated where Bitbucket has published a supported replacement or removal notice.

Deprecated usage Replacement
$client->currentUser()->listWorkspaces() $client->currentUser()->workspaces()->list()
$client->currentUser()->listWorkspacePermissions() $client->currentUser()->workspaces()->permissions($workspace)->show()
$client->currentUser()->listRepositoryPermissions() $client->currentUser()->workspaces()->permissions($workspace)->repositories()->list()
$client->currentUser()->listTeamPermissions() Workspace APIs, where applicable
$client->pullRequests()->list($selectedUser) $client->workspaces($workspace)->pullRequests()->list($selectedUser)
$client->repositories()->list() $client->repositories()->workspaces($workspace)->list()
$client->users($user)->repositories()->list() $client->repositories()->workspaces($workspace)->list()
$client->snippets()->list() $client->snippets()->workspaces($workspace)->list()

The replacement endpoints are usually workspace-scoped. If your application previously relied on cross-workspace results, enumerate the current user's workspaces and aggregate the workspace-scoped results in your application code.

The supported current user workspaces endpoint returns workspace_access values, not the old workspace object shape. The workspace details are available under the workspace key on each result.

Contributing

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

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.


All versions of client with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-json Version *
php-http/cache-plugin Version ^2.0.1
php-http/client-common Version ^2.7.2
php-http/discovery Version ^1.20.0
php-http/httplug Version ^2.4.1
php-http/multipart-stream-builder Version ^1.4.2
psr/cache Version ^2.0 || ^3.0
psr/http-client-implementation Version ^1.0
psr/http-factory-implementation Version ^1.0
psr/http-message Version ^1.1 || ^2.0
symfony/polyfill-php82 Version ^1.27
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bitbucket/client contains the following files

Loading the files please wait ...