vector88 / cachefs
CacheFS for PHP
1.0.0
2017-06-27 09:26 UTC
Requires
- php: >=5.5
This package is not auto-updated.
Last update: 2024-11-10 04:17:21 UTC
README
Cache Filesystem for PHP.
This package is made from code included in Ron Shpasser's GAE Support for Lumen Library (Released under the MIT License).
Installation
composer require vector88/cachefs
Usage
-
Register the
cachefs
stream handler.<?php \Vector88\CacheFS\CacheFS::register();
-
Use the
cachefs
stream handler.<?php $fh = fopen( 'cachefs://some/file', 'w' ); fwrite( $fh, 'file content' ); fclose( $fh ); // ... $fh = fopen( 'cachefs://some/file', 'r' ); $content = fread( $fh, filesize( 'cachefs://some/file' ) ); fclose( $fh );