PHP code example of ak1r0 / flysystem-filepathstrategy
1. Go to this page and download the library: Download ak1r0/flysystem-filepathstrategy library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ak1r0 / flysystem-filepathstrategy example snippets
$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