It is based on Node.js's filesystem module.
composer require okapi/filesystem
<?php
use Okapi\Filesystem\Filesystem;
// Write file
Filesystem::writeFile('./path/to/file.txt', 'Hello World!');
// Read file
$contents = Filesystem::readFile('./path/to/file.txt');
// Remove directory or file
Filesystem::rm(
'./path',
recursive: true,
force: true,
);
// Create directory
Filesystem::mkdir(
'./path/to/directory',
recursive: true,
mode: 0777,
);
- Run
composer run-script test
or - Run
composer run-script test-coverage
Give a ⭐ if this project helped you!
Copyright © 2023 Valentin Wotschel.
This project is MIT licensed.