2017 © Pedro Peláez
 

symfony-bundle simple-cache-bundle

Very simple cache system for symfony2. The cache data are saved in one table in database.

image

kitpages/simple-cache-bundle

Very simple cache system for symfony2. The cache data are saved in one table in database.

  • Friday, December 20, 2013
  • by kitpages
  • Repository
  • 8 Watchers
  • 5 Stars
  • 26,511 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 8 Versions
  • 3 % Grown

The README.md

KitpagesSimpleCacheBundle

Very simple cache system for symfony2. The cache data are saved in one table in database., (*1)

author : Philippe Le Van (twitter : @plv) http://www.kitpages.fr/fr/cms/102/kitpagessimplecachebundle, (*2)

Installation

hum... as usual..., (*3)

put the code in vendors/Kitpages/SimpleCacheBundle, (*4)

add vendors/ in the app/autoload.php, (*5)

add the new Bundle in app/appKernel.php, (*6)

You need to create a table in the database :, (*7)

CREATE TABLE `simple_cache_backend` (
  `id` varchar(255) NOT NULL,
  `data` longtext COMMENT '(DC2Type:array)',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `expired_at` datetime default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

(or you can use php app/console doctrine:schema:update), (*8)

Users Guide

1/ record & retrieve into/from the cache

$cacheManager = $this->get('kitpages.simple_cache');
$html = $cacheManager->get(
    'my-cache-uniq-id-12',
    function() {
        $output = "hello world";
        sleep (3);
        return $output;
    }
);

2/ clear the cache

$cacheManager = $this->get('kitpages.simple_cache');
$cacheManager->clear('my-cache-uniq-id-12');

3/ a more complex example : arguments given to the callback and expiration

$html = $cacheManager->get(
    'my-cache-uniq-id-12',
    function($arg1, $arg2) {
        $output = "hello world";
        sleep (3);
        return $output;
    },
    array(12, 34),
    $myExpirationTimeInSeconds
);

4/ multiple delete in the cache

$cacheManager = $this->get('kitpages.simple_cache');
$cacheManager->clear('my-cache-%');
// remove all the entries in the cache beginning by "my-cache-"

The Versions

20/12 2013

dev-master

9999999-dev http://github.com/kitpages/KitpagesSimpleCacheBundle

Very simple cache system for symfony2. The cache data are saved in one table in database.

  Sources   Download

MIT

The Requires

 

The Development Requires

cache doctrine

09/09 2013

v3.0.0

3.0.0.0 http://github.com/kitpages/KitpagesSimpleCacheBundle

Very simple cache system for symfony2. The cache data are saved in one table in database.

  Sources   Download

BSD

The Requires

 

The Development Requires

cache doctrine

12/10 2012

v2.1.0RC1

2.1.0.0-RC1 http://github.com/kitpages/KitpagesSimpleCacheBundle

Very simple cache system for symfony2. The cache data are saved in one table in database.

  Sources   Download

BSD

The Requires

 

cache

11/10 2012

v2.1.0BETA3

2.1.0.0-beta3 http://github.com/kitpages/KitpagesSimpleCacheBundle

Very simple cache system for symfony2. The cache data are saved in one table in database.

  Sources   Download

BSD

The Requires

 

cache

10/10 2012

v2.1.0BETA2

2.1.0.0-beta2 http://github.com/kitpages/KitpagesSimpleCacheBundle

Very simple cache system for symfony2. The cache data are saved in one table in database.

  Sources   Download

BSD

The Requires

 

cache

08/10 2012

v2.1.0BETA1

2.1.0.0-beta1 http://github.com/kitpages/KitpagesSimpleCacheBundle

Very simple cache system for symfony2. The cache data are saved in one table in database.

  Sources   Download

BSD

The Requires

 

cache

08/10 2012

2.0.x-dev

2.0.9999999.9999999-dev http://github.com/kitpages/KitpagesSimpleCacheBundle

Very simple cache system for symfony2. The cache data are saved in one table in database.

  Sources   Download

BSD

The Requires

 

cache

24/05 2012

v1.0.0

1.0.0.0 http://github.com/kitpages/KitpagesSimpleCacheBundle

Very simple cache system for symfony2. The cache data are saved in one table in database.

  Sources   Download

BSD

The Requires

 

cache