require_once 'vendor/autoload.php'; use Gitonomy\Git\Repository; $repo = new Repository('/path/to/repository'); $commit = $repo->getHeadCommit(); $message = $commit->getMessage(); echo "Latest commit message: ".$message;
require_once 'vendor/autoload.php'; use Gitlab\Client; $client = new Client('http://gitlab.com'); $issues = $client->api('issues')->all('username/repository'); foreach ($issues as $issue) { echo $issue['title']."\n"; }
require_once 'vendor/autoload.php'; use Bitbucket\API\Api; use Bitbucket\API\Authentication\BasicAuthenticator; $auth = new BasicAuthenticator('', 'api_key'); $api = new Api(); $api->setCredentials($auth); $prList = $api->repositories()->pullRequests()->all('owner', 'repository'); foreach ($prList['values'] as $pr) { echo $pr['title']."\n"; }This example uses the Bitbucket API for PHP package to get a list of pull requests from a Bitbucket repository.