ak1r0 / flysystem-filepathstrategy
There is no license information available for the latest version (1.0.0) of this package.
Add a 'File path strategy' to Flysystem. Allow to set globaly how files must be stored.
1.0.0
2019-02-22 19:31 UTC
Requires
- php: ^5.4
- league/flysystem: ^1.0
This package is auto-updated.
Last update: 2024-10-23 07:48:16 UTC
README
Add a "File path strategy" to Flysystem. Allow to set globaly how files must be stored.
This is usefull to have the same archive/backup strategy whatever adapter you use.
Todos
- Units tests
- PHP 7 version
Install
composer require ak1r0/flysystem-filepathstrategy
Usage
$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