PHP code example of kiwilan / php-filelist

1. Go to this page and download the library: Download kiwilan/php-filelist 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/ */

    

kiwilan / php-filelist example snippets


$list = FileList::make('/path/to/scan')->run();

$list->getFiles(); // List of files as `string[]`
$list->getSplFiles(); // List of SplFileInfo as `SplFileInfo[]`
$list->getErrors(); // List of errors as `string[]|null`
$list->getTimeElapsed(); // Time elapsed in seconds as `float`
$list->getTotal(); // Total files as `int`
$list->isSuccess(); // Success status as `bool`

$list = FileList::make('/path/to/scan')->showHidden()->run();

$list = FileList::make('/path/to/scan')->saveAsJson('/path/to/json')->run();

$list = FileList::make('/path/to/scan')->throwOnError()->run();

$list = FileList::make('/path/to/scan')->limit(100)->run();

$list = FileList::make('/path/to/scan')->onlyExtensions(['txt', 'md'])->run();

$list = FileList::make('/path/to/scan')->skipExtensions(['txt', 'md'])->run();

$list = FileList::make('/path/to/scan')->skipFilenames(['file.txt', 'README.md'])->run();

$list = FileList::make('/path/to/scan')->notRecursive()->run();

$list = FileList::make('/path/to/scan')->noMemoryLimit()->run();

$list = FileList::make('/path/to/scan')->withFind()->run();

$list = FileList::make('/path/to/scan')->withScoutSeeker()->run();
bash
composer