PHP Bitbucket API

Simple Bitbucket API wrapper for PHP

Source

Allows you to browse directories and view files. NOTE: This is a read-only resource.

Prepare:

// @see: https://bitbucket.org/account/user/<username or team>/api
$oauth_params = array(
    'client_id'         => 'aaa',
    'client_secret'     => 'bbb'
);

$src = new \Bitbucket\API\Repositories\Src();
$src->getClient()->addListener(
    new \Bitbucket\API\Http\Listener\OAuth2Listener($oauth_params)
);

Get a list of the src in a repository.:

$src->get($account_name, $repo_slug, '1e10ffe', 'app/models/');

Get raw content of an individual file:

$src->raw($account_name, $repo_slug, '1e10ffe', 'app/models/core.php');