承接 typhoon/opcache 相关项目开发

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

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

typhoon/opcache

最新稳定版本:0.2.1

Composer 安装命令:

composer require typhoon/opcache

包简介

PSR-16 compliant cache that stores values as PHP files, suitable for OPcaching.

README 文档

README

PSR-16 compliant cache that stores values as PHP files, suitable for OPcaching.

Installation

composer require typhoon/opcache

Usage

use Typhoon\OPcache\TyphoonOPcache;

$cache = new TyphoonOPcache('path/to/cache/dir');

$cache->set('key', $value);

assert($cache->get('key') == $value);

How to configure default TTL

According to PSR-16:

If a calling library asks for an item to be saved but does not specify an expiration time, or specifies a null expiration time or TTL, an Implementing Library MAY use a configured default duration.

Here's how you can configure default TTL:

use Typhoon\OPcache\TyphoonOPcache;

$cache = new TyphoonOPcache(
    directory: 'path/to/cache/dir',
    defaultTtl: new DateInterval('T1M'),
);

How to delete stale cache items

use Typhoon\OPcache\TyphoonOPcache;

$cache = new TyphoonOPcache('path/to/cache/dir');
$cache->prune();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-09-21