承接 stepanrodionov/php-apcu-cache 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

stepanrodionov/php-apcu-cache

Composer 安装命令:

composer require stepanrodionov/php-apcu-cache

包简介

This is PSR-16 compatible cache library using php-apcu module

README 文档

README

Latest Stable Version Latest Unstable Version License Codacy Badge

php-apcu-cache (PSR-16)

This is PSR-16 compatible cache library using php-apcu module. It's provides one class ApcuCacheStorage which implements Psr\SimpleCache\CacheInterface and may be used in your code everywhere, where php cache is need.

About apcu

Php-apcu provides in-memory cache, which stores variables between requests. You can read more about it in this page.

Usage

You should create instance of ApcuCacheStorage and when you'll get access to its functionality

$cache = new SR\Cache\ApcuCacheStorage();

//  store variable with ttl
$success = $cache->set('key', $variable, 3600);

//  get variable
$variable = $cache->get('key');

//  'key' will be overwritten
$cache->set('key', $anotherVar, 3600);

//  deleting one cached variable and all of them
$cache->delete('key');
$cache->clear();

// dealing with multiple data
$cache->getMultiple([
    'key', 
    'key1',
]);
$cache->setMultiple([
    'key' => 'value',
    'key1' => 'value1',
]);
$cache->deleteMultiple([
    'key', 
    'key1',
]);

//  check if variable exists
$isVarCached = $cache->has('key');

Tests

Run composer test.

License

This component is under the MIT license. See the complete license in the LICENSE file.

统计信息

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

GitHub 信息

  • Stars: 5
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-01-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固