tinect/flysystem-garbage

在执行特定操作时将文件移动到垃圾文件夹的Flysystem适配器

1.0.0 2023-09-06 23:10 UTC

This package is auto-updated.

Last update: 2024-09-12 14:04:46 UTC


README

codecov Mutation Score Indicator

这是一个在执行特定操作时将文件移动到垃圾文件夹的Flysystem适配器

安装

composer require tinect/flysystem-garbage

使用示例

<?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"