2017 © Pedro Peláez
 

library rcache

Simple caching library

image

i80586/rcache

Simple caching library

  • Thursday, June 14, 2018
  • by i80586
  • Repository
  • 0 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

RCache

Build Status Total Downloads, (*1)

Simple PHP library for caching data in files and memory, (*2)

Installing via Composer

The recommended way to install RCache is through Composer., (*3)

# Install Composer
curl -sS https://getcomposer.org/installer | php

Next, add following string into the composer.json file:, (*4)

{
    ...
    "require" : {
        ...
         "i80586/rcache": "dev-master"
        ...
    }
    ...
}

Now you can update composer packages via, (*5)

composer update

After installing, you need to require Composer's autoloader:, (*6)

require 'vendor/autoload.php';

Examples

File cache (manually cache)


use RCache\Cache; use RCache\FileCache; $cache = new Cache(new FileCache(__DIR__ . '/cache')); // save data in cache $cache->set('country', [ 'city' => 'Baku', 'country' => 'Azerbaijan' ], 3600); // get cache by identifier $country = $cache->get('country'); // remove cache $cache->drop('country');

File cache (content cache)


use RCache\Cache; use RCache\FileCache; $cache = new Cache(new FileCache(__DIR__ . '/cache')); ...other HTML content... start('fragment-caching', 3600)) { ?> ...content to be cached... end(); } ?> ...other HTML content...

Memory cache (manually cache)


use RCache\Cache; use RCache\MemCache; $cache = new Cache(new MemCache()); // save data in cache $cache->set('country', [ 'city' => 'Baku', 'country' => 'Azerbaijan' ], 3600); // get cache by identifier $country = $cache->get('country'); // remove cache $cache->drop('country');

Memory cache (content cache)


use RCache\Cache; use RCache\MemCache; $cache = new Cache(new MemCache()); ...other HTML content... start('fragment-caching', 3600)) { ?> ...content to be cached... end(); } ?> ...other HTML content...

The Versions

14/06 2018

dev-refactoring

dev-refactoring

Simple caching library

  Sources   Download

The Requires

  • ext-memcache *

 

by Rasim Ashurov

file cache memory

22/11 2016

dev-master

9999999-dev

Simple caching library

  Sources   Download

The Requires

  • ext-memcache *

 

by Rasim Ashurov

file cache memory

22/11 2016

dev-develop

dev-develop

Simple caching library

  Sources   Download

The Requires

  • ext-memcache *

 

by Rasim Ashurov

file cache memory