summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-07-14 10:22:17 +0000
committerDries Buytaert <dries@buytaert.net>2009-07-14 10:22:17 +0000
commitef09cf93e5ac3b0a3783170c6f29fdc4f9df6224 (patch)
treeacc3d22f10ba7b0de9116f3a9f0243e1ea99cb57 /includes
parent942f63b4ca940d04e8e2229387e2d511b3f9aba1 (diff)
downloadbrdo-ef09cf93e5ac3b0a3783170c6f29fdc4f9df6224.tar.gz
brdo-ef09cf93e5ac3b0a3783170c6f29fdc4f9df6224.tar.bz2
- Patch #517542 by David Strauss: renamed functions for clarity. We say 'yay' to clarity!
Diffstat (limited to 'includes')
-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
8 files changed, 30 insertions, 30 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.