You are here

README.Predis.txt in Redis 7

Same filename and directory in other branches
  1. 8 README.Predis.txt
  2. 7.3 README.Predis.txt
  3. 7.2 README.Predis.txt
Predis cache backend
====================

This client, for now, is only able to use the Predis PHP library.

The Predis library requires PHP 5.3 minimum. If your hosted environment does
not ships with at least PHP 5.3, please do not use this cache backend.

This code is ALPHA code. This means: DO NOT USE IT IN PRODUCTION. Not until
I don't ship any BETA release as a full Drupal.org module.

Please consider using an OPCode cache such as APC. Predis is a good and fully
featured API, the cost is that the code is a lot more than a single file in
opposition to some other backends such as the APC one.

Get Predis
----------

You can download this library at:

  https://github.com/nrk/predis

This file explains how to install the Predis library and the Drupal cache
backend. If you are an advanced Drupal integrator, please consider the fact
that you can easily change all the pathes. Pathes used in this file are
likely to be default for non advanced users.

Download and install library
----------------------------

Once done, you either have to clone it into:
  sites/all/libraries/predis

So that you have the following directory tree:

  sites/all/libraries/lib/Predis # Where the PHP code stands

Or, any other place in order to share it:
For example, into your libraries folder, in order to get:

  some/dir/predis/lib

If you choose this solution, you have to alter a bit your $conf array into
the settings.php file as this:

  define('PREDIS_BASE_PATH', DRUPAL_ROOT . '/some/dir/predis/lib/');

Tell Drupal to use the cache backend
------------------------------------

Usual cache backend configuration, as follows, to add into your settings.php
file like any other backend:

  $conf['cache_backends'][]            = 'sites/all/modules/redis/predis.cache.inc';
  $conf['cache_class_cache']           = 'Redis_Cache_Predis';
  $conf['cache_class_cache_menu']      = 'Redis_Cache_Predis';
  $conf['cache_class_cache_bootstrap'] = 'Redis_Cache_Predis';
  // ... Any other bins.

Tell Drupal to use the lock backend
-----------------------------------

Usual lock backend override, update you settings.php file as this:

  $conf['lock_inc'] = 'sites/all/modules/custom/redis/predis.lock.inc';

Connect to a remote host and database
-------------------------------------

See README.txt file.

Advanced configuration (PHP expert)
-----------------------------------

Best solution is, whatever is the place where you put the Predis library, that
you set up a fully working autoloader able to use it.

File

README.Predis.txt
View source
  1. Predis cache backend
  2. ====================
  3. This client, for now, is only able to use the Predis PHP library.
  4. The Predis library requires PHP 5.3 minimum. If your hosted environment does
  5. not ships with at least PHP 5.3, please do not use this cache backend.
  6. This code is ALPHA code. This means: DO NOT USE IT IN PRODUCTION. Not until
  7. I don't ship any BETA release as a full Drupal.org module.
  8. Please consider using an OPCode cache such as APC. Predis is a good and fully
  9. featured API, the cost is that the code is a lot more than a single file in
  10. opposition to some other backends such as the APC one.
  11. Get Predis
  12. ----------
  13. You can download this library at:
  14. https://github.com/nrk/predis
  15. This file explains how to install the Predis library and the Drupal cache
  16. backend. If you are an advanced Drupal integrator, please consider the fact
  17. that you can easily change all the pathes. Pathes used in this file are
  18. likely to be default for non advanced users.
  19. Download and install library
  20. ----------------------------
  21. Once done, you either have to clone it into:
  22. sites/all/libraries/predis
  23. So that you have the following directory tree:
  24. sites/all/libraries/lib/Predis # Where the PHP code stands
  25. Or, any other place in order to share it:
  26. For example, into your libraries folder, in order to get:
  27. some/dir/predis/lib
  28. If you choose this solution, you have to alter a bit your $conf array into
  29. the settings.php file as this:
  30. define('PREDIS_BASE_PATH', DRUPAL_ROOT . '/some/dir/predis/lib/');
  31. Tell Drupal to use the cache backend
  32. ------------------------------------
  33. Usual cache backend configuration, as follows, to add into your settings.php
  34. file like any other backend:
  35. $conf['cache_backends'][] = 'sites/all/modules/redis/predis.cache.inc';
  36. $conf['cache_class_cache'] = 'Redis_Cache_Predis';
  37. $conf['cache_class_cache_menu'] = 'Redis_Cache_Predis';
  38. $conf['cache_class_cache_bootstrap'] = 'Redis_Cache_Predis';
  39. // ... Any other bins.
  40. Tell Drupal to use the lock backend
  41. -----------------------------------
  42. Usual lock backend override, update you settings.php file as this:
  43. $conf['lock_inc'] = 'sites/all/modules/custom/redis/predis.lock.inc';
  44. Connect to a remote host and database
  45. -------------------------------------
  46. See README.txt file.
  47. Advanced configuration (PHP expert)
  48. -----------------------------------
  49. Best solution is, whatever is the place where you put the Predis library, that
  50. you set up a fully working autoloader able to use it.