schneidoa/php-easy-cache

Simple PHP Cache Library

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

This package is auto-updated.

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


README

Created by Daniel Schneider

Introduction

PHPEasyCache is a simple PHP Cache Library. It is designed to be very simple and easy to extend.

Requirements

DEV

  • phpunit/phpunit: "5.4.*"

Installation

Main Setup

With composer

  1. Add this project in your composer.json:

     "require": {
         "schneidoa/php-easy-cache": "dev-master"
     }
    
    
  2. Now tell composer to download PHPEasyCache:

     $ php composer.phar update
    

Usage

 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');