Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.
/ cachefs Public archive

Filesystem wrapper that uses PSR-16 cache interface as storage

License

Notifications You must be signed in to change notification settings

jacklul/cachefs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CacheFS

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.