2017-25 © Pedro Peláez
 

library cache

好用的PHP缓存类库

image

keepeye/cache

好用的PHP缓存类库

  • Tuesday, April 17, 2018
  • by zstxt1989
  • Repository
  • 1 Watchers
  • 3 Stars
  • 16 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 2 Versions
  • 7 % Grown

The README.md

Introduction

This is a simple PHP cache library., (*1)

It supports diffrent drivers., (*2)

Basic usage

  1. Install through composer, (*3)

    composer require keepeye/cache
  2. just look:, (*4)

    <?php
    include "vendor/autoload.php";
    //first you should make a instance of cacheManager
    $cacheManager = new Keepeye\Cache\Cache;
    //get a instance of driver through cacheManager with some options
    $cache = $cacheManager->getInstance(array(
        "dir" => __DIR__."/cache"
    ));
    //store an item in the cache for 600 seconds.
    $cache->put("k1","v1",600);
    //retrieve an item by key
    $cache->get("k1");//output "v1"
    //remove an item
    $cache->forget("k1");
    $cache->get("k1");//get null
    //remove all
    $cache->fush();

Advanced usage

  1. FileDriver, (*5)

    This driver is based on the filesystem.It has options below:, (*6)

    - **dir** where the cache files stored in.
    - **depth** cache dir depth,default 2
  2. Other drivers, (*7)

    Some other drivers will be supported in future,such as redis、mysql、sqlite etc., (*8)

Tests

You should have phpunit installed. Then enter the directory, execute:, (*9)

composer install
phpunit

License

This library is open-sourced software licensed under the [MIT license][1], (*10)

The Versions

17/04 2018

dev-master

9999999-dev

好用的PHP缓存类库

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by keepeye

08/05 2015

1.0

1.0.0.0

好用的PHP缓存类库

  Sources   Download

MIT

The Requires

  • php >=5.3

 

by keepeye