orisai/vfs

Emulate file system with plain PHP

v1.x-dev 2024-06-21 10:43 UTC

This package is auto-updated.

Last update: 2024-11-21 11:35:42 UTC


README

Orisai
Virtual File System

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);