PHP code example of rmasters / github-service-provider

1. Go to this page and download the library: Download rmasters/github-service-provider 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/ */

    

rmasters / github-service-provider example snippets


    $app = new Silex\Application;
    $app = new Pimple\Container;

    $app->register(new Rossible\Provider\GitHubProvider\GitHubServiceProvider);
    

// Toggle the caching variable
$app['github.httpclient.caching'] = false;

// Use a subdirectory in the temp directory
$app->extend('github.httpclient.cache.path', function($path, $app) {
    $path .= '/github-responses';
    mkdir($path, 776);

    return $path;
});

// Set a custom Accept header to access pre-release features
$app->extend('github.httpclient', function (HttpClientInterface $httpclient, $app) {
    $httpclient->setHeaders(['Accept' => 'application/vnd.github.she-hulk-preview+json']);

    return $httpclient;
});