schneidoa / php-easy-cache
Simple PHP Cache Library
dev-master
2018-05-04 19:27 UTC
Requires
- php: >=7.1
Requires (Dev)
- phpunit/phpunit: 5.4.*
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
- PHP>=7.1
- APCU
DEV
- phpunit/phpunit: "5.4.*"
Installation
Main Setup
With composer
Add this project in your composer.json:
"require": { "schneidoa/php-easy-cache": "dev-master" }
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');