emgag/flysystem-tempdir

Flysystem adapter for a self-destroying temporary directory

v0.1 2015-05-18 06:19 UTC

README

Build Status Software License Packagist Version Project Status: Active - The project has reached a stable, usable state and is being actively developed.

An adapter for the Flysystem file system abstraction library which creates a temporary directory on local filesystem and which is automatically removed again on object destruct.

Installation

composer require emgag/flysystem-tempdir

Usage

As League\Flysystem\Filesystem wrapper:

use Emgag\Flysystem\Tempdir;
$fs = new Tempdir([$prefix],[$tempdir]);
// fully qualified FS path
$fsPath = $fs->getPath();

or as Flysystem Adapter:

use Emgag\Flysystem\TempdirAdapter;
use League\Flysystem\Filesystem;

$adapter = new TempdirAdapter([$prefix],[$tempdir]);

$filesystem = new Filesystem($adapter);

License

flysystem-tempdir is licensed under the MIT License.