README 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. The Memcached plugin implements cache interface for memcached.
  2. See: http://memcached.org/
  3. The difference between the former `MemcachePlugin` and `MemcachedPlugin` is that they use,
  4. respectively, `memcache` and `memcached` as the underlying php libraries. These are similar
  5. libraries, made by different authors with slightly different cacpabilities, therefore `memcached`
  6. was selected.
  7. Installation
  8. ============
  9. Tell your `config.php` to use this plugin (replace `tcp://localhost:6379` with the address/port
  10. of your Memcache backend server):
  11. `addPlugin('Memcached');`
  12. Note that this typically requires configuring the `memcached` extension for `php`, which is
  13. typically available as a binary package from your system's package manager. In Debian based systems
  14. and on Arch based systems, this is likely available under the `php-memcached` package. Note the
  15. final `d`. On Arch, uncomment the line in `/etc/php/conf.d/memcached.ini` and restart your webserver
  16. and/or php-fpm or similar.
  17. Settings
  18. ========
  19. servers: Array of memcached servers addresses. Each server address should be either a string with
  20. address or an array where the first element is a string with the address an optional second element
  21. with the port.
  22. defaultExpiry: How long before cache expires (in seconds)
  23. Example
  24. =======
  25. addPlugin('Memcached', [ 'servers' => ['127.0.0.1', 11211],
  26. 'defaultExpiry' => 86400 // 24h
  27. ]);