Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
b3f71781
Commit
b3f71781
authored
Jan 08, 2012
by
sun
Committed by
gdd
Jan 25, 2012
Browse files
Renamed global variables to $config_directory_name and $config_signature_key.
parent
19b21a1f
Changes
4
Hide whitespace changes
Inline
Side-by-side
core/includes/bootstrap.inc
View file @
b3f71781
...
...
@@ -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'
))
{
...
...
core/includes/config.inc
View file @
b3f71781
...
...
@@ -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
);
}
/**
...
...
core/includes/install.core.inc
View file @
b3f71781
...
...
@@ -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?
};
...
...
sites/default/default.settings.php
View file @
b3f71781
...
...
@@ -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).
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment