orisai/vfs

Emulate file system with plain PHP

v1.x-dev 2023-05-26 16:08 UTC

This package is auto-updated.

Last update: 2024-01-26 17:47:34 UTC


README

Emulate file system with plain PHP

📄 Check out our documentation.

💸 If you like Orisai, please make a donation. Thank you!

badge.svg 68747470733a2f2f62616467656e2e6e65742f636f766572616c6c732f632f6769746875622f6f72697361692f7666732f76312e783f63616368653d333030 68747470733a2f2f62616467652e737472796b65722d6d757461746f722e696f2f6769746875622e636f6d2f6f72697361692f7666732f76312e78 68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f64742f6f72697361692f7666733f63616368653d33363030 68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f762f6f72697361692f7666733f63616368653d33363030 68747470733a2f2f62616467656e2e6e65742f62616467652f6c6963656e73652f4d49542f626c75653f63616368653d33363030

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