PHP code example of marktaborosi / flysystem-filter
1. Go to this page and download the library: Download marktaborosi/flysystem-filter 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/ */
marktaborosi / flysystem-filter example snippets
use League\Flysystem\Filesystem;
use League\Flysystem\Local\LocalFilesystemAdapter;
use Marktaborosi\FlysystemFilter\FilterBuilder;
use Marktaborosi\FlysystemFilter\FlysystemFilter;
lterBuilder();
$filter->isFile();
$flysystemFilter = new FlysystemFilter();
$filteredResults = $flysystemFilter->filter($flysystemContents, $filter);
foreach ($filteredResults as $result) {
echo $result->path() . PHP_EOL;
}
$filter = new FilterBuilder();
$filter
->extensionEquals(['txt', 'log'])
->and()
->isPublic()
->and()
->sizeLt('1G');
$flysytemFilter = new FlysystemFilter();
$filteredResults = $flysystemFilter->filter($flysystemContents, $filter);