Via Composer
$ composer require potherca/flysystem-githubThe Github adapter can be used without credentials to do read-only actions on public repositories. To save changes or read from private repositories, credentials are required.
To avoid the Github API limit or to save traffic caching can be utilized.
use Github\Client;
use League\Flysystem\Filesystem;
use Potherca\Flysystem\Github\GithubAdapter;
$project = 'thephpleague/flysystem';
$client = new Client();
$adapter = new GithubAdapter($client, $project);
$filesystem = new Filesystem($adapter);use Github\Client;
use League\Flysystem\Filesystem;
use Potherca\Flysystem\Github\GithubAdapter;
$project = 'thephpleague/flysystem';
$client = new Client();
$client->authenticate($token, null, Client::AUTH_HTTP_TOKEN);
// or $client->authenticate($username, $password, Client::AUTH_HTTP_PASSWORD);
$adapter = new GithubAdapter($client, $project);
$filesystem = new Filesystem($adapter);For full details, see the php-github-api documentation concerning authentication.
use Github\Client;
use Github\HttpClient\CachedHttpClient as CachedClient;
use Github\HttpClient\Cache\FilesystemCache as Cache;
use League\Flysystem\Filesystem;
use Potherca\Flysystem\Github\GithubAdapter;
$project = 'thephpleague/flysystem';
$cache = new Cache('/tmp/github-api-cache')
$cacheClient = new CachedClient();
$cacheClient->setCache($cache);
$client = new Client($cacheClient);
$adapter = new GithubAdapter($client, $project);
$filesystem = new Filesystem($adapter);$ composer testPlease see CONTRIBUTING for details.
If you discover any security related issues, please email potherca@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.