Commit b3f71781 authored by sun's avatar sun Committed by gdd
Browse files

Renamed global variables to $config_directory_name and $config_signature_key.

parent 19b21a1f
......@@ -769,7 +769,7 @@ function drupal_settings_initialize() {
global $base_url, $base_path, $base_root;
// Export the following settings.php variables to the global namespace
global $databases, $cookie_domain, $conf, $installed_profile, $update_free_access, $db_url, $db_prefix, $drupal_hash_salt, $is_https, $base_secure_url, $base_insecure_url, $drupal_config_directory_name, $drupal_config_key;
global $databases, $cookie_domain, $conf, $installed_profile, $update_free_access, $db_url, $db_prefix, $drupal_hash_salt, $is_https, $base_secure_url, $base_insecure_url, $config_directory_name, $config_signature_key;
$conf = array();
if (file_exists(DRUPAL_ROOT . '/' . conf_path() . '/settings.php')) {
......
......@@ -12,9 +12,9 @@
* The directory name.
*/
function config_get_config_directory() {
global $drupal_config_directory_name;
global $config_directory_name;
return conf_path() . '/files/' . $drupal_config_directory_name;
return conf_path() . '/files/' . $config_directory_name;
}
/**
......@@ -81,11 +81,11 @@ function config_get_signed_file_storage_names_with_prefix($prefix = '') {
*/
function config_sign_data($data) {
// The configuration key is loaded from settings.php and imported into the global namespace
global $drupal_config_key;
global $config_signature_key;
// SHA-512 is both secure and very fast on 64 bit CPUs.
// @todo What about 32-bit CPUs?
return hash_hmac('sha512', $data, $drupal_config_key);
return hash_hmac('sha512', $data, $config_signature_key);
}
/**
......
......@@ -992,7 +992,7 @@ function install_settings_form_submit($form, &$form_state) {
'required' => TRUE,
);
$settings['drupal_config_key'] = array(
$settings['config_signature_key'] = array(
'value' => drupal_hash_base64(drupal_random_bytes(55)),
'required' => TRUE,
);
......@@ -1005,14 +1005,14 @@ function install_settings_form_submit($form, &$form_state) {
// without hitting install_settings_form_submit() if your settings.php
// already has the db stuff in it, and right now in that case your
// config directory never gets created. So this needs to be moved elsewhere.
$settings['drupal_config_directory_name'] = array(
'value' => 'config_' . drupal_hmac_base64('', session_id() . $settings['drupal_config_key']['value'] . $settings['drupal_hash_salt']['value']),
$settings['config_directory_name'] = array(
'value' => 'config_' . drupal_hmac_base64('', session_id() . $settings['config_signature_key']['value'] . $settings['drupal_hash_salt']['value']),
'required' => TRUE,
);
drupal_rewrite_settings($settings);
// Actually create the config directory named above.
$config_path = conf_path() . '/files/' . $settings['drupal_config_directory_name']['value'];
$config_path = conf_path() . '/files/' . $settings['config_directory_name']['value'];
if (!file_prepare_directory($config_path, FILE_CREATE_DIRECTORY)) {
// How best to handle errors here?
};
......
......@@ -245,16 +245,16 @@
* @todo Flesh this out, provide more details, etc.
*
* Example:
* $drupal_config_directory_name = '/some/directory/outside/webroot';
* $config_directory_name = '/some/directory/outside/webroot';
*/
$drupal_config_directory_name = '';
$config_directory_name = '';
/**
* Configuration key.
* Configuration signature key.
*
* Drupal configuration files are signed using this key.
*/
$drupal_config_key = '';
$config_signature_key = '';
/**
* Base URL (optional).
......
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