Download the PHP package radiergummi/flysystem-github-storage without Composer
On this page you can find all versions of the php package radiergummi/flysystem-github-storage. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download radiergummi/flysystem-github-storage
More information about radiergummi/flysystem-github-storage
Files in radiergummi/flysystem-github-storage
Package flysystem-github-storage
Short Description A GitHub Storage filesystem for Flysystem.
License MIT
Informations about the package flysystem-github-storage
GitHub Adapter for Flysystem
This is a GitHub adapter for Flysystem. It allows you to use a GitHub
repository as a storage backend for Flysystem.
It uses the Contents API of the GitHub API, version 3.
This adapter was heavily influenced by the marvelous work of Roy Voetman on his Gitlab Adapter. Make sure to check it out if you need a Gitlab integration instead.
Installation
Usage
To use the GitHub storage with Flysystem, you'll need to create a client:
You can then pass that client to the adapter:
...and finally, create a Filesystem instance:
Check out the Flysystem documentation for filesystem usage information.
Advanced usage
The library allows additional constructor arguments for the client:
Argument | Default | Description |
---|---|---|
string $token |
- | Your access token. Must have the repo scope. |
string $repository |
- | Name of the repository, including the owner, eg. acme/repo-name . |
string $branch |
master |
Name of the branch in your repository. |
string $baseurl |
https://api.github.com |
Base URL of the API to use. Pass null to use the default. |
\Guzzle\Client $guzzleClient |
- | Guzzle client to use for the connection. Check the Custom HTTP Client section. |
Custom HTTP Client
You can optionally pass a custom Guzzle client for the library to use. If you do so, make sure to add the following default headers:
authorization
: Should contain your access token, eg.'authorization' => "token {$token}"
.content-type
: Should contain the desired API version, eg.'content-type' => "application/vnd.github.v3+json"
.
Contributions
Contributions are welcome! The test suite could be expanded and the error handling be improved - alas, the Flysystem
library does not support a sensible exception system but relies on 90s-style false
return values. While there's no way
around that, I'm sure one could improve the situation.
All versions of flysystem-github-storage with dependencies
ext-json Version *
guzzlehttp/guzzle Version ^6.5
league/flysystem Version ^1.0