PHP code example of tournayrelabs / github-sdk-php

1. Go to this page and download the library: Download tournayrelabs/github-sdk-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tournayrelabs / github-sdk-php example snippets


use TournayreLabs\GitHubSDK\Configuration;
use TournayreLabs\GitHubSDK\Api\ReposApi;

$config = Configuration::getDefaultConfiguration()
    ->setAccessToken('your_github_personal_access_token');

$api = new ReposApi(new GuzzleHttp\Client(), $config);

// Get a repository
$repo = $api->reposGet('owner', 'repo');
echo $repo->getFullName();