jacklul/cachefs

This package is abandoned and no longer maintained. No replacement package was suggested.

Filesystem wrapper that uses PSR-16 cache interface as storage

0.1.0 2018-05-15 18:25 UTC

This package is auto-updated.

Last update: 2020-11-26 00:51:20 UTC


README

Functional virtual filesystem that uses PSR-16 cache interface as storage, useful for testing or as persistent cache filesystem.

Based on vector-kerr/cachefs.

Installation

Install with Composer:

$ composer require jacklul/cachefs

Usage

$memcached = new MemcachedAdapter();    // PSR-16 compatible interface
jacklul\CacheFS\CacheFS::register($memcached);

jacklul\CacheFS\CacheFS::register($memcached, 'myfilesystem');  // using custom stream name

// Write to 'text.txt' file
file_put_contents('cachefs://test.txt', 'test123');

// Create 'test' directory
mkdir('cachefs://test/');

// List root filesystem contents
print_r(scandir('cachefs://'));

License

See LICENSE.