diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index c067328..409a997 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -146,10 +146,10 @@ function install_state_defaults() { // The last task that was completed during the previous installation // request. 'completed_task' => NULL, - // TRUE when there is a valid database connection. - 'database_verified' => FALSE, // TRUE when there are valid config directories. 'config_verified' => FALSE, + // TRUE when there is a valid database connection. + 'database_verified' => FALSE, // TRUE when a valid settings.php exists (containing both database // connection information and config directory names). 'settings_verified' => FALSE, @@ -271,19 +271,21 @@ function install_begin_request(&$install_state) { // This must go after drupal_bootstrap(), which unsets globals! global $conf; - require_once DRUPAL_ROOT . '/core/modules/system/system.install'; - require_once DRUPAL_ROOT . '/core/includes/ajax.inc'; + // Load include files containing procedural service helpers. require_once DRUPAL_ROOT . '/core/includes/cache.inc'; - require_once DRUPAL_ROOT . '/core/includes/common.inc'; require_once DRUPAL_ROOT . '/core/includes/database.inc'; + + // Required for module_list() override in early installer environment. require_once DRUPAL_ROOT . '/core/includes/file.inc'; - require_once DRUPAL_ROOT . '/core/includes/form.inc'; + require_once DRUPAL_ROOT . '/core/includes/module.inc'; + + // Required for various installer operations. require_once DRUPAL_ROOT . '/core/includes/install.inc'; - require_once DRUPAL_ROOT . '/core/includes/schema.inc'; - require_once DRUPAL_ROOT . '/' . variable_get('path_inc', 'core/includes/path.inc'); - include_once DRUPAL_ROOT . '/core/includes/module.inc'; - include_once DRUPAL_ROOT . '/core/includes/session.inc'; - require_once DRUPAL_ROOT . '/core/includes/entity.inc'; + + // Required for running install tasks. + require_once DRUPAL_ROOT . '/core/includes/form.inc'; + require_once DRUPAL_ROOT . '/core/includes/ajax.inc'; + require_once DRUPAL_ROOT . '/core/includes/batch.inc'; // Determine bootstrap status. if (!empty($install_state['parameters']['bootstrap'])) { @@ -338,6 +340,7 @@ function install_begin_request(&$install_state) { // install System module as well as all the rest of the system in a full // environment. else { + require_once DRUPAL_ROOT . '/core/includes/common.inc'; // DRUPAL_BOOTSTRAP_SESSION is incompatible with the installer, as it tries // to read and write sessions before the {users} table has been installed. // Therefore, the install_base_system() task needs a custom bootstrap that @@ -506,7 +509,6 @@ function install_run_task($task, &$install_state) { // If we are in the middle of processing this batch, keep sending back // any output from the batch process, until the task is complete. elseif ($current_batch == $function) { - include_once DRUPAL_ROOT . '/core/includes/batch.inc'; $output = _batch_page(); // Because Batch API now returns a JSON response for intermediary steps, // but the installer doesn't handle Response objects yet, just send the @@ -853,16 +855,9 @@ function install_verify_requirements(&$install_state) { * Install task: Installs the System module schema. */ function install_system_schema(&$install_state) { - // Create base system tables if they do not exist yet. - // The try/catch is not necessary under normal circumstances, but helps a lot - // when debugging the installer, since this install task has to be executed - // unconditionally until the install_system_rebuild() install task is reached, - // as we cannot determine whether system tables have been installed already. - try { - drupal_install_schema('system'); - } - catch (\Exception $e) { - } + require_once DRUPAL_ROOT . '/core/includes/schema.inc'; + require_once DRUPAL_ROOT . '/core/modules/system/system.install'; + drupal_install_schema('system'); } /** @@ -883,7 +878,6 @@ function install_system_rebuild(&$install_state) { // Otherwise, this phase is reached within the early-installer environment. // We need to unset all overrides and rebuild all necessary facilities to get // into a regular bootstrap state. - // Remove the service overrides. unset($conf['cache_classes']); unset($conf['keyvalue_default']); unset($conf['lock_backend']); diff --git a/core/lib/Drupal/Core/Config/DatabaseStorage.php b/core/lib/Drupal/Core/Config/DatabaseStorage.php index 1fb87b0..dac7402 100644 --- a/core/lib/Drupal/Core/Config/DatabaseStorage.php +++ b/core/lib/Drupal/Core/Config/DatabaseStorage.php @@ -145,7 +145,7 @@ public function encode($data) { */ public function decode($raw) { $data = @unserialize($raw); - return is_array($data) ? $data : FALSE; + return is_array($data) ? $data : array(); } /** diff --git a/core/modules/config/lib/Drupal/config/Tests/Storage/ConfigStorageTestBase.php b/core/modules/config/lib/Drupal/config/Tests/Storage/ConfigStorageTestBase.php index 064146c..f38c87a 100644 --- a/core/modules/config/lib/Drupal/config/Tests/Storage/ConfigStorageTestBase.php +++ b/core/modules/config/lib/Drupal/config/Tests/Storage/ConfigStorageTestBase.php @@ -39,14 +39,14 @@ function testCRUD() { $data = $this->storage->read($name); $this->assertIdentical($data, FALSE); - // Reading a name containing non-decodeable data returns FALSE. + // Reading a name containing non-decodeable data returns an array. $this->insert($name, ''); $data = $this->storage->read($name); - $this->assertIdentical($data, FALSE); + $this->assertIdentical($data, array()); $this->update($name, 'foo'); $data = $this->storage->read($name); - $this->assertIdentical($data, FALSE); + $this->assertIdentical($data, array()); $this->delete($name);