vanilla/vanilla-docker

Create memcached service

DaazKu opened this issue · 1 comments

Create a memcached service that works with the other services.

We need to add documentation about how to enable/disable the usage of memcached in vanilla.

Something like this in bootsteap.early.php:

if (c('Garden.Installed')) {
   // Cache
   saveToConfig('Cache.Enabled', false); # Just toggle this to true for testing with cache; usually it's a pain to leave on
   saveToConfig('Cache.Method', 'memcached');
   saveToConfig('Cache.Memcached.Store', array('localhost:11211'));

   if (c('Cache.Enabled') && class_exists('Memcached')) {
       saveToConfig('Cache.Memcached.Option.'.Memcached::OPT_COMPRESSION, true, false);
       saveToConfig('Cache.Memcached.Option.'.Memcached::OPT_DISTRIBUTION, Memcached::DISTRIBUTION_CONSISTENT, false);
       saveToConfig('Cache.Memcached.Option.'.Memcached::OPT_LIBKETAMA_COMPATIBLE, true, false);
       saveToConfig('Cache.Memcached.Option.'.Memcached::OPT_NO_BLOCK, true, false);
       saveToConfig('Cache.Memcached.Option.'.Memcached::OPT_TCP_NODELAY, true, false);
       saveToConfig('Cache.Memcached.Option.'.Memcached::OPT_CONNECT_TIMEOUT, 2000, false);
       saveToConfig('Cache.Memcached.Option.'.Memcached::OPT_SERVER_FAILURE_LIMIT, 2, false);
   }
}

Fixed by #24