-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit bd4839d
Showing
9 changed files
with
723 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/.gitattributes export-ignore | ||
/.gitignore export-ignore | ||
/.travis.yml export-ignore | ||
/phpunit.xml.dist export-ignore | ||
/tests export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
bin | ||
composer.lock | ||
vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
language: php | ||
|
||
php: | ||
- nightly | ||
- 7.3 | ||
- 7.2 | ||
- 7.1 | ||
- 7.0 | ||
- 5.6 | ||
- 5.5 | ||
|
||
sudo: false | ||
|
||
env: | ||
matrix: | ||
- PREFER_LOWEST="--prefer-lowest" | ||
- PREFER_LOWEST="" | ||
|
||
install: | ||
- if [[ "${TRAVIS_PHP_VERSION}" == "5.5" ]]; then composer require phpunit/phpunit:~4.0; fi | ||
- travis_retry composer update $COMPOSER_OPTS | ||
|
||
script: | ||
- vendor/bin/phpunit | ||
|
||
after_script: | ||
- vendor/bin/php-coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 Greg Roach | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Flysystem Chroot Adapter | ||
|
||
[![Author](http://img.shields.io/badge/author-@fisharebest-blue.svg?style=flat-square)](https://github.com/fisharebest) | ||
[![Build Status](https://travis-ci.org/fisharebest/flysystem-chroot-adapter.svg?branch=master)](https://travis-ci.org/fisharebest/flysystem-chroot-adapter) | ||
[![Coverage Status](https://coveralls.io/repos/github/fisharebest/flysystem-chroot-adapter/badge.svg?branch=master)](https://coveralls.io/github/fisharebest/flysystem-chroot-adapter?branch=master) | ||
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/fisharebest/flysystem-chroot-adapter/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/fisharebest/flysystem-chroot-adapter/?branch=master) | ||
[![StyleCI](https://github.styleci.io/repos/166235152/shield?branch=master)](https://github.styleci.io/repos/166235152) | ||
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) | ||
|
||
This adapter creates a new filesystem from a sub-folder of an existing filesystem. | ||
|
||
## Installation | ||
|
||
```bash | ||
composer require fisharebest/flysystem-chroot-adapter | ||
``` | ||
|
||
## Usage | ||
|
||
```php | ||
use League\Flysystem\Filesystem; | ||
use League\Flysystem\Adapter\Local; | ||
use Fisharebest\Flysystem\Adapter\ChrootAdapter | ||
|
||
// Write a file to a filesystem. | ||
$filesystem = new Filesystem(new Local(__DIR__)); | ||
$filesystem->write('foo/bar/fab/file.txt', 'hello world!'); | ||
|
||
// Create a chroot filesystem from the foo/bar folder. | ||
$chroot = new Filesystem(new ChrootAdapter($filesystem, 'foo/bar')); | ||
|
||
// And read it back from the chroot. | ||
$chroot->read('fab/file.txt'); // 'hello world!' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"name": "fisharebest/flysystem-chroot-adapter", | ||
"description": "Creates a filesystem from a sub-folder in another filesystem.", | ||
"keywords": [ | ||
"flysystem", | ||
"chroot", | ||
"adapter" | ||
], | ||
"type": "library", | ||
"license": "MIT", | ||
"homepage": "https://github.com/fisharebest/flysystem-chroot-adapter", | ||
"authors": [ | ||
{ | ||
"name": "Greg Roach", | ||
"email": "fisharebest@gmail.com", | ||
"role": "Developer" | ||
} | ||
], | ||
"require": { | ||
"league/flysystem": "~1.0" | ||
}, | ||
"require-dev": { | ||
"league/flysystem-memory": "~1.0", | ||
"php-coveralls/php-coveralls": "*", | ||
"phpunit/phpunit": "~5.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Fisharebest\\Flysystem\\Adapter\\": "src/" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
xmlns="" | ||
> | ||
<testsuites> | ||
<testsuite name="Flysystem chroot adapter tests"> | ||
<directory>tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">src</directory> | ||
</whitelist> | ||
</filter> | ||
|
||
<logging> | ||
<log type="coverage-html" target="tests/coverage/"/> | ||
<log type="coverage-clover" target="build/logs/clover.xml"/> | ||
</logging> | ||
</phpunit> |
Oops, something went wrong.