diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index d8f5e2f..d5b411e 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -321,6 +321,7 @@ function install_begin_request(&$install_state) { drupal_language_initialize(); require_once DRUPAL_ROOT . '/core/includes/ajax.inc'; + require_once DRUPAL_ROOT . '/core/includes/cache.inc'; // Override the module list with a minimal set of modules. $module_list['system']['filename'] = 'core/modules/system/system.module'; $module_list['user']['filename'] = 'core/modules/user/user.module'; @@ -328,18 +329,6 @@ function install_begin_request(&$install_state) { drupal_load('module', 'system'); drupal_load('module', 'user'); - // Load the cache infrastructure using a "fake" cache implementation that - // does not attempt to write to the database. We need this during the initial - // part of the installer because the database is not available yet. We - // continue to use it even when the database does become available, in order - // to preserve consistency between interactive and command-line installations - // (the latter complete in one page request and therefore are forced to - // continue using the cache implementation they started with) and also - // because any data put in the cache during the installer is inherently - // suspect, due to the fact that Drupal is not fully set up yet. - require_once DRUPAL_ROOT . '/core/includes/cache.inc'; - $conf['cache_classes'] = array('cache' => 'Drupal\Core\Cache\InstallBackend'); - // The install process cannot use the database lock backend since the database // is not fully up, so we use a null backend implementation during the // installation process. This will also speed up the installation process. diff --git a/core/lib/Drupal/Core/Cache/DatabaseBackend.php b/core/lib/Drupal/Core/Cache/DatabaseBackend.php index d4de8bf..c7bd4b2 100644 --- a/core/lib/Drupal/Core/Cache/DatabaseBackend.php +++ b/core/lib/Drupal/Core/Cache/DatabaseBackend.php @@ -188,10 +188,15 @@ class DatabaseBackend implements CacheBackendInterface { * Implements Drupal\Core\Cache\CacheBackendInterface::expire(). */ function expire() { - Database::getConnection()->delete($this->bin) - ->condition('expire', CacheBackendInterface::CACHE_PERMANENT, '<>') - ->condition('expire', REQUEST_TIME, '<') - ->execute(); + try { + Database::getConnection()->delete($this->bin) + ->condition('expire', CacheBackendInterface::CACHE_PERMANENT, '<>') + ->condition('expire', REQUEST_TIME, '<') + ->execute(); + } + catch (Exception $e) { + // The database may not be available, so we'll ignore expire requests. + } } /** diff --git a/core/lib/Drupal/Core/Cache/InstallBackend.php b/core/lib/Drupal/Core/Cache/InstallBackend.php deleted file mode 100644 index b507684..0000000 --- a/core/lib/Drupal/Core/Cache/InstallBackend.php +++ /dev/null @@ -1,151 +0,0 @@ -