2017 © Pedro Peláez
 

library flysystem-github

Flysystem adapter for Github

image

potherca/flysystem-github

Flysystem adapter for Github

  • PHP
  • 2 Dependents
  • 1 Suggesters
  • 5 Forks
  • 2 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

Flysystem Adapter for Github

Latest Version Software License Build Status Coverage Status Quality Score Total Downloads, (*1)

Install

Via Composer, (*2)

``` bash $ composer require potherca/flysystem-github, (*3)


## Usage The Github adapter can be used *without* credentials to do read-only actions on public repositories. To avoid reaching the Github API limit, to save changes, or to read from private repositories, credentials are required. Caching can be utilized to save traffic or to postpone reaching the Github API limit. ### Basic Usage ```php use Github\Client; use League\Flysystem\Filesystem; use Potherca\Flysystem\Github\Api; use Potherca\Flysystem\Github\GithubAdapter; use Potherca\Flysystem\Github\Settings; $project = 'thephpleague/flysystem'; $settings = new Settings($project); $api = new Api(new Client(), $settings); $adapter = new GithubAdapter($api); $filesystem = new Filesystem($adapter);

Authentication

use Github\Client;
use League\Flysystem\Filesystem;
use Potherca\Flysystem\Github\Api;
use Potherca\Flysystem\Github\GithubAdapter;
use Potherca\Flysystem\Github\Settings;

$project = 'thephpleague/flysystem';
$credentials = [Settings::AUTHENTICATE_USING_TOKEN, '83347e315b8bb4790a48ed6953a5ad9e825b4e10'];
// or $authentications = [Settings::AUTHENTICATE_USING_PASSWORD, $username, $password];

$settings = new Settings($project, $credentials);

$api = new Api(new Client(), $settings);
$adapter = new GithubAdapter($api);
$filesystem = new Filesystem($adapter);

Cache Usage

use Github\Client;
use Github\HttpClient\CachedHttpClient as CachedClient;
use Github\HttpClient\Cache\FilesystemCache as Cache;
use League\Flysystem\Filesystem;
use Potherca\Flysystem\Github\Api;
use Potherca\Flysystem\Github\GithubAdapter;
use Potherca\Flysystem\Github\Settings;

$project = 'thephpleague/flysystem';

$settings = new Settings($project);

$cache = new Cache('/tmp/github-api-cache')
$cacheClient = new CachedClient();
$cacheClient->setCache($cache);

$api = new Api($cacheClient, $settings);
$adapter = new GithubAdapter($api);
$filesystem = new Filesystem($adapter);

Testing

The unit-tests can be run with the following command:, (*4)

``` bash $ composer test, (*5)


To run integration tests, which use the Github API, a [Github API token] might be needed (to stop the tests hitting the API Limit). An API key can be added by setting it in the environment as `GITHUB_API_KEY` or by creating an `.env` file in the integration tests directory and setting it there. See `tests/integration-tests/.env.example` for an example. To run the integration test, run the following command (this will also run the unit-tests): ``` bash $ composer test-all

Security

If you discover any security related issues, please email potherca@gmail.com instead of using the issue tracker., (*6)

Contributing

Please see CONTRIBUTING for details., (*7)

Change Log

Please see CHANGELOG for details., (*8)

Credits

License

The MIT License (MIT). Please see License File for more information., (*9)

The Versions

26/04 2016

dev-issues/14/no-path-in-directory-metadata

dev-issues/14/no-path-in-directory-metadata https://github.com/potherca/flysystem-github

Flysystem adapter for Github

  Sources   Download

MIT

The Requires

 

The Development Requires

adapter github flysystem potherca flysystem-github flysystem-adapter

20/04 2016

dev-master

9999999-dev https://github.com/potherca/flysystem-github

Flysystem adapter for Github

  Sources   Download

MIT

The Requires

 

The Development Requires

adapter github flysystem potherca flysystem-github flysystem-adapter

20/04 2016

v0.3.0

0.3.0.0 https://github.com/potherca/flysystem-github

Flysystem adapter for Github

  Sources   Download

MIT

The Requires

 

The Development Requires

adapter github flysystem potherca flysystem-github flysystem-adapter

20/04 2016

dev-develop

dev-develop https://github.com/potherca/flysystem-github

Flysystem adapter for Github

  Sources   Download

MIT

The Requires

 

The Development Requires

adapter github flysystem potherca flysystem-github flysystem-adapter

20/04 2016

dev-feature/integration-tests

dev-feature/integration-tests https://github.com/potherca/flysystem-github

Flysystem adapter for Github

  Sources   Download

MIT

The Requires

 

The Development Requires

adapter github flysystem potherca flysystem-github flysystem-adapter

21/07 2015

v0.2.0

0.2.0.0 https://github.com/potherca/flysystem-github

Flysystem adapter for Github

  Sources   Download

MIT

The Requires

 

The Development Requires

adapter github flysystem potherca flysystem-github flysystem-adapter

18/07 2015

0.1.0

0.1.0.0 https://github.com/potherca/flysystem-github

Flysystem adapter for Github

  Sources   Download

MIT

The Requires

 

The Development Requires

adapter github flysystem potherca flysystem-github flysystem-adapter

11/05 2015

0.0.0

0.0.0.0 https://github.com/potherca/flysystem-github

Flysystem adapter for Github

  Sources   Download

MIT

The Requires

 

The Development Requires

adapter github flysystem potherca flysystem-github flysystem-adapter