Skip to content

Nex-Otaku/minimal-filesystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minimal Filesystem

Zero dependency. Small and powerful.

Installation

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.

Examples

$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!');

Filesystem commands

Directories

  • createDirectory
  • getCurrentDirectory
  • existsDirectory
  • isDirectory

Files

  • writeFile
  • appendToFile
  • isReadableFile
  • readFile
  • renameFile
  • deleteFile
  • existsFile
  • isFile

Paths

  • exists

Listing, searching:

  • listFiles
  • searchFiles
  • searchFilesRecursively

Questions? Ask!

Telegram: @nex_otaku

Email: nex-otaku@yandex.ru

License

License

About

Minimal filesystem for PHP projects.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages