The preferred way to install is through composer.
composer require nex-otaku/minimal-filesystem
Alternatively, you can just copy-paste source file to your project. It has no dependencies and should work just fine.
$fs = new \NexOtaku\MinimalFilesystem\Filesystem();
// List all files in directory
var_dump($fs->listFiles('/var/www'));
// Search all TXT files in directory
var_dump($fs->searchFiles('/var/www', '*.txt'));
// Read file
echo $fs->readFile('/var/log/my-app.log');
// Write file
$fs->writeFile('/var/etc/my-app.conf', json_encode(['favoriteCoffee' => 'Double Espresso']));
// Append to file
$fs->appendToFile('/var/log/my-app.log', 'Logging is easy!');
- createDirectory
- getCurrentDirectory
- existsDirectory
- isDirectory
- writeFile
- appendToFile
- isReadableFile
- readFile
- renameFile
- deleteFile
- existsFile
- isFile
- exists
- listFiles
- searchFiles
- searchFilesRecursively
Telegram: @nex_otaku
Email: [email protected]
- MIT license
- Copyright 2021 © Nex Otaku.