schneidoa/php-easy-cache

简单的PHP缓存库

dev-master 2018-05-04 19:27 UTC

This package is auto-updated.

Last update: 2024-09-22 09:38:56 UTC


README

Daniel Schneider 创建

简介

PHPEasyCache 是一个简单的PHP缓存库。它设计得非常简单,易于扩展。

要求

开发

  • phpunit/phpunit: "5.4.*"

安装

主要设置

使用composer

  1. 在您的composer.json中添加此项目

     "require": {
         "schneidoa/php-easy-cache": "dev-master"
     }
    
    
  2. 现在告诉composer下载PHPEasyCache

     $ php composer.phar update
    

用法

 use Schneidoa\PHPEasyCache\Cache;

 $namespace = 'app_production';
 $cacheMe = array(1=> 'Text 1', 2 => 'Text 2');

 $cache =  new Cache($namespace);

 $cache->set('main_info_array', $cacheMe);

 $cachedObject = $cache->get('main_info_array', 'defaultValue');