Skip to content

Commit 443e03a

Browse files
committed
Merge branch 'release/0.1.0'
2 parents 4d66b05 + 58c8bc9 commit 443e03a

File tree

10 files changed

+949
-0
lines changed

10 files changed

+949
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
build
2+
vendor
3+
4+
composer.lock
5+
phpunit.xml

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Change Log
2+
All notable changes to the `flysystem-github` project will be documented in this
3+
file. This project adheres to [Semantic Versioning](http://semver.org/).
4+
5+
## 0.1.0 - 2015-07-18 - Read functionality
6+
### Added
7+
Read functionality and Github API authentication have been implemented.
8+
9+
## 0.0.0 - 2015-05-11 - Project Setup
10+
### Added
11+
Set up project basics like .gitignore file, PHPUnit Configuration file,
12+
Contributing guidelines, Composer file stating dependencies, MIT License, README
13+
file and this CHANGELOG file.
14+
15+
[unreleased]: https://github.com/potherca/flystystem-github/compare/v0.1.0...HEAD
16+
[0.1.0]: https://github.com/potherca/flystystem-github/compare/v0.0.0...v0.1.0

CONTRIBUTING.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Contributing
2+
3+
Contributions are **welcome** and will be fully **credited**.
4+
5+
We accept contributions via Pull Requests on [Github](https://github.com/potherca/flysystem-github).
6+
7+
8+
## Pull Requests
9+
10+
- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer).
11+
12+
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
13+
14+
- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
15+
16+
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
17+
18+
- **Create feature branches** - Don't ask us to pull from your master branch.
19+
20+
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
21+
22+
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
23+
24+
25+
## Running Tests
26+
27+
``` bash
28+
$ composer test
29+
```
30+
31+
32+
**Happy coding**!

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# The MIT License (MIT)
2+
3+
Copyright (c) 2015 Potherca <[email protected]>
4+
5+
> Permission is hereby granted, free of charge, to any person obtaining a copy
6+
> of this software and associated documentation files (the "Software"), to deal
7+
> in the Software without restriction, including without limitation the rights
8+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
> copies of the Software, and to permit persons to whom the Software is
10+
> furnished to do so, subject to the following conditions:
11+
>
12+
> The above copyright notice and this permission notice shall be included in
13+
> all copies or substantial portions of the Software.
14+
>
15+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
> THE SOFTWARE.

README.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Flysystem Adapter for Github
2+
3+
[![Latest Version](https://img.shields.io/github/release/potherca/flysystem-github.svg?style=flat-square)](https://github.com/potherca/flysystem-github/releases)
4+
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
5+
[![Build Status](https://img.shields.io/travis/potherca/flysystem-github/master.svg?style=flat-square)](https://travis-ci.org/potherca/flysystem-github)
6+
[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/potherca/flysystem-github.svg?style=flat-square)](https://scrutinizer-ci.com/g/potherca/flysystem-github/code-structure)
7+
[![Quality Score](https://img.shields.io/scrutinizer/g/potherca/flysystem-github.svg?style=flat-square)](https://scrutinizer-ci.com/g/potherca/flysystem-github)
8+
[![Total Downloads](https://img.shields.io/packagist/dt/potherca/flysystem-github.svg?style=flat-square)](https://packagist.org/packages/potherca/flysystem-github)
9+
10+
11+
## Install
12+
13+
Via Composer
14+
15+
``` bash
16+
$ composer require potherca/flysystem-github
17+
```
18+
19+
## Usage
20+
21+
The Github adapter can be used *without* credentials to do read-only actions on
22+
public repositories. To avoid reaching the Github API limit, to save changes, or
23+
to read from private repositories, credentials are required.
24+
25+
Caching can be utilized to save traffic or to postpone reaching the Github API
26+
limit.
27+
28+
### Basic Usage
29+
30+
```php
31+
use Github\Client as GithubClient;
32+
use League\Flysystem\Filesystem;
33+
use Potherca\Flysystem\Github\Client;
34+
use Potherca\Flysystem\Github\GithubAdapter;
35+
use Potherca\Flysystem\Github\Settings;
36+
37+
$project = 'thephpleague/flysystem';
38+
39+
$settings = new Settings($project);
40+
41+
$client = new Client(new GithubClient(), $settings);
42+
$adapter = new GithubAdapter($client);
43+
$filesystem = new Filesystem($adapter);
44+
```
45+
46+
### Authentication
47+
48+
```php
49+
use Github\Client as GithubClient;
50+
use League\Flysystem\Filesystem;
51+
use Potherca\Flysystem\Github\Client;
52+
use Potherca\Flysystem\Github\GithubAdapter;
53+
use Potherca\Flysystem\Github\Settings;
54+
55+
$project = 'thephpleague/flysystem';
56+
$credentials = [Settings::AUTHENTICATE_USING_TOKEN, '83347e315b8bb4790a48ed6953a5ad9e825b4e10'];
57+
// or $authentications = [Settings::AUTHENTICATE_USING_PASSWORD, $username, $password];
58+
59+
$settings = new Settings($project, $credentials);
60+
61+
$client = new Client(new GithubClient(), $settings);
62+
$adapter = new GithubAdapter($client);
63+
$filesystem = new Filesystem($adapter);
64+
```
65+
66+
### Cache Usage
67+
68+
```php
69+
use Github\Client as GithubClient;
70+
use Github\HttpClient\CachedHttpClient as CachedClient;
71+
use Github\HttpClient\Cache\FilesystemCache as Cache;
72+
use League\Flysystem\Filesystem;
73+
use Potherca\Flysystem\Github\Client;
74+
use Potherca\Flysystem\Github\GithubAdapter;
75+
use Potherca\Flysystem\Github\Settings;
76+
77+
$project = 'thephpleague/flysystem';
78+
79+
$settings = new Settings($project);
80+
81+
$cache = new Cache('/tmp/github-api-cache')
82+
$cacheClient = new CachedClient();
83+
$cacheClient->setCache($cache);
84+
85+
$client = new Client($cacheClient, $settings);
86+
$adapter = new GithubAdapter($client);
87+
$filesystem = new Filesystem($adapter);
88+
89+
```
90+
91+
## Testing
92+
93+
``` bash
94+
$ composer test
95+
```
96+
97+
## Contributing
98+
99+
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
100+
101+
## Security
102+
103+
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
104+
105+
## Credits
106+
107+
- [Potherca](https://github.com/potherca)
108+
109+
## License
110+
111+
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

composer.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "potherca/flysystem-github",
3+
"description": "Flysystem adapter for Github",
4+
"keywords": [
5+
"potherca",
6+
"flysystem-github",
7+
"flysystem-adapter",
8+
"flysystem",
9+
"github",
10+
"adapter"
11+
],
12+
"homepage": "https://github.com/potherca/flysystem-github",
13+
"license": "MIT",
14+
"authors": [
15+
{
16+
"name": "Potherca",
17+
"email": "[email protected]",
18+
"homepage": "http://pother.ca/",
19+
"role": "Developer"
20+
}
21+
],
22+
"require": {
23+
"php" : ">=5.3.0",
24+
"knplabs/github-api": "^1.4",
25+
"league/flysystem": "^1.0"
26+
},
27+
"require-dev": {
28+
"phpunit/phpunit" : "4.*",
29+
"scrutinizer/ocular": "~1.1"
30+
},
31+
"autoload": {
32+
"psr-4": {
33+
"Potherca\\Flysystem\\Github\\": "src"
34+
}
35+
},
36+
"autoload-dev": {
37+
"psr-4": {
38+
"Potherca\\Flysystem\\Github\\": "tests"
39+
}
40+
},
41+
"extra": {
42+
"branch-alias": {
43+
"dev-master": "1.0-dev"
44+
}
45+
},
46+
"scripts": {
47+
"test" : "phpunit"
48+
}
49+
}

phpunit.xml.dist

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit bootstrap="vendor/autoload.php"
3+
backupGlobals="false"
4+
backupStaticAttributes="false"
5+
colors="true"
6+
verbose="true"
7+
convertErrorsToExceptions="true"
8+
convertNoticesToExceptions="true"
9+
convertWarningsToExceptions="true"
10+
processIsolation="false"
11+
stopOnFailure="false">
12+
<testsuites>
13+
<testsuite name="Potherca Test Suite">
14+
<directory>tests</directory>
15+
</testsuite>
16+
</testsuites>
17+
<filter>
18+
<whitelist>
19+
<directory suffix=".php">src/</directory>
20+
</whitelist>
21+
</filter>
22+
<logging>
23+
<log type="tap" target="build/report.tap"/>
24+
<log type="junit" target="build/report.junit.xml"/>
25+
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
26+
<log type="coverage-text" target="build/coverage.txt"/>
27+
<log type="coverage-clover" target="build/logs/clover.xml"/>
28+
</logging>
29+
</phpunit>

0 commit comments

Comments
 (0)