Heine

  • home
  • drupal
  • drupal core commits
  • about
Home › Drupal Core Commits

Commit 237212 by dries

- Patch #517542 by David Strauss: renamed functions for clarity. We say 'yay' to clarity!

--- includes/bootstrap.inc      2009/07/01 12:47:30     1.288
+++ includes/bootstrap.inc      2009/07/14 10:22:15     1.289
@@ -391,9 +391,9 @@
 }
 
 /**
- * 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 @@
  * 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 @@
  * 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 @@
   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 @@
       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 @@
       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 @@
 /**
  *  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 @@
       // 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);

--- includes/common.inc 2009/07/13 21:09:53     1.933
+++ includes/common.inc 2009/07/14 10:22:15     1.934
@@ -798,7 +798,7 @@
  */
 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_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_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 @@
  *   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'])) {

--- includes/database/database.inc      2009/07/13 07:27:14     1.61
+++ includes/database/database.inc      2009/07/14 10:22:17     1.62
@@ -2442,7 +2442,7 @@
  */
 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');

--- includes/form.inc   2009/07/07 22:32:17     1.349
+++ includes/form.inc   2009/07/14 10:22:15     1.350
@@ -201,7 +201,7 @@
 
   // 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;

--- includes/install.inc        2009/06/28 03:56:43     1.94
+++ includes/install.inc        2009/07/14 10:22:17     1.95
@@ -548,7 +548,7 @@
  * 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_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');

--- includes/path.inc   2009/06/08 04:44:58     1.40
+++ includes/path.inc   2009/07/14 10:22:17     1.41
@@ -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 @@
   $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')));
   }

--- includes/theme.inc  2009/07/02 04:27:22     1.497
+++ includes/theme.inc  2009/07/14 10:22:17     1.498
@@ -40,7 +40,7 @@
 /**
  * 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 @@
     $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 @@
  * @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 @@
 
   static $hooks = NULL;
   if (!isset($hooks)) {
-    init_theme();
+    drupal_theme_initialize();
     $hooks = theme_get_registry();
   }
 
@@ -874,7 +874,7 @@
   global $theme_path;
 
   if (!isset($theme_path)) {
-    init_theme();
+    drupal_theme_initialize();
   }
 
   return $theme_path;

--- includes/theme.maintenance.inc      2009/07/10 05:06:55     1.31
+++ includes/theme.maintenance.inc      2009/07/14 10:22:17     1.32
@@ -61,7 +61,7 @@
     $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.

--- install.php 2009/07/04 14:49:31     1.182
+++ install.php 2009/07/14 10:22:15     1.183
@@ -46,7 +46,7 @@
   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 @@
 
   // 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;

--- modules/block/block.admin.inc       2009/07/01 08:04:19     1.44
+++ modules/block/block.admin.inc       2009/07/14 10:22:17     1.45
@@ -32,7 +32,7 @@
 
   // 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') . '>');
 

--- modules/block/block.module  2009/07/05 18:00:07     1.348
+++ modules/block/block.module  2009/07/14 10:22:17     1.349
@@ -233,7 +233,7 @@
   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_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 @@
     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 @@
       // 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 @@
  * @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) {

--- modules/locale/locale.install       2009/06/22 13:21:37     1.45
+++ modules/locale/locale.install       2009/07/14 10:22:17     1.46
@@ -81,7 +81,7 @@
   // 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');

--- modules/locale/locale.test  2009/07/13 21:51:10     1.29
+++ modules/locale/locale.test  2009/07/14 10:22:17     1.30
@@ -934,7 +934,7 @@
     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 @@
     $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.

--- modules/path/path.test      2009/07/13 21:51:10     1.15
+++ modules/path/path.test      2009/07/14 10:22:17     1.16
@@ -185,7 +185,7 @@
     variable_set('language_negotiation', LANGUAGE_NEGOTIATION_PATH);
 
     // Force inclusion of language.inc.
-    drupal_init_language();
+    drupal_language_initialize();
   }
 
   /**

--- update.php  2009/06/23 12:06:09     1.291
+++ update.php  2009/07/14 10:22:15     1.292
@@ -525,7 +525,7 @@
   // 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 @@
   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();

No votes yet
  • Drupal Core
  • Download patch

Recent posts

  • The Joomlafication of the Dutch-speaking community
  • Upgraded from 6.14 to 6.15, but Drupal still thinks it's 6.14?
  • Google Friendconnect Drupal module not recommended (yet)
  • The OpenID 2.0 Compliance Crusade - Part I
  • Using <embed> for XSS
more

Security reviews

  • Afraid custom code makes your site vulnerable?
  • You don't really trust that module you just downloaded from Drupal.org?

Sleep better after a security review.

Tags

Captcha CSRF DOH! Drupal embed Input Format modx OpenID Performance Planet Drupal Security Varnish
more tags
  • home
  • drupal
  • drupal core commits
  • about

Copyright © 2010 by Heine Deelstra. All rights reserved.