/flysystem-tempdir

Flysystem adapter for a self-destroying temporary directory

Primary LanguagePHPMIT LicenseMIT

Flysystem Adapter for Temporary Directory

build Software License Packagist Version

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 = null, $destruct = true);
// fully qualified FS path
$fsPath = $fs->getPath();

or as Flysystem Adapter:

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

$adapter = new TempdirAdapter($prefix = '', $tempdir = null, $destruct = true);

$filesystem = new Filesystem($adapter);
// fully qualified FS path
$fsPath = $adapter->getPath();

License

flysystem-tempdir is licensed under the MIT License.