项目作者: ihipop

项目描述 :
NullCache, An implementation of PSR-16 `SimpleCache` with `Basic data validation`
高级语言: PHP
项目地址: git://github.com/ihipop/PSR-NullCache.git
创建时间: 2019-04-01T02:33:21Z
项目社区:https://github.com/ihipop/PSR-NullCache

开源协议:

下载


NullCache | 中文说明

This Package Is a Null implementation of PSR-16 SimpleCache with Basic data validation

Why this Package ?

There is nothing like NullLogger of PSR-3 in PSR-16/PSR-6

I (Or if you) don’t want to write these code every where

  1. //...
  2. if ($this->cache){
  3. $this->cache->set($key,$value,$ttl);
  4. }
  5. //...
  6. if ($this->cache){
  7. $this->cache->get($key)
  8. }
  9. //...

Then You need this Package.

And want some Basic data validation ?

PSR-16 have some special InvalidArgumentException to throw when enter with invalid data.
You Will have these check if you use These Package,InvalidArgumentException will be thrown when it is necessary ,
to let you know your problem in earlier.

Usage

composer require ihipop/psr-null-cache

In your __construction or DI container initialization

  1. ///...
  2. $logger = new \ihipop\PsrNullCache\SimpleCache\NullCache(false);
  3. ///...

CacheInterfaceProxy

Use this trait when you want a quick implementation of PSR CacheInterface quickly via a Proxy class.