cheese44/cheesecache 问题修复 & 功能扩展

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

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

cheese44/cheesecache

Composer 安装命令:

composer require cheese44/cheesecache

包简介

A request scoped cache library for PHP with the goal to make caching consistent and maintainable.

README 文档

README

Software License Build Status Coverage Status

A request scoped cache library for PHP with the goal to make caching consistent and maintainable.

Best used for caching function and query results that are called multiple times during a request and are unlikely to change

Installation

Package is available on Packagist, you can install it using Composer.

composer require cheese44/cheesecache

Usage

    use cheeseCache\app;
    
    class Test {
  
        /**
         * cheeseCache does all the work for you
         * 
         * you don't have to clutter your code with checking, setting and reading the cache yourself
         */
        public function cacheSum($a, $b) {
            $cache = cheeseCache\app\cacheProvider::getCache();
      
            $sum = $cache->cache(
                array($a, $b),
                function() use($a, $b) {
                    return $a + $b;
                });
        
            return $sum;
        }
    
        /**
         * of course cheeseCache still gives you the possibility to manually access these functionalities
         */
        public function cacheSum_Explicit($a, $b) {
            $cache = cheeseCache\app\cacheProvider::getCache();
      
            if($cache->isCacheSet(array($a, $b))):
                return $cache->geCacheValue(array($a, $b));
            endif;
      
            $sum = $a + $b;
      
            $cache->cache(
                array($a, $b),
                $sum
            );
      
            return $sum;
        }
  
    }
    

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-07-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固