tinect/flysystem-garbage

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

1.0.0 2023-09-06 23:10 UTC

This package is auto-updated.

Last update: 2024-04-12 13:11:28 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"