mrcnpdlk/psr16cache-adapter 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mrcnpdlk/psr16cache-adapter

最新稳定版本:0.2.1

Composer 安装命令:

composer require mrcnpdlk/psr16cache-adapter

包简介

Cache adapter for PSR-16

关键字:

README 文档

README

Latest Stable Version Latest Unstable Version Total Downloads Monthly Downloads License

Scrutinizer Code Quality Build Status Code Coverage

Code Climate Issue Count

PSR-16 Cache Adapter

Instalation

composer require mrcnpdlk/psr16cache-adapter

Basic usage

$oInstanceCacheFile = new \phpFastCache\Helper\Psr16Adapter(
    'files',
    [
        "host"                => null, // default localhost
        "port"                => null, // default 6379
        'defaultTtl'          => 3600 * 24, // 24h
        'ignoreSymfonyNotice' => true,
    ]);
$oInstanceLogger    = new \Monolog\Logger('name_of_my_logger');
$oInstanceLogger->pushHandler(new \Monolog\Handler\ErrorLogHandler(
        \Monolog\Handler\ErrorLogHandler::OPERATING_SYSTEM,
        \Psr\Log\LogLevel::DEBUG
    )
);

$oCacheAdapter = new \mrcnpdlk\Psr16Cache\Adapter($oInstanceCacheFile, $oInstanceLogger);
$oCacheAdapter->setHashSalt(['some_hash', __DIR__]);

$res = $oCacheAdapter->useCache(
    function () {
        return '1';
    },
    ['key1', 'key2'],
    10
);

var_dump($res);

Response

[2017-10-16 19:17:41] name_of_my_logger.DEBUG: CACHE [ffe7efd40ef900c95726a859aa28e048]: old, reset [] []
string(1) "1"

[2017-10-16 19:17:44] name_of_my_logger.DEBUG: CACHE [ffe7efd40ef900c95726a859aa28e048]: getting from cache [] []
string(1) "1"

Running the tests

./vendor/bin/phpunit

Authors

  • Marcin Pudełek - Initial work - mrcnpdlk

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details

统计信息

  • 总下载量: 37.87k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 6
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-10-16