ak1r0/flysystem-filepathstrategy

此包的最新版本(1.0.0)没有可用的许可证信息。

为Flysystem添加一个“文件路径策略”。允许全局设置文件存储方式。

1.0.0 2019-02-22 19:31 UTC

This package is auto-updated.

Last update: 2024-09-23 07:37:00 UTC


README

为Flysystem添加“文件路径策略”。允许全局设置文件存储方式。

这有助于无论使用哪个适配器,都能保持相同的存档/备份策略。

待办事项

  • 单元测试
  • PHP 7版本

安装

composer require ak1r0/flysystem-filepathstrategy

用法

$adapter = new \League\Flysystem\Adapter\Local();
$config = new \League\Flysystem\Config();

$strategy = new \Ak1r0\Flysystem\FilePathStrategy\YearMonthDayStrategy();

$filesystem = new \Ak1r0\Flysystem\Filesystem($adapter, $config, $strategy);

// and then, basic usage.
// For every 'write' method it will automatically add current "/year/month/day/" before your path