summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamian Lee2017-09-25 07:47:51 (GMT)
committerDamian Lee2017-09-25 07:47:51 (GMT)
commit730f0ef2ba6bfc52b25d50cc2103f5f674b9cffd (patch)
treec163363adc9e1c22c8212da3fd026c2041b413c7
parentb6881b3f375c8a9ee30ce4d9758564cdbc1d97e5 (diff)
Issue #2882755 by guilopes, mxh, damiankloip, afi13: Move container to memcache8.x-2.0-alpha58.x-2.x
-rw-r--r--README.txt50
1 files changed, 50 insertions, 0 deletions
diff --git a/README.txt b/README.txt
index 240358c..6705434 100644
--- a/README.txt
+++ b/README.txt
@@ -166,6 +166,56 @@ Memcache locks can be enabled through the services.yml file.
class: Drupal\Core\Lock\LockBackendInterface
factory: memcache.lock.factory:getPersistent
+## Cache Container on bootstrap ##
+By default Drupal starts the cache_container on the database, in order to override that you can use the following code on your settings.php file. Make sure that the $class_load->addPsr4 is poiting to the right location of memcache (on this case modules/contrib/memcache/src)
+
+$memcache_exists = class_exists('Memcache', FALSE);
+$memcached_exists = class_exists('Memcached', FALSE);
+if ($memcache_exists || $memcached_exists) {
+ $class_loader->addPsr4('Drupal\\memcache\\', 'modules/contrib/memcache/src');
+
+ // Define custom bootstrap container definition to use Memcache for cache.container.
+ $settings['bootstrap_container_definition'] = [
+ 'parameters' => [],
+ 'services' => [
+ 'database' => [
+ 'class' => 'Drupal\Core\Database\Connection',
+ 'factory' => 'Drupal\Core\Database\Database::getConnection',
+ 'arguments' => ['default'],
+ ],
+ 'settings' => [
+ 'class' => 'Drupal\Core\Site\Settings',
+ 'factory' => 'Drupal\Core\Site\Settings::getInstance',
+ ],
+ 'memcache.config' => [
+ 'class' => 'Drupal\memcache\DrupalMemcacheConfig',
+ 'arguments' => ['@settings'],
+ ],
+ 'memcache.backend.cache.factory' => [
+ 'class' => 'Drupal\memcache\DrupalMemcacheFactory',
+ 'arguments' => ['@memcache.config']
+ ],
+ 'memcache.backend.cache.container' => [
+ 'class' => 'Drupal\memcache\DrupalMemcacheFactory',
+ 'factory' => ['@memcache.backend.cache.factory', 'get'],
+ 'arguments' => ['container'],
+ ],
+ 'lock.container' => [
+ 'class' => 'Drupal\memcache\Lock\MemcacheLockBackend',
+ 'arguments' => ['container', '@memcache.backend.cache.container'],
+ ],
+ 'cache_tags_provider.container' => [
+ 'class' => 'Drupal\Core\Cache\DatabaseCacheTagsChecksum',
+ 'arguments' => ['@database'],
+ ],
+ 'cache.container' => [
+ 'class' => 'Drupal\memcache\MemcacheBackend',
+ 'arguments' => ['container', '@memcache.backend.cache.container', '@lock.container', '@memcache.config', '@cache_tags_provider.container'],
+ ],
+ ],
+ ];
+}
+
## TROUBLESHOOTING ##
PROBLEM: