Index: install.php =================================================================== RCS file: /cvs/drupal/drupal/install.php,v retrieving revision 1.37 diff -u -p -r1.37 install.php --- install.php 27 Feb 2007 12:29:22 -0000 1.37 +++ install.php 28 Feb 2007 19:22:16 -0000 @@ -40,9 +40,6 @@ function install_main() { // 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'); Index: includes/bootstrap.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v retrieving revision 1.147 diff -u -p -r1.147 bootstrap.inc --- includes/bootstrap.inc 29 Jan 2007 19:25:19 -0000 1.147 +++ includes/bootstrap.inc 28 Feb 2007 19:22:16 -0000 @@ -438,7 +438,7 @@ function page_get_cache() { * 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_all(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.617 diff -u -p -r1.617 common.inc --- includes/common.inc 15 Feb 2007 11:40:17 -0000 1.617 +++ includes/common.inc 28 Feb 2007 19:22:16 -0000 @@ -351,6 +351,7 @@ function drupal_not_found() { 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.67 diff -u -p -r1.67 database.mysql.inc --- includes/database.mysql.inc 22 Jan 2007 02:20:42 -0000 1.67 +++ includes/database.mysql.inc 28 Feb 2007 19:22:16 -0000 @@ -169,6 +169,7 @@ function _db_query($query, $debug = 0) { 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.179 diff -u -p -r1.179 form.inc --- includes/form.inc 27 Feb 2007 12:45:13 -0000 1.179 +++ includes/form.inc 28 Feb 2007 19:22:17 -0000 @@ -903,7 +903,7 @@ function _element_info($type, $refresh = } } - 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 -p -r1.34 install.inc --- includes/install.inc 11 Feb 2007 08:48:36 -0000 1.34 +++ includes/install.inc 28 Feb 2007 19:22:17 -0000 @@ -22,7 +22,7 @@ define('FILE_NOT_EXECUTABLE', 128); * 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.154 diff -u -p -r1.154 menu.inc --- includes/menu.inc 14 Feb 2007 16:43:38 -0000 1.154 +++ includes/menu.inc 28 Feb 2007 19:22:17 -0000 @@ -485,7 +485,7 @@ function menu_get_active_help() { 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 -p -r1.98 module.inc --- includes/module.inc 4 Feb 2007 21:20:50 -0000 1.98 +++ includes/module.inc 28 Feb 2007 19:22:17 -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,46 @@ function module_load_all() { * 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; - } - } - 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; - } - } + + $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; @@ -84,6 +66,7 @@ function module_list($refresh = FALSE, $ } return $sorted_list; } + return $list; } @@ -215,7 +198,7 @@ function _module_parse_info_file($filena * 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 +235,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_all(TRUE); // Force to regenerate the stored list of hook implementations. module_implements('', FALSE, TRUE); } @@ -281,7 +264,7 @@ function module_disable($module_list) { if (!empty($invoke_modules)) { // Refresh the module list to exclude the disabled modules. - module_list(TRUE, FALSE); + module_list_all(TRUE); // Force to regenerate the stored list of hook implementations. module_implements('', FALSE, TRUE); } @@ -348,7 +331,7 @@ function module_implements($hook, $sort 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 -p -r1.251 block.module --- modules/block/block.module 31 Jan 2007 15:49:22 -0000 1.251 +++ modules/block/block.module 28 Feb 2007 19:22:17 -0000 @@ -153,7 +153,7 @@ function _block_rehash() { $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.163 diff -u -p -r1.163 filter.module --- modules/filter/filter.module 11 Feb 2007 09:30:51 -0000 1.163 +++ modules/filter/filter.module 28 Feb 2007 19:22:17 -0000 @@ -634,7 +634,7 @@ function filter_formats($index = NULL) { 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.213 diff -u -p -r1.213 search.module --- modules/search/search.module 14 Feb 2007 16:43:38 -0000 1.213 +++ modules/search/search.module 28 Feb 2007 19:22:17 -0000 @@ -205,7 +205,7 @@ function search_admin_settings() { // 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 @@ function search_cron() { 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.80 diff -u -p -r1.80 system.install --- modules/system/system.install 27 Feb 2007 12:34:45 -0000 1.80 +++ modules/system/system.install 28 Feb 2007 19:22:18 -0000 @@ -2,7 +2,7 @@ // $Id: system.install,v 1.80 2007/02/27 12:34:45 dries Exp $ define('DRUPAL_MINIMUM_PHP', '4.3.3'); -define('DRUPAL_MINIMUM_MYSQL', '4.1.0'); // If using MySQL +define('DRUPAL_MINIMUM_MYSQL', '4.0.0'); // If using MySQL define('DRUPAL_MINIMUM_PGSQL', '7.4'); // If using PostgreSQL define('DRUPAL_MINIMUM_APACHE', '1.3'); // If using Apache @@ -148,7 +148,7 @@ function system_requirements($phase) { ); // 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.452 diff -u -p -r1.452 system.module --- modules/system/system.module 27 Feb 2007 12:29:22 -0000 1.452 +++ modules/system/system.module 28 Feb 2007 19:22:18 -0000 @@ -1477,7 +1477,7 @@ function system_modules_submit($form_id, } } - $old_module_list = module_list(); + $old_module_list = module_list_all(); if (!empty($enable_modules)) { module_enable($enable_modules); @@ -1494,7 +1494,7 @@ function system_modules_submit($form_id, } 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.756 diff -u -p -r1.756 user.module --- modules/user/user.module 15 Feb 2007 11:40:18 -0000 1.756 +++ modules/user/user.module 28 Feb 2007 19:22:18 -0000 @@ -16,7 +16,7 @@ define('EMAIL_MAX_LENGTH', 64); * 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); @@ -963,7 +963,7 @@ function user_set_authmaps($account, $au 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)); } @@ -1592,7 +1592,7 @@ function user_view($account) { 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) { @@ -1894,7 +1894,7 @@ function user_admin_perm($rid = NULL) { // 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, @@ -2479,7 +2479,7 @@ function user_help($section) {
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 .= "