? modules/node/.node.module.swp Index: install.php =================================================================== RCS file: /cvs/drupal/drupal/install.php,v retrieving revision 1.39 diff -u -3 -r1.39 install.php --- install.php 5 Mar 2007 16:15:22 -0000 1.39 +++ install.php 25 Mar 2007 17:28:17 -0000 @@ -40,9 +40,6 @@ // Load module basics (needed for hook invokes). include_once './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); drupal_load('module', 'system'); drupal_load('module', 'filter'); @@ -559,7 +556,7 @@ drupal_maintenance_theme(); install_task_list(); drupal_set_title(st('@drupal installation complete', array('@drupal' => drupal_install_profile_name()))); - $output .= '

'. st('Congratulations, @drupal has been successfully installed.', array('@drupal' => drupal_install_profile_name())) .'

'; + $output = '

'. st('Congratulations, @drupal has been successfully installed.', array('@drupal' => drupal_install_profile_name())) .'

'; // Show profile finalization info. $function = $profile .'_profile_final'; Index: includes/bootstrap.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v retrieving revision 1.147 diff -u -3 -r1.147 bootstrap.inc --- includes/bootstrap.inc 29 Jan 2007 19:25:19 -0000 1.147 +++ includes/bootstrap.inc 25 Mar 2007 17:28:17 -0000 @@ -438,7 +438,7 @@ * The name of the bootstrap hook we wish to invoke. */ function bootstrap_invoke_all($hook) { - foreach (module_list(TRUE, TRUE) as $module) { + foreach (module_list_bootstrap(FALSE, TRUE) as $module) { drupal_load('module', $module); module_invoke($module, $hook); } Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.619 diff -u -3 -r1.619 common.inc --- includes/common.inc 8 Mar 2007 19:33:55 -0000 1.619 +++ includes/common.inc 25 Mar 2007 17:28:17 -0000 @@ -351,6 +351,7 @@ if (empty($return)) { drupal_set_title(t('Page not found')); + $return = ''; } // To conserve CPU and bandwidth, omit the blocks print theme('page', $return, FALSE); Index: includes/database.mysql.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/database.mysql.inc,v retrieving revision 1.68 diff -u -3 -r1.68 database.mysql.inc --- includes/database.mysql.inc 19 Mar 2007 01:17:37 -0000 1.68 +++ includes/database.mysql.inc 25 Mar 2007 17:28:17 -0000 @@ -169,6 +169,7 @@ return $result; } else { + ob_start(); trigger_error(check_plain(mysql_error($active_db) ."\nquery: ". $query), E_USER_WARNING); return FALSE; } Index: includes/form.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/form.inc,v retrieving revision 1.182 diff -u -3 -r1.182 form.inc --- includes/form.inc 17 Mar 2007 18:30:14 -0000 1.182 +++ includes/form.inc 25 Mar 2007 17:28:18 -0000 @@ -889,7 +889,7 @@ } } - return $cache[$type]; + return isset($cache[$type]) ? $cache[$type] : array(); } function form_options_flatten($array, $reset = TRUE) { Index: includes/install.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/install.inc,v retrieving revision 1.34 diff -u -3 -r1.34 install.inc --- includes/install.inc 11 Feb 2007 08:48:36 -0000 1.34 +++ includes/install.inc 25 Mar 2007 17:28:18 -0000 @@ -22,7 +22,7 @@ * Initialize the update system by loading all installed module's .install files. */ function drupal_load_updates() { - foreach (module_list() as $module) { + foreach (module_list_all() as $module) { module_load_install($module); } } Index: includes/menu.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/menu.inc,v retrieving revision 1.157 diff -u -3 -r1.157 menu.inc --- includes/menu.inc 19 Mar 2007 01:13:28 -0000 1.157 +++ includes/menu.inc 25 Mar 2007 17:28:18 -0000 @@ -528,7 +528,7 @@ return; } - foreach (module_list() as $name) { + foreach (module_list_all() as $name) { if (module_hook($name, 'help')) { if ($temp = module_invoke($name, 'help', $path)) { $output .= $temp ."\n"; Index: includes/module.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/module.inc,v retrieving revision 1.98 diff -u -3 -r1.98 module.inc --- includes/module.inc 4 Feb 2007 21:20:50 -0000 1.98 +++ includes/module.inc 25 Mar 2007 17:28:18 -0000 @@ -10,7 +10,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_all(TRUE) as $module) { drupal_load('module', $module); } } @@ -19,64 +19,93 @@ * Call a function repeatedly with each module in turn as an argument. */ function module_iterate($function, $argument = '') { - foreach (module_list() as $name) { + foreach (module_list_all() as $name) { $function($name, $argument); } } /** - * Collect a list of all loaded modules. During the bootstrap, return only - * vital modules. See bootstrap.inc + * Collect a list of all loaded modules. * * @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, settings this option - * to TRUE, module list will be ordered by module name. - * @param $fixed_list - * (Optional) Override the module list with the given modules. Stays until the - * next call with $refresh = TRUE. + * By default, modules are ordered by weight and filename, settings this + * option to TRUE, module list will be ordered by module name. * @return * 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) { - static $list, $sorted_list; +function module_list_all($refresh = FALSE, $sort = FALSE) { + static $list = array(), $sorted_list; - if ($refresh || $fixed_list) { + if ($refresh || empty($list)) { unset($sorted_list); - $list = array(); - if ($fixed_list) { - foreach ($fixed_list as $name => $module) { - drupal_get_filename('module', $name, $module['filename']); - $list[$name] = $name; + + $result = db_query("SELECT name, filename, throttle, bootstrap 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)) { + // Determine the current throttle status and see if the module should be + // loaded based on server load. We have to directly access the throttle + // variables, since throttle.module may not be loaded yet. + $throttle = ($module->throttle && variable_get('throttle_level', 0) > 0); + if (!$throttle) { + drupal_get_filename('module', $module->name, $module->filename); + $list[$module->name] = $module->name; + } } } - else { - if ($bootstrap) { - $result = db_query("SELECT name, filename, throttle, bootstrap FROM {system} WHERE type = 'module' AND status = 1 AND bootstrap = 1 ORDER BY weight ASC, filename ASC"); - } - else { - $result = db_query("SELECT name, filename, throttle, bootstrap 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)) { - // Determine the current throttle status and see if the module should be - // loaded based on server load. We have to directly access the throttle - // variables, since throttle.module may not be loaded yet. - $throttle = ($module->throttle && variable_get('throttle_level', 0) > 0); - if (!$throttle) { - drupal_get_filename('module', $module->name, $module->filename); - $list[$module->name] = $module->name; - } - } + } + + if ($sort) { + if (!isset($sorted_list)) { + $sorted_list = $list; + ksort($sorted_list); + } + return $sorted_list; + } + + return $list; +} + +/** + * Collect a list of loaded modules that have been identified as needed for + * bootstrap procedures. + * + * @param $refresh + * Whether to force the module list to be regenerated (such as after the + * administrator has changed the system settings). + * @param $sort + * By default, modules are ordered by weight and filename, settings this + * option to TRUE, module list will be ordered by module name. + * @return + * An associative array whose keys and values are the names of all loaded + * modules. + */ +function module_list_bootstrap($refresh = FALSE, $sort = FALSE) { + static $list = array(), $sorted_list; + + if ($refresh || empty($list)) { + unset($sorted_list); + + $result = db_query("SELECT name, filename, throttle, bootstrap FROM {system} WHERE type = 'module' AND status = 1 AND bootstrap = 1 ORDER BY weight ASC, filename ASC"); + + while ($module = db_fetch_object($result)) { + if (file_exists($module->filename)) { + // Determine the current throttle status and see if the module should be + // loaded based on server load. We have to directly access the throttle + // variables, since throttle.module may not be loaded yet. + $throttle = ($module->throttle && variable_get('throttle_level', 0) > 0); + if (!$throttle) { + drupal_get_filename('module', $module->name, $module->filename); + $list[$module->name] = $module->name; + } } } } + if ($sort) { if (!isset($sorted_list)) { $sorted_list = $list; @@ -84,6 +113,7 @@ } return $sorted_list; } + return $list; } @@ -215,7 +245,7 @@ * TRUE if the module is both installed and enabled. */ function module_exists($module) { - $list = module_list(); + $list = module_list_all(); return array_key_exists($module, $list); } @@ -252,7 +282,8 @@ if (!empty($invoke_modules)) { // Refresh the module list to include the new enabled module. - module_list(TRUE, FALSE); + module_list_all(TRUE); + module_list_bootstrap(TRUE); // Force to regenerate the stored list of hook implementations. module_implements('', FALSE, TRUE); } @@ -281,7 +312,8 @@ if (!empty($invoke_modules)) { // Refresh the module list to exclude the disabled modules. - module_list(TRUE, FALSE); + module_list_all(TRUE); + module_list_bootstrap(TRUE); // Force to regenerate the stored list of hook implementations. module_implements('', FALSE, TRUE); } @@ -348,7 +380,7 @@ if (!isset($implementations[$hook])) { $implementations[$hook] = array(); - $list = module_list(FALSE, TRUE, $sort); + $list = module_list_all(FALSE, $sort); foreach ($list as $module) { if (module_hook($module, $hook)) { $implementations[$hook][] = $module; Index: modules/block/block.module =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.module,v retrieving revision 1.251 diff -u -3 -r1.251 block.module --- modules/block/block.module 31 Jan 2007 15:49:22 -0000 1.251 +++ modules/block/block.module 25 Mar 2007 17:28:18 -0000 @@ -153,7 +153,7 @@ $blocks = array(); - foreach (module_list() as $module) { + foreach (module_list_all() as $module) { $module_blocks = module_invoke($module, 'block', 'list'); if ($module_blocks) { foreach ($module_blocks as $delta => $block) { Index: modules/filter/filter.module =================================================================== RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v retrieving revision 1.166 diff -u -3 -r1.166 filter.module --- modules/filter/filter.module 12 Mar 2007 11:31:02 -0000 1.166 +++ modules/filter/filter.module 25 Mar 2007 17:28:18 -0000 @@ -634,7 +634,7 @@ function filter_list_all() { $filters = array(); - foreach (module_list() as $module) { + foreach (module_list_all() as $module) { $list = module_invoke($module, 'filter', 'list'); if (isset($list) && is_array($list)) { foreach ($list as $delta => $name) { Index: modules/search/search.module =================================================================== RCS file: /cvs/drupal/drupal/modules/search/search.module,v retrieving revision 1.215 diff -u -3 -r1.215 search.module --- modules/search/search.module 17 Mar 2007 18:30:14 -0000 1.215 +++ modules/search/search.module 25 Mar 2007 17:28:18 -0000 @@ -205,7 +205,7 @@ // Collect some stats $remaining = 0; $total = 0; - foreach (module_list() as $module) { + foreach (module_list_all() as $module) { if (module_hook($module, 'search')) { $status = module_invoke($module, 'search', 'status'); $remaining += $status['remaining']; @@ -303,7 +303,7 @@ register_shutdown_function('search_update_totals'); // Update word index - foreach (module_list() as $module) { + foreach (module_list_all() as $module) { module_invoke($module, 'update_index'); } } Index: modules/system/system.install =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.install,v retrieving revision 1.85 diff -u -3 -r1.85 system.install --- modules/system/system.install 19 Mar 2007 01:13:28 -0000 1.85 +++ modules/system/system.install 25 Mar 2007 17:28:19 -0000 @@ -149,7 +149,7 @@ ); // Check installed modules. - foreach (module_list() as $module) { + foreach (module_list_all() as $module) { $updates = drupal_get_schema_versions($module); if ($updates !== FALSE) { $default = drupal_get_installed_schema_version($module); Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.457 diff -u -3 -r1.457 system.module --- modules/system/system.module 17 Mar 2007 18:30:14 -0000 1.457 +++ modules/system/system.module 25 Mar 2007 17:28:19 -0000 @@ -1479,7 +1479,7 @@ } } - $old_module_list = module_list(); + $old_module_list = module_list_all(); if (!empty($enable_modules)) { module_enable($enable_modules); @@ -1496,7 +1496,7 @@ } drupal_install_modules($new_modules); - $current_module_list = module_list(TRUE, FALSE); + $current_module_list = module_list_all(TRUE); if (is_array($form_values['throttle'])) { foreach ($form_values['throttle'] as $key => $choice) { Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.760 diff -u -3 -r1.760 user.module --- modules/user/user.module 24 Mar 2007 05:36:30 -0000 1.760 +++ modules/user/user.module 25 Mar 2007 17:28:19 -0000 @@ -16,7 +16,7 @@ * be passed by reference. */ function user_module_invoke($type, &$array, &$user, $category = NULL) { - foreach (module_list() as $module) { + foreach (module_list_all() as $module) { $function = $module .'_user'; if (function_exists($function)) { $function($type, $array, $user, $category); @@ -965,7 +965,7 @@ function user_auth_help_links() { $links = array(); - foreach (module_list() as $module) { + foreach (module_list_all() as $module) { if (module_hook($module, 'auth')) { $links[] = l(module_invoke($module, 'info', 'name'), 'user/help', array('fragment' => $module)); } @@ -1594,7 +1594,7 @@ drupal_set_title(check_plain($account->name)); // Retrieve and merge all profile fields: $fields = array(); - foreach (module_list() as $module) { + foreach (module_list_all() as $module) { if ($data = module_invoke($module, 'user', 'view', '', $account)) { foreach ($data as $category => $items) { foreach ($items as $key => $item) { @@ -1902,7 +1902,7 @@ // Render role/permission overview: $options = array(); - foreach (module_list(FALSE, FALSE, TRUE) as $module) { + foreach (module_list_all(FALSE, TRUE) as $module) { if ($permissions = module_invoke($module, 'perm')) { $form['permission'][] = array( '#value' => $module, @@ -2489,7 +2489,7 @@

One of the more tedious moments in visiting a new website is filling out the registration form. Here at @site, you do not have to fill out a registration form if you are already a member of !affiliate-info. This capability is called distributed authentication, and Drupal, the software which powers @site, fully supports it.

Distributed authentication enables a new user to input a username and password into the login box, and immediately be recognized, even if that user never registered at @site. This works because Drupal knows how to communicate with external registration databases. For example, lets say that new user \'Joe\' is already a registered member of Delphi Forums. Drupal informs Joe on registration and login screens that he may login with his Delphi ID instead of registering with @site. Joe likes that idea, and logs in with a username of joe@remote.delphiforums.com and his usual Delphi password. Drupal then contacts the remote.delphiforums.com server behind the scenes (usually using XML-RPC, HTTP POST, or SOAP) and asks: "Is the password for user Joe correct?". If Delphi replies yes, then we create a new @site account for Joe and log him into it. Joe may keep on logging into @site in the same manner, and he will always be logged into the same account.

', array('!affiliate-info' => $affiliate_info, '@site' => $site, '@drupal' => 'http://drupal.org', '@delphi-forums' => 'http://www.delphiforums.com', '@xml' => 'http://www.xmlrpc.com', '@http-post' => 'http://www.w3.org/Protocols/', '@soap' => 'http://www.soapware.org')); - foreach (module_list() as $module) { + foreach (module_list_all() as $module) { if (module_hook($module, 'auth')) { $output .= "

". module_invoke($module, 'info', 'name') .'

'; $output .= module_invoke($module, 'help', "user/help#$module"); @@ -2514,7 +2514,7 @@ function _user_categories($account) { $categories = array(); - foreach (module_list() as $module) { + foreach (module_list_all() as $module) { if ($data = module_invoke($module, 'user', 'categories', NULL, $account, '')) { $categories = array_merge($data, $categories); } @@ -2536,7 +2536,7 @@ */ function _user_forms(&$edit, $account, $category, $hook = 'form') { $groups = array(); - foreach (module_list() as $module) { + foreach (module_list_all() as $module) { if ($data = module_invoke($module, 'user', $hook, $edit, $account, $category)) { $groups = array_merge_recursive($data, $groups); } @@ -2578,7 +2578,7 @@ $options = array(); $t_module = t('module'); - foreach (module_list() as $module) { + foreach (module_list_all() as $module) { if ($permissions = module_invoke($module, 'perm')) { asort($permissions); foreach ($permissions as $permission) {