diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index adf56c85ceea63cb31339c788c30ce7d45f93f4b..a664fc85797c2651d2e8b38a7c4311214c01fa1e 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -673,18 +673,6 @@ function page_get_cache() { return $cache; } -/** - * Call all init or exit hooks without including all modules. - * - * @param $hook - * The name of the bootstrap hook we wish to invoke. - */ -function bootstrap_invoke_all($hook) { - foreach (module_implements($hook) as $module) { - module_invoke($module, $hook); - } -} - /** * Includes a file with the provided type and name. This prevents * including a theme, engine, module, etc., more than once. @@ -789,13 +777,6 @@ function drupal_page_cache_header($cache) { print $cache->data; } -/** - * Define the critical hooks that force modules to always be loaded. - */ -function bootstrap_hooks() { - return array('boot', 'exit'); -} - /** * Unserializes and appends elements from a serialized string. * @@ -1157,14 +1138,14 @@ function _drupal_bootstrap($phase) { if (!$cache || $cache_mode != CACHE_AGGRESSIVE) { // Load module handling. require_once DRUPAL_ROOT . '/includes/module.inc'; - bootstrap_invoke_all('boot'); + module_invoke_all('boot'); } // If there is a cached page, display it. if ($cache) { drupal_page_cache_header($cache); // If the skipping of the bootstrap hooks is not enforced, call hook_exit. if ($cache_mode != CACHE_AGGRESSIVE) { - bootstrap_invoke_all('exit'); + module_invoke_all('exit'); } // We are done. exit; @@ -1368,7 +1349,7 @@ function drupal_get_schema($table = NULL, $rebuild = FALSE) { // "prime" module_list() here to to values we want, specifically // "yes rebuild the list and don't limit to bootstrap". // TODO: Remove this call after http://drupal.org/node/222109 is fixed. - module_list(TRUE, FALSE); + module_list(TRUE); module_load_all_includes('install'); } diff --git a/includes/install.inc b/includes/install.inc index 4bbd060b421cddb6e02d76c1c21d21ea06010359..8902d34009f69d6749d67f03998109282e3c807f 100644 --- a/includes/install.inc +++ b/includes/install.inc @@ -571,7 +571,7 @@ function drupal_install_system() { $system_versions = drupal_get_schema_versions('system'); $system_version = $system_versions ? max($system_versions) : SCHEMA_INSTALLED; - db_query("INSERT INTO {system} (filename, name, type, owner, status, bootstrap, schema_version) VALUES('%s', '%s', '%s', '%s', %d, %d, %d)", $system_path . '/system.module', 'system', 'module', '', 1, 0, $system_version); + db_query("INSERT INTO {system} (filename, name, type, owner, status, schema_version) VALUES('%s', '%s', '%s', '%s', %d, %d)", $system_path . '/system.module', 'system', 'module', '', 1, $system_version); // Now that we've installed things properly, bootstrap the full Drupal environment drupal_install_init_database(); drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); diff --git a/includes/module.inc b/includes/module.inc index 9eb2eeeae500d9a69107a2285a145dd7e5dcd313..92b77a5baf899e95061a0389c9b6c2ca9b55af24 100644 --- a/includes/module.inc +++ b/includes/module.inc @@ -21,7 +21,7 @@ * Load all the modules that have been enabled in the system table. */ function module_load_all() { - foreach (module_list(TRUE, FALSE) as $module) { + foreach (module_list(TRUE) as $module) { drupal_load('module', $module); } } @@ -33,9 +33,6 @@ function module_load_all() { * @param $refresh * Whether to force the module list to be regenerated (such as after the * administrator has changed the system settings). - * @param $bootstrap - * Whether to return the reduced set of modules loaded in "bootstrap mode" - * for cached pages. See bootstrap.inc. * @param $sort * By default, modules are ordered by weight and filename. Set this option to * TRUE to return a module list ordered only by module name. @@ -46,7 +43,7 @@ function module_load_all() { * An associative array whose keys and values are the names of all loaded * modules. */ -function module_list($refresh = FALSE, $bootstrap = TRUE, $sort = FALSE, $fixed_list = NULL) { +function module_list($refresh = FALSE, $sort = FALSE, $fixed_list = NULL) { static $list = array(), $sorted_list; if (empty($list) || $refresh || $fixed_list) { @@ -59,12 +56,7 @@ function module_list($refresh = FALSE, $bootstrap = TRUE, $sort = FALSE, $fixed_ } } else { - if ($bootstrap) { - $result = db_query("SELECT name, filename FROM {system} WHERE type = 'module' AND status = 1 AND bootstrap = 1 ORDER BY weight ASC, filename ASC"); - } - else { - $result = db_query("SELECT name, filename FROM {system} WHERE type = 'module' AND status = 1 ORDER BY weight ASC, filename ASC"); - } + $result = db_query("SELECT name, filename FROM {system} WHERE type = 'module' AND status = 1 ORDER BY weight ASC, filename ASC"); while ($module = db_fetch_object($result)) { if (file_exists($module->filename)) { drupal_get_filename('module', $module->name, $module->filename); @@ -125,24 +117,14 @@ function module_rebuild_cache() { // modify the data in the .info files if necessary. drupal_alter('system_info', $files[$filename]->info, $files[$filename]); - // Log the critical hooks implemented by this module. - $bootstrap = 0; - foreach (bootstrap_hooks() as $hook) { - // Only look for hooks in installed modules. - if (!empty($file->status) && in_array($file->name, module_implements($hook))) { - $bootstrap = 1; - break; - } - } - // Update the contents of the system table: if (isset($file->status) || (isset($file->old_filename) && $file->old_filename != $file->filename)) { - db_query("UPDATE {system} SET info = '%s', name = '%s', filename = '%s', bootstrap = %d WHERE filename = '%s'", serialize($files[$filename]->info), $file->name, $file->filename, $bootstrap, $file->old_filename); + db_query("UPDATE {system} SET info = '%s', name = '%s', filename = '%s' WHERE filename = '%s'", serialize($files[$filename]->info), $file->name, $file->filename, $file->old_filename); } else { // This is a new module. $files[$filename]->status = 0; - db_query("INSERT INTO {system} (name, info, type, filename, status, bootstrap) VALUES ('%s', '%s', '%s', '%s', %d, %d)", $file->name, serialize($files[$filename]->info), 'module', $file->filename, 0, $bootstrap); + db_query("INSERT INTO {system} (name, info, type, filename, status) VALUES ('%s', '%s', '%s', '%s', %d)", $file->name, serialize($files[$filename]->info), 'module', $file->filename, 0); } } $files = _module_build_dependencies($files); @@ -295,7 +277,7 @@ function module_enable($module_list) { if (!empty($invoke_modules)) { // Refresh the module list to include the new enabled module. - module_list(TRUE, FALSE); + module_list(TRUE); // Force to regenerate the stored list of hook implementations. registry_rebuild(); } @@ -345,7 +327,7 @@ function module_disable($module_list) { // so we can still call module hooks to get information. module_invoke_all('modules_disabled', $invoke_modules); // Refresh the module list to exclude the disabled modules. - module_list(TRUE, FALSE); + module_list(TRUE); // Force to regenerate the stored list of hook implementations. registry_rebuild(); } diff --git a/includes/theme.maintenance.inc b/includes/theme.maintenance.inc index f64fd42455248c8cebb9abd4d481207d67153bac..e88ebce93242b420e7325aa36243fd9e66b2a71c 100644 --- a/includes/theme.maintenance.inc +++ b/includes/theme.maintenance.inc @@ -39,7 +39,7 @@ function _drupal_maintenance_theme() { // Load module basics (needed for hook invokes). $module_list['system']['filename'] = 'modules/system/system.module'; $module_list['filter']['filename'] = 'modules/filter/filter.module'; - module_list(TRUE, FALSE, FALSE, $module_list); + module_list(TRUE, FALSE, $module_list); drupal_load('module', 'system'); drupal_load('module', 'filter'); diff --git a/install.php b/install.php index 9b91d56d5c7b8b8641a7fb271c215bf39867ae7a..05654a4e64dd392b4aef76dad48ceb5488bc3621 100644 --- a/install.php +++ b/install.php @@ -52,7 +52,7 @@ function install_main() { include_once DRUPAL_ROOT . '/includes/module.inc'; $module_list['system']['filename'] = 'modules/system/system.module'; $module_list['filter']['filename'] = 'modules/filter/filter.module'; - module_list(TRUE, FALSE, FALSE, $module_list); + module_list(TRUE, FALSE, $module_list); drupal_load('module', 'system'); drupal_load('module', 'filter'); diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc index 970c0488a96f04eec05731d98954fac102b5f420..99033a32626ed11bb7d7e1dde95ac17073565a09 100644 --- a/modules/system/system.admin.inc +++ b/modules/system/system.admin.inc @@ -940,7 +940,7 @@ function system_modules_submit($form, &$form_state) { drupal_install_modules($new_modules); } - $current_module_list = module_list(TRUE, FALSE); + $current_module_list = module_list(TRUE); if ($old_module_list != $current_module_list) { drupal_set_message(t('The configuration options have been saved.')); } diff --git a/modules/system/system.install b/modules/system/system.install index bcde1b9432266d188813a8856944d009b44bb0f2..ae9cd81cddfd0104babcc6d918d499c3c0c23bbb 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -1208,12 +1208,6 @@ function system_schema() { 'not null' => TRUE, 'default' => 0, ), - 'bootstrap' => array( - 'description' => "Boolean indicating whether this module is loaded during Drupal's early bootstrapping phase (e.g. even before the page cache is consulted).", - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0, - ), 'schema_version' => array( 'description' => "The module's database schema version number. -1 if the module is not installed (its tables do not exist); 0 or the largest N of the module's hook_update_N() function that has either been run or existed when the module was first installed.", 'type' => 'int', @@ -1236,7 +1230,6 @@ function system_schema() { 'primary key' => array('filename'), 'indexes' => array( 'modules' => array(array('type', 12), 'status', 'weight', 'filename'), - 'bootstrap' => array(array('type', 12), 'status', 'bootstrap', 'weight', 'filename'), ), ); @@ -3130,6 +3123,15 @@ function system_update_7013() { return $ret; } +/** + * Drop the bootstrap column from the {system} table. + */ +function system_update_7014() { + $ret = array(); + db_drop_field($ret, 'system', 'bootstrap'); + return $ret; +} + /** * @} End of "defgroup updates-6.x-to-7.x" * The next series of updates should start at 8000. diff --git a/modules/system/system.module b/modules/system/system.module index 151c26979ec8bf8468b386c0e8f893d73a78e7d8..833e54556414d47c690d8e4e3695f8c87058830d 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -1088,7 +1088,7 @@ function system_theme_data() { $theme->owner = ''; } - db_query("INSERT INTO {system} (name, owner, info, type, filename, status, bootstrap) VALUES ('%s', '%s', '%s', '%s', '%s', %d, %d)", $theme->name, $theme->owner, serialize($theme->info), 'theme', $theme->filename, isset($theme->status) ? $theme->status : 0, 0); + db_query("INSERT INTO {system} (name, owner, info, type, filename, status) VALUES ('%s', '%s', '%s', '%s', '%s', %d)", $theme->name, $theme->owner, serialize($theme->info), 'theme', $theme->filename, isset($theme->status) ? $theme->status : 0); } return $themes; diff --git a/modules/system/system.test b/modules/system/system.test index 756b6c196c714f048424ecd45b2031db1a25d9b8..a88cef45713cfa496aec723d2e8bf05b478b51eb 100644 --- a/modules/system/system.test +++ b/modules/system/system.test @@ -133,7 +133,7 @@ class EnableDisableCoreTestCase extends DrupalWebTestCase { * @param boolean $enabled Module state. */ function assertModules(Array $modules, $enabled) { - module_list(TRUE, FALSE); + module_list(TRUE); foreach ($modules as $module) { if ($enabled) { $message = 'Module "@module" is enabled.'; diff --git a/update.php b/update.php index 937e98f32f967dfabe8d8afa6187e0266d94c1c4..0cefcb70568a541f3648919a8940f37eecf46e35 100644 --- a/update.php +++ b/update.php @@ -663,7 +663,7 @@ function update_check_requirements() { include_once DRUPAL_ROOT . '/includes/module.inc'; $module_list['system']['filename'] = 'modules/system/system.module'; $module_list['filter']['filename'] = 'modules/filter/filter.module'; - module_list(TRUE, FALSE, FALSE, $module_list); + module_list(TRUE, FALSE, $module_list); drupal_load('module', 'system'); drupal_load('module', 'filter');