Emulate file system with plain PHP
📄 Check out our documentation.
💸 If you like Orisai, please make a donation. Thank you!
This package is remake of php-vfs from michael-donat. Thank you, Michael!
use Orisai\VFS\VFS;
// Register VFS protocol
$scheme = VFS::register();
// Write into virtual file
file_put_contents("$scheme://file", 'content');
// Read content of virtual file
$content = file_get_contents("$scheme://file");
// Unregister protocol, delete the virtual filesystem
VFS::unregister($scheme);