vector88/cachefs

PHP的CacheFS

1.0.0 2017-06-27 09:26 UTC

This package is not auto-updated.

Last update: 2024-09-15 03:24:03 UTC


README

PHP的缓存文件系统。

此包由Ron Shpasser的GAE Support for Lumen库中的代码组成(在MIT许可证下发布)。

安装

composer require vector88/cachefs

用法

  1. 注册cachefs流处理程序。

    <?php
    
    \Vector88\CacheFS\CacheFS::register();
  2. 使用cachefs流处理程序。

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