summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/bootstrap.inc28
-rw-r--r--includes/common.inc8
-rw-r--r--includes/database/database.inc2
-rw-r--r--includes/form.inc2
-rw-r--r--includes/install.inc4
-rw-r--r--includes/path.inc4
-rw-r--r--includes/theme.inc10
-rw-r--r--includes/theme.maintenance.inc2
-rw-r--r--install.php4
-rw-r--r--modules/block/block.admin.inc2
-rw-r--r--modules/block/block.module10
-rw-r--r--modules/locale/locale.install2
-rw-r--r--modules/locale/locale.test4
-rw-r--r--modules/path/path.test2
-rw-r--r--update.php4
15 files changed, 44 insertions, 44 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index e4b17ea74..3693719f1 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -391,9 +391,9 @@ function conf_path($require_settings = TRUE, $reset = FALSE) {
}
/**
- * Initialize variables needed for the rest of the execution.
+ * Initialize PHP environment.
*/
-function drupal_initialize_variables() {
+function drupal_environment_initialize() {
if (!isset($_SERVER['HTTP_REFERER'])) {
$_SERVER['HTTP_REFERER'] = '';
}
@@ -454,7 +454,7 @@ function drupal_valid_http_host($host) {
* Loads the configuration and sets the base URL, cookie domain, and
* session name correctly.
*/
-function conf_init() {
+function drupal_settings_initialize() {
global $base_url, $base_path, $base_root;
// Export the following settings.php variables to the global namespace
@@ -605,7 +605,7 @@ function drupal_get_filename($type, $name, $filename = NULL) {
* with variable_set() as well as those explicitly specified in the configuration
* file.
*/
-function variable_init($conf = array()) {
+function variable_initialize($conf = array()) {
// NOTE: caching the variables improves performance by 20% when serving cached pages.
if ($cached = cache_get('variables', 'cache')) {
$variables = $cached->data;
@@ -1322,11 +1322,11 @@ function _drupal_bootstrap($phase) {
switch ($phase) {
case DRUPAL_BOOTSTRAP_CONFIGURATION:
- drupal_initialize_variables();
+ drupal_environment_initialize();
// Start a page timer:
timer_start('page');
- // Initialize the configuration
- conf_init();
+ // Initialize the configuration, including variables from settings.php.
+ drupal_settings_initialize();
break;
case DRUPAL_BOOTSTRAP_EARLY_PAGE_CACHE:
@@ -1366,8 +1366,8 @@ function _drupal_bootstrap($phase) {
break;
case DRUPAL_BOOTSTRAP_VARIABLES:
- // Initialize configuration variables, using values from settings.php if available.
- $conf = variable_init(isset($conf) ? $conf : array());
+ // Load variables from the database, but do not overwrite variables set in settings.php.
+ $conf = variable_initialize(isset($conf) ? $conf : array());
break;
case DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE:
@@ -1412,13 +1412,13 @@ function _drupal_bootstrap($phase) {
break;
case DRUPAL_BOOTSTRAP_LANGUAGE:
- drupal_init_language();
+ drupal_language_initialize();
break;
case DRUPAL_BOOTSTRAP_PATH:
require_once DRUPAL_ROOT . '/includes/path.inc';
// Initialize $_GET['q'] prior to loading modules and invoking hook_init().
- drupal_init_path();
+ drupal_path_initialize();
break;
case DRUPAL_BOOTSTRAP_FULL:
@@ -1458,7 +1458,7 @@ function get_t() {
/**
* Choose a language for the current page, based on site and user preferences.
*/
-function drupal_init_language() {
+function drupal_language_initialize() {
global $language, $user;
// Ensure the language is correctly returned, even without multilanguage support.
@@ -1608,8 +1608,8 @@ function drupal_get_schema($table = NULL, $rebuild = FALSE) {
// Invoke hook_schema for all modules.
foreach (module_implements('schema') as $module) {
$current = module_invoke($module, 'schema');
- if (drupal_function_exists('_drupal_initialize_schema')) {
- _drupal_initialize_schema($module, $current);
+ if (drupal_function_exists('_drupal_schema_initialize')) {
+ _drupal_schema_initialize($module, $current);
}
$schema = array_merge($schema, $current);
diff --git a/includes/common.inc b/includes/common.inc
index 5004f5e64..7e553e473 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -798,7 +798,7 @@ function _drupal_decode_exception($exception) {
*/
function _drupal_log_error($error, $fatal = FALSE) {
// Initialize a maintenance theme if the boostrap was not complete.
- // Do it early because drupal_set_message() triggers an init_theme().
+ // Do it early because drupal_set_message() triggers a drupal_theme_initialize().
if ($fatal && (drupal_get_bootstrap_phase() != DRUPAL_BOOTSTRAP_FULL)) {
unset($GLOBALS['theme']);
if (!defined('MAINTENANCE_MODE')) {
@@ -4274,7 +4274,7 @@ function drupal_common_theme() {
*/
function drupal_install_schema($module) {
$schema = drupal_get_schema_unprocessed($module);
- _drupal_initialize_schema($module, $schema);
+ _drupal_schema_initialize($module, $schema);
$ret = array();
foreach ($schema as $name => $table) {
@@ -4299,7 +4299,7 @@ function drupal_install_schema($module) {
*/
function drupal_uninstall_schema($module) {
$schema = drupal_get_schema_unprocessed($module);
- _drupal_initialize_schema($module, $schema);
+ _drupal_schema_initialize($module, $schema);
$ret = array();
foreach ($schema as $table) {
@@ -4356,7 +4356,7 @@ function drupal_get_schema_unprocessed($module, $table = NULL) {
* The schema definition array as it was returned by the module's
* hook_schema().
*/
-function _drupal_initialize_schema($module, &$schema) {
+function _drupal_schema_initialize($module, &$schema) {
// Set the name and module key for all tables.
foreach ($schema as $name => $table) {
if (empty($table['module'])) {
diff --git a/includes/database/database.inc b/includes/database/database.inc
index 326e1c05c..fcbd925a2 100644
--- a/includes/database/database.inc
+++ b/includes/database/database.inc
@@ -2442,7 +2442,7 @@ function db_change_field(&$ret, $table, $field, $field_new, $spec, $keys_new = a
*/
function _db_error_page($error = '') {
global $db_type;
- drupal_init_language();
+ drupal_language_initialize();
drupal_maintenance_theme();
drupal_set_header($_SERVER['SERVER_PROTOCOL'] . ' 503 Service Unavailable');
drupal_set_title('Site offline');
diff --git a/includes/form.inc b/includes/form.inc
index 675269941..5cfbcfad2 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -201,7 +201,7 @@ function drupal_build_form($form_id, &$form_state) {
// Don't override #theme if someone already set it.
if (!isset($form['#theme'])) {
- init_theme();
+ drupal_theme_initialize();
$registry = theme_get_registry();
if (isset($registry[$form_id])) {
$form['#theme'] = $form_id;
diff --git a/includes/install.inc b/includes/install.inc
index 450f7cd55..e5b8243b4 100644
--- a/includes/install.inc
+++ b/includes/install.inc
@@ -548,7 +548,7 @@ function _drupal_install_module($module) {
* Because we have no registry yet, we need to manually include the
* necessary database include files.
*/
-function drupal_install_init_database() {
+function drupal_install_initialize_database() {
static $included = FALSE;
if (!$included) {
@@ -573,7 +573,7 @@ function drupal_install_init_database() {
function drupal_install_system() {
$system_path = dirname(drupal_get_filename('module', 'system', NULL));
require_once DRUPAL_ROOT . '/' . $system_path . '/system.install';
- drupal_install_init_database();
+ drupal_install_initialize_database();
module_invoke('system', 'install');
$system_versions = drupal_get_schema_versions('system');
diff --git a/includes/path.inc b/includes/path.inc
index 77eb4233f..4e4a62e6c 100644
--- a/includes/path.inc
+++ b/includes/path.inc
@@ -13,7 +13,7 @@
/**
* Initialize the $_GET['q'] variable to the proper normal path.
*/
-function drupal_init_path() {
+function drupal_path_initialize() {
if (!empty($_GET['q'])) {
$_GET['q'] = drupal_get_normal_path(trim($_GET['q'], '/'));
}
@@ -309,7 +309,7 @@ function drupal_is_front_page() {
$is_front_page = &drupal_static(__FUNCTION__);
if (!isset($is_front_page)) {
- // As drupal_init_path updates $_GET['q'] with the 'site_frontpage' path,
+ // As drupal_path_initialize updates $_GET['q'] with the 'site_frontpage' path,
// we can check it against the 'site_frontpage' variable.
$is_front_page = ($_GET['q'] == drupal_get_normal_path(variable_get('site_frontpage', 'node')));
}
diff --git a/includes/theme.inc b/includes/theme.inc
index 41bdcf347..aee5e320f 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -40,7 +40,7 @@ define('MARK_UPDATED', 2);
/**
* Initialize the theme system by loading the theme.
*/
-function init_theme() {
+function drupal_theme_initialize() {
global $theme, $user, $custom_theme, $theme_key;
// If $theme is already set, assume the others are set, too, and do nothing
@@ -69,7 +69,7 @@ function init_theme() {
$base_theme[] = $new_base_theme = $themes[$themes[$ancestor]->base_theme];
$ancestor = $themes[$ancestor]->base_theme;
}
- _init_theme($themes[$theme], array_reverse($base_theme));
+ _drupal_theme_initialize($themes[$theme], array_reverse($base_theme));
}
/**
@@ -97,7 +97,7 @@ function init_theme() {
* @param $registry_callback
* The callback to invoke to set the theme registry.
*/
-function _init_theme($theme, $base_theme = array(), $registry_callback = '_theme_load_registry') {
+function _drupal_theme_initialize($theme, $base_theme = array(), $registry_callback = '_theme_load_registry') {
global $theme_info, $base_theme_info, $theme_engine, $theme_path;
$theme_info = $theme;
$base_theme_info = $base_theme;
@@ -690,7 +690,7 @@ function theme() {
static $hooks = NULL;
if (!isset($hooks)) {
- init_theme();
+ drupal_theme_initialize();
$hooks = theme_get_registry();
}
@@ -874,7 +874,7 @@ function path_to_theme() {
global $theme_path;
if (!isset($theme_path)) {
- init_theme();
+ drupal_theme_initialize();
}
return $theme_path;
diff --git a/includes/theme.maintenance.inc b/includes/theme.maintenance.inc
index 5445fc836..291b927c5 100644
--- a/includes/theme.maintenance.inc
+++ b/includes/theme.maintenance.inc
@@ -61,7 +61,7 @@ function _drupal_maintenance_theme() {
$base_theme[] = $new_base_theme = $themes[$themes[$ancestor]->base_theme];
$ancestor = $themes[$ancestor]->base_theme;
}
- _init_theme($themes[$theme], array_reverse($base_theme), '_theme_load_offline_registry');
+ _drupal_theme_initialize($themes[$theme], array_reverse($base_theme), '_theme_load_offline_registry');
// These are usually added from system_init() -except maintenance.css.
// When the database is inactive it's not called so we add it here.
diff --git a/install.php b/install.php
index 1d94a7fb3..ba10ef279 100644
--- a/install.php
+++ b/install.php
@@ -46,7 +46,7 @@ function install_main() {
drupal_page_header();
// Set up $language, so t() caller functions will still work.
- drupal_init_language();
+ drupal_language_initialize();
// Load module basics (needed for hook invokes).
include_once DRUPAL_ROOT . '/includes/module.inc';
@@ -622,7 +622,7 @@ function install_tasks($profile, $task) {
// Bootstrap newly installed Drupal, while preserving existing messages.
$messages = isset($_SESSION['messages']) ? $_SESSION['messages'] : '';
- drupal_install_init_database();
+ drupal_install_initialize_database();
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
$_SESSION['messages'] = $messages;
diff --git a/modules/block/block.admin.inc b/modules/block/block.admin.inc
index 13fad0c5a..852397383 100644
--- a/modules/block/block.admin.inc
+++ b/modules/block/block.admin.inc
@@ -32,7 +32,7 @@ function block_admin_display_form(&$form_state, $blocks, $theme = NULL) {
// If non-default theme configuration has been selected, set the custom theme.
$custom_theme = isset($theme) ? $theme : variable_get('theme_default', 'garland');
- init_theme();
+ drupal_theme_initialize();
$block_regions = system_region_list($theme_key) + array(BLOCK_REGION_NONE => '<' . t('none') . '>');
diff --git a/modules/block/block.module b/modules/block/block.module
index 848b68e31..3ceeb9625 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -233,7 +233,7 @@ function block_page_alter($page) {
global $theme;
// The theme system might not yet be initialized. We need $theme.
- init_theme();
+ drupal_theme_initialize();
// Populate all block regions
$regions = system_region_list($theme);
@@ -293,7 +293,7 @@ function block_get_blocks_by_region($region) {
function _block_rehash() {
global $theme_key;
- init_theme();
+ drupal_theme_initialize();
$old_blocks = array();
$result = db_query("SELECT * FROM {block} WHERE theme = :theme", array(':theme' => $theme_key));
@@ -509,7 +509,7 @@ function block_system_themes_form_submit(&$form, &$form_state) {
if (is_array($form_state['values']['status'])) {
foreach ($form_state['values']['status'] as $key => $choice) {
if ($choice || $form_state['values']['theme_default'] == $key) {
- block_initialize_theme_blocks($key);
+ block_theme_initialize($key);
}
}
}
@@ -517,7 +517,7 @@ function block_system_themes_form_submit(&$form, &$form_state) {
// If we're changing themes, make sure the theme has its blocks initialized.
$has_blocks = (bool) db_query_range('SELECT 1 FROM {block} WHERE theme = :theme', array(':theme' => $form_state['values']['admin_theme']), 0, 1)->fetchField();
if (!$has_blocks) {
- block_initialize_theme_blocks($form_state['values']['admin_theme']);
+ block_theme_initialize($form_state['values']['admin_theme']);
}
}
}
@@ -534,7 +534,7 @@ function block_system_themes_form_submit(&$form, &$form_state) {
* @param $theme
* The name of a theme.
*/
-function block_initialize_theme_blocks($theme) {
+function block_theme_initialize($theme) {
// Initialize theme's blocks if none already registered.
$has_blocks = (bool) db_query_range('SELECT 1 FROM {block} WHERE theme = :theme', array(':theme' => $theme), 0, 1)->fetchField();
if (!$has_blocks) {
diff --git a/modules/locale/locale.install b/modules/locale/locale.install
index d33d25ba7..96b3b8c77 100644
--- a/modules/locale/locale.install
+++ b/modules/locale/locale.install
@@ -81,7 +81,7 @@ function locale_uninstall() {
// Switch back to English: with a $language->language value different from 'en'
// successive calls of t() might result in calling locale(), which in turn might
// try to query the unexisting {locales_source} and {locales_target} tables.
- drupal_init_language();
+ drupal_language_initialize();
// Remove tables.
drupal_uninstall_schema('locale');
diff --git a/modules/locale/locale.test b/modules/locale/locale.test
index f3cabe4c2..3eb7b30fb 100644
--- a/modules/locale/locale.test
+++ b/modules/locale/locale.test
@@ -934,7 +934,7 @@ class LocaleUninstallFunctionalTest extends DrupalWebTestCase {
locale_add_language('fr', 'French', 'Français', LANGUAGE_LTR, '', '', TRUE, $this->ui_language == 'fr');
// Check the UI language.
- drupal_init_language();
+ drupal_language_initialize();
global $language;
$this->assertEqual($language->language, $this->ui_language, t('Current language: %lang', array('%lang' => $language->language)));
@@ -973,7 +973,7 @@ class LocaleUninstallFunctionalTest extends DrupalWebTestCase {
$this->drupalGet('');
// Check the init language logic.
- drupal_init_language();
+ drupal_language_initialize();
$this->assertEqual($language->language, 'en', t('Language after uninstall: %lang', array('%lang' => $language->language)));
// Check JavaScript files deletion.
diff --git a/modules/path/path.test b/modules/path/path.test
index 5de87173b..e00cd9073 100644
--- a/modules/path/path.test
+++ b/modules/path/path.test
@@ -185,7 +185,7 @@ class PathLanguageTestCase extends DrupalWebTestCase {
variable_set('language_negotiation', LANGUAGE_NEGOTIATION_PATH);
// Force inclusion of language.inc.
- drupal_init_language();
+ drupal_language_initialize();
}
/**
diff --git a/update.php b/update.php
index bb4413eab..04d90af6a 100644
--- a/update.php
+++ b/update.php
@@ -525,7 +525,7 @@ function update_prepare_d7_bootstrap() {
// Allow the database system to work even if the registry has not been
// created yet.
drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);
- drupal_install_init_database();
+ drupal_install_initialize_database();
spl_autoload_unregister('drupal_autoload_class');
spl_autoload_unregister('drupal_autoload_interface');
// The new {blocked_ips} table is used in Drupal 7 to store a list of
@@ -682,7 +682,7 @@ if (empty($op) && $update_access_allowed) {
drupal_load('module', 'filter');
// Set up $language, since the installer components require it.
- drupal_init_language();
+ drupal_language_initialize();
// Set up theme system for the maintenance page.
drupal_maintenance_theme();