承接 yggverse/cache 相关项目开发

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

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

yggverse/cache

最新稳定版本:0.4.1

Composer 安装命令:

composer require yggverse/cache

包简介

Cache tools for PHP applications

README 文档

README

Cache tools for PHP applications

Memory

Extends PHP memcached

Init

$memory = new \Yggverse\Cache\Memory(

  'localhost',  // memcached server host, localhost by default
  11211,        // memcached server port, 11211 by default

  'my_app',     // application namespace
  3600 + time() // cache time by default
);

Supported methods

Memory::set
Memory::delete
Memory::flush
Memory::get
Memory::getByValueCallback

Return cached or cache new value of plain value callback

  $value = $memory->getByValueCallback(
    'key_name',    // string, unique key name
    'value',       // mixed, plain value
    3600 + time(), // optional, cache timeout for this value
  );
Memory::getByMethodCallback

Return cached or cache new value of object method callback

  $value = $memory->getByMethodCallback(
    $class_object,         // object of method class
    'method_name',         // object method name
    [
      $method_attribute_1, // optional, array of attributes callback method requires
      $method_attribute_2,
      ...
    ]
    3600 + time(),         // optional, cache timeout for this value
  );

统计信息

  • 总下载量: 81
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

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

其他信息

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