diff --git a/core/includes/common.inc b/core/includes/common.inc index 2def62d..d6786da 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -3653,7 +3653,8 @@ function drupal_render_page($page) { * required. If 'cid' is set, 'keys' is ignored. Use only if you have * special requirements. * - 'expire': Set to one of the cache lifetime constants. - * - 'bin': Specify a cache bin to cache the element in. Default is 'cache'. + * - 'bin': Specify a cache bin to cache the element in. Default is + * 'default'. * - If this element has #type defined and the default attributes for this * element have not already been merged in (#defaults_loaded = TRUE) then * the defaults for this type of element, defined in hook_element_info(), @@ -4073,7 +4074,7 @@ function drupal_render_cache_get(array $elements) { if (!\Drupal::request()->isMethodSafe() || !$cid = drupal_render_cid_create($elements)) { return FALSE; } - $bin = isset($elements['#cache']['bin']) ? $elements['#cache']['bin'] : 'cache'; + $bin = isset($elements['#cache']['bin']) ? $elements['#cache']['bin'] : 'default'; if (!empty($cid) && $cache = \Drupal::cache($bin)->get($cid)) { $cached_element = $cache->data; @@ -4131,7 +4132,7 @@ function drupal_render_cache_set(&$markup, array $elements) { $data['#cache']['tags'] = $elements['#cache']['tags']; } - $bin = isset($elements['#cache']['bin']) ? $elements['#cache']['bin'] : 'cache'; + $bin = isset($elements['#cache']['bin']) ? $elements['#cache']['bin'] : 'default'; $expire = isset($elements['#cache']['expire']) ? $elements['#cache']['expire'] : Cache::PERMANENT; \Drupal::cache($bin)->set($cid, $data, $expire, $elements['#cache']['tags']); } @@ -4619,7 +4620,7 @@ function watchdog_severity_levels() { * - Clears all persistent caches: * - The bootstrap cache bin containing base system, module system, and theme * system information. - * - The common 'cache' cache bin containing arbitrary caches. + * - The common 'default' cache bin containing arbitrary caches. * - The page cache. * - The URL alias path cache. * - Resets all static variables that have been defined via drupal_static(). diff --git a/core/lib/Drupal/Core/Controller/ControllerBase.php b/core/lib/Drupal/Core/Controller/ControllerBase.php index 7eb368a..3af41f5 100644 --- a/core/lib/Drupal/Core/Controller/ControllerBase.php +++ b/core/lib/Drupal/Core/Controller/ControllerBase.php @@ -147,12 +147,12 @@ protected function entityFormBuilder() { * * @param string $bin * (optional) The cache bin for which the cache object should be returned, - * defaults to 'cache'. + * defaults to 'default'. * * @return \Drupal\Core\Cache\CacheBackendInterface * The cache object associated with the specified bin. */ - protected function cache($bin = 'cache') { + protected function cache($bin = 'default') { return $this->container()->get('cache.' . $bin); } diff --git a/core/lib/Drupal/Core/Entity/EntityViewBuilder.php b/core/lib/Drupal/Core/Entity/EntityViewBuilder.php index 2e48ecc..05674a1 100644 --- a/core/lib/Drupal/Core/Entity/EntityViewBuilder.php +++ b/core/lib/Drupal/Core/Entity/EntityViewBuilder.php @@ -51,7 +51,7 @@ class EntityViewBuilder extends EntityControllerBase implements EntityController * * @var string */ - protected $cacheBin = 'cache'; + protected $cacheBin = 'default'; /** * The language manager. diff --git a/core/modules/hal/lib/Drupal/hal/Tests/NormalizerTestBase.php b/core/modules/hal/lib/Drupal/hal/Tests/NormalizerTestBase.php index 99e8de7..7b70ee5 100644 --- a/core/modules/hal/lib/Drupal/hal/Tests/NormalizerTestBase.php +++ b/core/modules/hal/lib/Drupal/hal/Tests/NormalizerTestBase.php @@ -120,7 +120,7 @@ function setUp() { 'bundle' => 'entity_test', ))->save(); - $link_manager = new LinkManager(new TypeLinkManager(new MemoryBackend('cache')), new RelationLinkManager(new MemoryBackend('cache'))); + $link_manager = new LinkManager(new TypeLinkManager(new MemoryBackend('default')), new RelationLinkManager(new MemoryBackend('default'))); // Set up the mock serializer. $normalizers = array( diff --git a/core/modules/migrate_drupal/migrate_drupal.services.yml b/core/modules/migrate_drupal/migrate_drupal.services.yml index 8ed0b5c..10c1b86 100644 --- a/core/modules/migrate_drupal/migrate_drupal.services.yml +++ b/core/modules/migrate_drupal/migrate_drupal.services.yml @@ -1,4 +1,4 @@ services: plugin.manager.migrate.load: class: Drupal\migrate\Plugin\MigratePluginManager - arguments: [load, '@container.namespaces', '@cache.cache', '@language_manager', '@module_handler'] \ No newline at end of file + arguments: [load, '@container.namespaces', '@cache.default', '@language_manager', '@module_handler'] diff --git a/core/modules/system/core.api.php b/core/modules/system/core.api.php index 4ba0a23..955d52d 100644 --- a/core/modules/system/core.api.php +++ b/core/modules/system/core.api.php @@ -217,8 +217,8 @@ * * When you request a cache object, you can specify the bin name in your call to * \Drupal::cache(). Alternatively, you can request a bin by getting service - * "cache.nameofbin" from the container. The default bin is called "cache", with - * service name "cache.cache". + * "cache.nameofbin" from the container. The default bin is called + * "cache_default", with service name "cache.default". * * @todo: Document common cache bins in https://drupal.org/node/1194136 * @@ -296,18 +296,18 @@ * different cache backend, such as APC or Memcache. The default backend stores * the cached data in the Drupal database. * - * In a settings.php file, you can override the class used for a particular - * cache bin. For example, if your implementation of - * \Drupal\Core\Cache\CacheBackendInterface was called MyCustomCache, the - * following line would make Drupal use it for the 'cache_page' bin: + * In a settings.php file, you can override the service used for a particular + * cache bin. For example, if your service implementation of + * \Drupal\Core\Cache\CacheBackendInterface was called cache.custom, the + * following line would make Drupal use it for the 'cache_render' bin: * @code - * $settings['cache_classes']['cache_page'] = 'Drupal\full\namespace\to\MyCustomCache'; + * $settings['cache']['bins']['render'] = 'cache.custom'; * @endcode * * Additionally, you can register your cache implementation to be used by * default for all cache bins with: * @code - * $settings['cache_classes']['cache'] = 'Drupal\full\namespace\to\MyCustomCache'; + * $settings['cache']['default'] = 'cache.custom'; * @endcode * * @see https://drupal.org/node/1884796 diff --git a/core/modules/system/lib/Drupal/system/Tests/Path/AliasTest.php b/core/modules/system/lib/Drupal/system/Tests/Path/AliasTest.php index 5f5d368..8e62722 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Path/AliasTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Path/AliasTest.php @@ -165,7 +165,7 @@ function testWhitelist() { $connection = Database::getConnection(); $this->fixtures->createTables($connection); - $memoryCounterBackend = new MemoryCounterBackend('cache'); + $memoryCounterBackend = new MemoryCounterBackend('default'); // Create AliasManager and Path object. $whitelist = new AliasWhitelist('path_alias_whitelist', $memoryCounterBackend, $this->container->get('lock'), $this->container->get('state'), $connection);