gueff/cachix
Composer 安装命令:
composer require gueff/cachix
包简介
A simple PHP Caching Class working with files
README 文档
README
A simple PHP Caching Class working with files
Requirements
- PHP >= 7.4
- Linux commands
rm,findandgrepto be executable via PHP'sshell_execcommand
Installation
create the composer.json file with following content:
{
"require": {
"gueff/cachix":"1.0.2"
}
}
run installation
$ composer install
Usage
<?php // init Config \Cachix::init(array( 'bCaching' => true, 'sCacheDir' => '/tmp/', 'iDeleteAfterMinutes' => 10, 'sBinRemove' => '/bin/rm', 'sBinFind' => '/usr/bin/find', 'sBinGrep' => '/bin/grep' )); // build a Cache-Key $sKey = 'myCacheKey.Token'; // autodelete cachefiles // which contain the string ".Token" in key-names \Cachix::autoDeleteCache('.Token'); // first time saving data to cache... if (empty(\Cachix::getCache($sKey))) { // Data to be cached $aData = ['foo' => 'bar']; \Cachix::saveCache( $sKey, $aData ); } // ...or read from existing Cache else { $aData = \Cachix::getCache($sKey); }
统计信息
- 总下载量: 3.25k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2017-12-05