From cb566fab3effd5c04a609abbba3d6eeb86560886 Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Tue, 25 Feb 2014 11:38:00 +0000
Subject: [PATCH] Issue #2198339 by longwave, damiankloip: Remove cache.inc.

---
 core/includes/bootstrap.inc    |  1 -
 core/includes/cache.inc        | 53 ----------------------------------
 core/includes/common.inc       |  4 +--
 core/includes/install.core.inc |  1 -
 4 files changed, 2 insertions(+), 57 deletions(-)
 delete mode 100644 core/includes/cache.inc

diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index 41edd3d34927..4d90140adcf0 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -1797,7 +1797,6 @@ function _drupal_bootstrap_kernel() {
 function _drupal_bootstrap_page_cache() {
   global $user;
 
-  require_once __DIR__ . '/cache.inc';
   require_once __DIR__ . '/database.inc';
   // Check for a cache mode force from settings.php.
   if (settings()->get('page_cache_without_database')) {
diff --git a/core/includes/cache.inc b/core/includes/cache.inc
deleted file mode 100644
index 771d4d5b08f1..000000000000
--- a/core/includes/cache.inc
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-
-/**
- * @file
- * Functions and interfaces for cache handling.
- */
-
-use Drupal\Core\Cache\Cache;
-
-/**
- * Instantiates and statically caches the correct class for a cache bin.
- *
- * By default, this returns an instance of the Drupal\Core\Cache\DatabaseBackend
- * class.
- *
- * Classes implementing Drupal\Core\Cache\CacheBackendInterface can register
- * themselves both as a default implementation and for specific bins.
- *
- * @param $bin
- *   The cache bin for which the cache object should be returned, defaults to
- *   'cache'.
- *
- * @return \Drupal\Core\Cache\CacheBackendInterface
- *   The cache object associated with the specified bin.
- *
- * @see \Drupal\Core\Cache\CacheBackendInterface
- *
- * @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
- *   Use \Drupal::cache().
- */
-function cache($bin = 'cache') {
-  return \Drupal::cache($bin);
-}
-
-/**
- * Marks cache items from all bins with any of the specified tags as invalid.
- *
- * Many sites have more than one active cache backend, and each backend my use
- * a different strategy for storing tags against cache items, and invalidating
- * cache items associated with a given tag.
- *
- * When invalidating a given list of tags, we iterate over each cache backend,
- * and call invalidateTags() on each.
- *
- * @param array $tags
- *   The list of tags to invalidate cache items for.
- *
- * @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
- *   Use \Drupal\Core\Cache\Cache::invalidateTags().
- */
-function cache_invalidate_tags(array $tags) {
-  Cache::invalidateTags($tags);
-}
diff --git a/core/includes/common.inc b/core/includes/common.inc
index 4bb4a2fa25ba..1f2b74bea037 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -2760,7 +2760,7 @@ function drupal_add_library($module, $name, $every_page = NULL) {
 function drupal_get_library($extension, $name = NULL) {
   $libraries = &drupal_static(__FUNCTION__, array());
 
-  if (!isset($libraries[$extension]) && ($cache = cache()->get('library:info:' . $extension))) {
+  if (!isset($libraries[$extension]) && ($cache = \Drupal::cache()->get('library:info:' . $extension))) {
     $libraries[$extension] = $cache->data;
   }
 
@@ -2900,7 +2900,7 @@ function drupal_get_library($extension, $name = NULL) {
         }
       }
     }
-    cache()->set('library:info:' . $extension, $libraries[$extension], Cache::PERMANENT, array(
+    \Drupal::cache()->set('library:info:' . $extension, $libraries[$extension], Cache::PERMANENT, array(
       'extension' => array(TRUE, $extension),
       'library_info' => array(TRUE),
     ));
diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index 872b55c0328b..60121f751d11 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -296,7 +296,6 @@ function install_begin_request(&$install_state) {
   require_once __DIR__ . '/install.inc';
   require_once __DIR__ . '/schema.inc';
   require_once __DIR__ . '/../../' . settings()->get('path_inc', 'core/includes/path.inc');
-  require_once __DIR__ . '/cache.inc';
   require_once __DIR__ . '/database.inc';
   require_once __DIR__ . '/form.inc';
   require_once __DIR__ . '/batch.inc';
-- 
GitLab