Bug 8092: Convert Koha::Cache to use CHI
authorJared Camins-Esakov <jcamins@cpbibliography.com>
Tue, 15 May 2012 17:03:30 +0000 (13:03 -0400)
committerPaul Poulain <paul.poulain@biblibre.com>
Sat, 9 Jun 2012 11:08:13 +0000 (13:08 +0200)
commitd5d6daad1cc5ae1a9b0b41c6ed577dbcbf17df7a
treee2ae2ee8f61c36a087c969eb4e119da57fd7a710
parentb76ab0ec66e30e5935a0b8172d91969e0e2695b4
Bug 8092: Convert Koha::Cache to use CHI

Implements cache handlers for Memcached, mmap shared-file persistent,
and in-process memory caches. If CHI is unavailable, Koha::Cache::Memcached
will fall back to using Cache::Memcached::Fast, or caching will be skipped
without croaking.

To test: run t/Cache.t with the following options, before and after
installing CHI:

2. Tests 3-9 should be skipped with the following:
export CACHING_SYSTEM=

2. You should receive two failures with the following if CHI is not installed:
export CACHING_SYSTEM=memory

3. You should receive two failures with the following if CHI is not installed:
export CACHING_SYSTEM=fastmmap

4. You will need memcached activated for the following to work (but it
   will work both with and without CHI):
export CACHING_SYSTEM=memcached
export MEMCACHED_SERVERS=127.0.0.1:11211
export MEMCACHED_NAMESPACE=KOHA

5. You should receive two failures with the following:
export CACHING_SYSTEM=thisdoesntexist

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Works as advertised, now we need a follow up to add the new dependency.

http://bugs.koha-community.org/show_bug.cgi?id=8029
Koha/Cache.pm
Koha/Cache/Fastmmap.pm [new file with mode: 0644]
Koha/Cache/Memcached.pm
Koha/Cache/Memory.pm [new file with mode: 0644]
Koha/Cache/Null.pm [new file with mode: 0644]
t/Cache.t