Update to Drupal 8.1.8. For more information, see https://www.drupal.org/project/drupal/releases/8.1.8

This commit is contained in:
Pantheon Automation 2016-08-03 13:22:33 -07:00 committed by Greg Anderson
parent e9f047ccf8
commit f9f23cdf38
312 changed files with 6751 additions and 1546 deletions

View file

@ -153,6 +153,7 @@ function config_get_config_directory($type) {
if (!empty($config_directories[$type])) {
return $config_directories[$type];
}
// @todo https://www.drupal.org/node/2696103 Throw a more specific exception.
throw new \Exception("The configuration directory type '$type' does not exist");
}

View file

@ -315,7 +315,22 @@ function file_ensure_htaccess() {
file_save_htaccess('private://', TRUE);
}
file_save_htaccess('temporary://', TRUE);
file_save_htaccess(config_get_config_directory(CONFIG_SYNC_DIRECTORY), TRUE);
// If a staging directory exists then it should contain a .htaccess file.
// @todo https://www.drupal.org/node/2696103 catch a more specific exception
// and simplify this code.
try {
$staging = config_get_config_directory(CONFIG_SYNC_DIRECTORY);
}
catch (\Exception $e) {
$staging = FALSE;
}
if ($staging) {
// Note that we log an error here if we can't write the .htaccess file. This
// can occur if the staging directory is read-only. If it is then it is the
// user's responsibility to create the .htaccess file.
file_save_htaccess($staging, TRUE);
}
}
/**

View file

@ -361,7 +361,13 @@ function install_begin_request($class_loader, &$install_state) {
\Drupal::setContainer($container);
// Determine whether base system services are ready to operate.
$install_state['config_verified'] = install_ensure_config_directory(CONFIG_SYNC_DIRECTORY);
try {
$sync_directory = config_get_config_directory(CONFIG_SYNC_DIRECTORY);
$install_state['config_verified'] = file_exists($sync_directory);
}
catch (Exception $e) {
$install_state['config_verified'] = FALSE;
}
$install_state['database_verified'] = install_verify_database_settings($site_path);
$install_state['settings_verified'] = $install_state['config_verified'] && $install_state['database_verified'];

View file

@ -486,16 +486,12 @@ function drupal_install_config_directories() {
// Add a randomized config directory name to settings.php, unless it was
// manually defined in the existing already.
$settings = [];
$config_directories_hash = Crypt::randomBytesBase64(55);
if (empty($config_directories[CONFIG_SYNC_DIRECTORY])) {
$config_directories[CONFIG_SYNC_DIRECTORY] = \Drupal::service('site.path') . '/files/config_' . Crypt::randomBytesBase64(55) . '/sync';
$settings['config_directories'][CONFIG_SYNC_DIRECTORY] = (object) [
'value' => \Drupal::service('site.path') . '/files/config_' . $config_directories_hash . '/sync',
'value' => $config_directories[CONFIG_SYNC_DIRECTORY],
'required' => TRUE,
];
}
if (!empty($settings)) {
// Rewrite settings.php, which also sets the value as global variable.
drupal_rewrite_settings($settings);
}
@ -506,19 +502,21 @@ function drupal_install_config_directories() {
// public files directory, which has already been verified to be writable
// itself. But if it somehow fails anyway, the installation cannot proceed.
// Bail out using a similar error message as in system_requirements().
if (!install_ensure_config_directory(CONFIG_SYNC_DIRECTORY)) {
if (!file_prepare_directory($config_directories[CONFIG_SYNC_DIRECTORY], FILE_CREATE_DIRECTORY)
&& !file_exists($config_directories[CONFIG_SYNC_DIRECTORY])) {
throw new Exception(t('The directory %directory could not be created or could not be made writable. To proceed with the installation, either create the directory and modify its permissions manually or ensure that the installer has the permissions to create it automatically. For more information, see the <a href=":handbook_url">online handbook</a>.', array(
'%directory' => config_get_config_directory(CONFIG_SYNC_DIRECTORY),
':handbook_url' => 'https://www.drupal.org/server-permissions',
)));
}
// Put a README.txt into the sync config directory. This is required so that
// they can later be added to git. Since this directory is auto-created, we
// have to write out the README rather than just adding it to the drupal core
// repo.
$text = 'This directory contains configuration to be imported into your Drupal site. To make this configuration active, visit admin/config/development/configuration/sync.' . ' For information about deploying configuration between servers, see https://www.drupal.org/documentation/administer/config';
file_put_contents(config_get_config_directory(CONFIG_SYNC_DIRECTORY) . '/README.txt', $text);
elseif (is_writable($config_directories[CONFIG_SYNC_DIRECTORY])) {
// Put a README.txt into the sync config directory. This is required so that
// they can later be added to git. Since this directory is auto-created, we
// have to write out the README rather than just adding it to the drupal core
// repo.
$text = 'This directory contains configuration to be imported into your Drupal site. To make this configuration active, visit admin/config/development/configuration/sync.' . ' For information about deploying configuration between servers, see https://www.drupal.org/documentation/administer/config';
file_put_contents(config_get_config_directory(CONFIG_SYNC_DIRECTORY) . '/README.txt', $text);
}
}
/**
@ -529,6 +527,9 @@ function drupal_install_config_directories() {
*
* @return bool
* TRUE if the config directory exists and is writable.
*
* @deprecated in Drupal 8.1.x, will be removed before Drupal 9.0.x. Use
* config_get_config_directory() and file_prepare_directory() instead.
*/
function install_ensure_config_directory($type) {
// The config directory must be defined in settings.php.

View file

@ -186,7 +186,7 @@ function module_set_weight($module, $weight) {
->save(TRUE);
// Prepare the new module list, sorted by weight, including filenames.
// @see \Drupal\Core\Extension\ModuleHandler::install()
// @see \Drupal\Core\Extension\ModuleInstaller::install()
$module_handler = \Drupal::moduleHandler();
$current_module_filenames = $module_handler->getModuleList();
$current_modules = array_fill_keys(array_keys($current_module_filenames), 0);