summaryrefslogtreecommitdiff
path: root/vendor/fisharebest/flysystem-chroot-adapter
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/fisharebest/flysystem-chroot-adapter')
-rw-r--r--vendor/fisharebest/flysystem-chroot-adapter/LICENSE.md21
-rw-r--r--vendor/fisharebest/flysystem-chroot-adapter/README.md35
-rw-r--r--vendor/fisharebest/flysystem-chroot-adapter/composer.json32
-rw-r--r--vendor/fisharebest/flysystem-chroot-adapter/src/ChrootAdapter.php303
4 files changed, 0 insertions, 391 deletions
diff --git a/vendor/fisharebest/flysystem-chroot-adapter/LICENSE.md b/vendor/fisharebest/flysystem-chroot-adapter/LICENSE.md
deleted file mode 100644
index 9ca3299196..0000000000
--- a/vendor/fisharebest/flysystem-chroot-adapter/LICENSE.md
+++ /dev/null
@@ -1,21 +0,0 @@
-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.
diff --git a/vendor/fisharebest/flysystem-chroot-adapter/README.md b/vendor/fisharebest/flysystem-chroot-adapter/README.md
deleted file mode 100644
index bc4f7ea937..0000000000
--- a/vendor/fisharebest/flysystem-chroot-adapter/README.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# Flysystem Chroot Adapter
-
-[![Author](http://img.shields.io/badge/author-@fisharebest-blue.svg?style=flat-square)](https://github.com/fisharebest)
-[![Latest Stable Version](https://poser.pugx.org/fisharebest/flysystem-chroot-adapter/v/stable.svg)](https://packagist.org/packages/fisharebest/flysystem-chroot-adapter)
-[![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.md)
-
-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!'
-```
diff --git a/vendor/fisharebest/flysystem-chroot-adapter/composer.json b/vendor/fisharebest/flysystem-chroot-adapter/composer.json
deleted file mode 100644
index cb391662bb..0000000000
--- a/vendor/fisharebest/flysystem-chroot-adapter/composer.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "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": "~6.0"
- },
- "autoload": {
- "psr-4": {
- "Fisharebest\\Flysystem\\Adapter\\": "src/"
- }
- }
-}
diff --git a/vendor/fisharebest/flysystem-chroot-adapter/src/ChrootAdapter.php b/vendor/fisharebest/flysystem-chroot-adapter/src/ChrootAdapter.php
deleted file mode 100644
index cd4116cf4f..0000000000
--- a/vendor/fisharebest/flysystem-chroot-adapter/src/ChrootAdapter.php
+++ /dev/null
@@ -1,303 +0,0 @@
-<?php
-/**
- * @author Greg Roach <fisharebest@gmail.com>
- * @copyright Copyright (c) 2019
- * @licence MIT
- */
-
-namespace Fisharebest\Flysystem\Adapter;
-
-use League\Flysystem\AdapterInterface;
-use League\Flysystem\Config;
-use League\Flysystem\FilesystemInterface;
-
-/**
- * Create a subtree from an existing filesystem.
- */
-class ChrootAdapter implements AdapterInterface
-{
- /** @var string[] Metadata attributes that may need prefixes removing */
- private static $ATTRIBUTES_WITH_PREFIX = ['dirname', 'path'];
-
- /** @var AdapterInterface */
- private $adapter;
-
- /** @var string */
- private $prefix;
-
- /**
- * ChrootAdapter constructor.
- *
- * @param FilesystemInterface $filesystem
- * @param string $prefix e.g. 'some/prefix'
- */
- public function __construct(FilesystemInterface $filesystem, $prefix = '')
- {
- $this->adapter = $filesystem->getAdapter();
- $this->prefix = trim($prefix, '/') . '/';
- }
-
- /**
- * Check whether a file exists.
- *
- * @param string $path
- *
- * @return array|bool|null
- */
- public function has($path)
- {
- return $this->adapter->has($this->prefix . $path);
- }
-
- /**
- * Read a file.
- *
- * @param string $path
- *
- * @return array|false
- */
- public function read($path)
- {
- return $this->adapter->read($this->prefix . $path);
- }
-
- /**
- * Read a file as a stream.
- *
- * @param string $path
- *
- * @return array|false
- */
- public function readStream($path)
- {
- return $this->adapter->readStream($this->prefix . $path);
- }
-
- /**
- * List contents of a directory.
- *
- * @param string $directory
- * @param bool $recursive
- *
- * @return array
- */
- public function listContents($directory = '', $recursive = false)
- {
- $directory = trim($this->prefix . $directory, '/');
- $contents = $this->adapter->listContents($directory, $recursive);
-
- return array_map([$this, 'removePrefixFromMetadata'], $contents);
- }
-
- /**
- * Get all the meta data of a file or directory.
- *
- * @param string $path
- *
- * @return array|false
- */
- public function getMetadata($path)
- {
- $metadata = $this->adapter->getMetadata($this->prefix . $path);
-
- return $this->removePrefixFromMetadata($metadata);
- }
-
- /**
- * Get the size of a file.
- *
- * @param string $path
- *
- * @return array|false
- */
- public function getSize($path)
- {
- return $this->adapter->getSize($this->prefix . $path);
- }
-
- /**
- * Get the mimetype of a file.
- *
- * @param string $path
- *
- * @return array|false
- */
- public function getMimetype($path)
- {
- return $this->adapter->getMimetype($this->prefix . $path);
- }
-
- /**
- * Get the last modified time of a file as a timestamp.
- *
- * @param string $path
- *
- * @return array|false
- */
- public function getTimestamp($path)
- {
- return $this->adapter->getTimestamp($this->prefix . $path);
- }
-
- /**
- * Get the visibility of a file.
- *
- * @param string $path
- *
- * @return array|false
- */
- public function getVisibility($path)
- {
- return $this->adapter->getVisibility($this->prefix . $path);
- }
-
- /**
- * Write a new file.
- *
- * @param string $path
- * @param string $contents
- * @param Config $config Config object
- *
- * @return array|false false on failure file meta data on success
- */
- public function write($path, $contents, Config $config)
- {
- return $this->adapter->write($this->prefix . $path, $contents, $config);
- }
-
- /**
- * Write a new file using a stream.
- *
- * @param string $path
- * @param resource $resource
- * @param Config $config Config object
- *
- * @return array|false false on failure file meta data on success
- */
- public function writeStream($path, $resource, Config $config)
- {
- return $this->adapter->writeStream($this->prefix . $path, $resource, $config);
- }
-
- /**
- * Update a file.
- *
- * @param string $path
- * @param string $contents
- * @param Config $config Config object
- *
- * @return array|false false on failure file meta data on success
- */
- public function update($path, $contents, Config $config)
- {
- return $this->adapter->update($this->prefix . $path, $contents, $config);
- }
-
- /**
- * Update a file using a stream.
- *
- * @param string $path
- * @param resource $resource
- * @param Config $config Config object
- *
- * @return array|false false on failure file meta data on success
- */
- public function updateStream($path, $resource, Config $config)
- {
- return $this->adapter->updateStream($this->prefix . $path, $resource, $config);
- }
-
- /**
- * Rename a file.
- *
- * @param string $path
- * @param string $newpath
- *
- * @return bool
- */
- public function rename($path, $newpath)
- {
- return $this->adapter->rename($this->prefix . $path, $this->prefix . $newpath);
- }
-
- /**
- * Copy a file.
- *
- * @param string $path
- * @param string $newpath
- *
- * @return bool
- */
- public function copy($path, $newpath)
- {
- return $this->adapter->copy($this->prefix . $path, $this->prefix . $newpath);
- }
-
- /**
- * Delete a file.
- *
- * @param string $path
- *
- * @return bool
- */
- public function delete($path)
- {
- return $this->adapter->delete($this->prefix . $path);
- }
-
- /**
- * Delete a directory.
- *
- * @param string $dirname
- *
- * @return bool
- */
- public function deleteDir($dirname)
- {
- return $this->adapter->deleteDir($this->prefix . $dirname);
- }
-
- /**
- * Create a directory.
- *
- * @param string $dirname directory name
- * @param Config $config
- *
- * @return array|false
- */
- public function createDir($dirname, Config $config)
- {
- return $this->adapter->createDir($this->prefix . $dirname, $config);
- }
-
- /**
- * Set the visibility for a file.
- *
- * @param string $path
- * @param string $visibility
- *
- * @return array|false file meta data
- */
- public function setVisibility($path, $visibility)
- {
- return $this->adapter->setVisibility($this->prefix . $path, $visibility);
- }
-
- /**
- * Strip the prefix from metadata attributes.
- *
- * @param array $metadata
- *
- * @return array
- */
- private function removePrefixFromMetadata(array $metadata)
- {
- foreach (self::$ATTRIBUTES_WITH_PREFIX as $attribute) {
- if (isset($metadata[$attribute])) {
- $metadata[$attribute] = substr($metadata[$attribute], strlen($this->prefix));
- }
- }
-
- return $metadata;
- }
-}