Commit e6844da4 authored by catch's avatar catch

Issue #2376013 by pwolanin: Drupal 8 installer initially fails if settings.php...

Issue #2376013 by pwolanin: Drupal 8 installer initially fails if settings.php and services.yml are correct, but config directories are absent
parent 010cfbbb
......@@ -333,7 +333,7 @@ function install_begin_request(&$install_state) {
\Drupal::setContainer($container);
// Determine whether base system services are ready to operate.
$install_state['config_verified'] = install_verify_config_directory(CONFIG_ACTIVE_DIRECTORY) && install_verify_config_directory(CONFIG_STAGING_DIRECTORY);
$install_state['config_verified'] = install_ensure_config_directory(CONFIG_ACTIVE_DIRECTORY) && install_ensure_config_directory(CONFIG_STAGING_DIRECTORY);
$install_state['database_verified'] = install_verify_database_settings();
$install_state['settings_verified'] = $install_state['config_verified'] && $install_state['database_verified'];
......
......@@ -514,41 +514,6 @@ function drupal_install_config_directories() {
}
}
/**
* Checks whether a config directory exists and is writable.
*
* This partially duplicates install_ensure_config_directory(), but is required
* since the installer would create the config directory too early in the
* installation process otherwise (e.g., when only visiting install.php when
* there is a settings.php already, but not actually executing the
* installation).
*
* @param string $type
* Type of config directory to return. Drupal core provides 'active' and
* 'staging'.
*
* @return bool
* TRUE if the config directory exists and is writable.
*/
function install_verify_config_directory($type) {
global $config_directories;
if (!isset($config_directories[$type])) {
return FALSE;
}
// config_get_config_directory() throws an exception when the passed $type
// does not exist in $config_directories. This can happen if there is a
// prepared settings.php that defines $config_directories already.
try {
$config_directory = config_get_config_directory($type);
if (is_dir($config_directory) && is_writable($config_directory)) {
return TRUE;
}
}
catch (\Exception $e) {
}
return FALSE;
}
/**
* Ensures that the config directory exists and is writable, or can be made so.
*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment