tinect/flysystem-garbage

Flysystem Adapter to move files into garbage folder when specific actions are taken

1.1.0 2024-09-29 19:45 UTC

This package is auto-updated.

Last update: 2024-09-29 19:48:35 UTC


README

codecov Mutation Score Indicator

This is a Flysystem Adapter to move files into garbage folder when specific actions are taken

Installation

composer require tinect/flysystem-garbage

Usage example

<?php
declare(strict_types=1);

use League\Flysystem\Filesystem;
use League\Flysystem\Config;
use League\Flysystem\Local\LocalFilesystemAdapter;
use Tinect\Flysystem\Garbage\GarbageAdapter;

//Initialize your adapter
$adapter = new LocalFilesystemAdapter(
    '/my/path/'
);

//Put your adapter into the garbageAdapter
$adapter = new GarbageAdapter(
    $adapter
);

//Perform your actions as usual
$adapter->write('test.txt', 'content', new Config());
$adapter->delete('test.txt');

//see directory "garbage"