diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 542e04b1d03..863bc7a20b8 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -20,6 +20,9 @@ Drupal 7.0, xxxx-xx-xx (development version) simple method for blocking IP addresses. E-mail and username restrictions are now available in a contributed module. IP address range blocking is no longer supported and should be done at the server level. +- Removed throttle module: + * The throttle module has been removed. Alternative methods to improve + performance are available in core and contributed modules. Drupal 6.0, 2008-02-13 ---------------------- diff --git a/includes/install.inc b/includes/install.inc index 2d74a9230ed..9398077a10a 100644 --- a/includes/install.inc +++ b/includes/install.inc @@ -359,7 +359,7 @@ function drupal_install_system() { module_invoke('system', 'install'); $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, throttle, bootstrap, schema_version) VALUES('%s', '%s', '%s', '%s', %d, %d, %d, %d)", $system_path . '/system.module', 'system', 'module', '', 1, 0, 0, $system_version); + 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); // Now that we've installed things properly, bootstrap the full Drupal environment drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); module_rebuild_cache(); diff --git a/includes/module.inc b/includes/module.inc index c87393c7b22..d0f10029845 100644 --- a/includes/module.inc +++ b/includes/module.inc @@ -58,21 +58,15 @@ function module_list($refresh = FALSE, $bootstrap = TRUE, $sort = FALSE, $fixed_ } else { if ($bootstrap) { - $result = db_query("SELECT name, filename, throttle FROM {system} WHERE type = 'module' AND status = 1 AND bootstrap = 1 ORDER BY weight ASC, filename ASC"); + $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, throttle 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)) { - // 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; - } + drupal_get_filename('module', $module->name, $module->filename); + $list[$module->name] = $module->name; } } } @@ -143,8 +137,7 @@ function module_rebuild_cache() { else { // This is a new module. $files[$filename]->status = 0; - $files[$filename]->throttle = 0; - db_query("INSERT INTO {system} (name, info, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', '%s', '%s', %d, %d, %d)", $file->name, serialize($files[$filename]->info), 'module', $file->filename, 0, 0, $bootstrap); + 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); } } $files = _module_build_dependencies($files); @@ -289,7 +282,7 @@ function module_enable($module_list) { $existing = db_fetch_object(db_query("SELECT status FROM {system} WHERE type = '%s' AND name = '%s'", 'module', $module)); if ($existing->status == 0) { module_load_install($module); - db_query("UPDATE {system} SET status = %d, throttle = %d WHERE type = '%s' AND name = '%s'", 1, 0, 'module', $module); + db_query("UPDATE {system} SET status = %d WHERE type = '%s' AND name = '%s'", 1, 'module', $module); drupal_load('module', $module); $invoke_modules[] = $module; } @@ -331,7 +324,7 @@ function module_disable($module_list) { module_load_install($module); module_invoke($module, 'disable'); - db_query("UPDATE {system} SET status = %d, throttle = %d WHERE type = '%s' AND name = '%s'", 0, 0, 'module', $module); + db_query("UPDATE {system} SET status = %d WHERE type = '%s' AND name = '%s'", 0, 'module', $module); $invoke_modules[] = $module; } } diff --git a/includes/session.inc b/includes/session.inc index 25d2479d4ab..b3ef15c3c80 100644 --- a/includes/session.inc +++ b/includes/session.inc @@ -68,7 +68,7 @@ function sess_write($key, $value) { // Only save session data when when the browser sends a cookie. This keeps // crawlers out of session table. This reduces memory and server load, // and gives more useful statistics. We can't eliminate anonymous session - // table rows without breaking throttle module and "Who's Online" block. + // table rows without breaking "Who's Online" block. if ($user->uid || $value || count($_COOKIE)) { db_query("INSERT INTO {sessions} (sid, uid, cache, hostname, session, timestamp) VALUES ('%s', %d, %d, '%s', '%s', %d)", $key, $user->uid, isset($user->cache) ? $user->cache : '', ip_address(), $value, time()); } diff --git a/modules/block/block-admin-display-form.tpl.php b/modules/block/block-admin-display-form.tpl.php index 369d0934630..5e45ca3f342 100644 --- a/modules/block/block-admin-display-form.tpl.php +++ b/modules/block/block-admin-display-form.tpl.php @@ -9,7 +9,6 @@ * - $block_regions: An array of regions. Keyed by name with the title as value. * - $block_listing: An array of blocks keyed by region and then delta. * - $form_submit: Form submit button. - * - $throttle: TRUE or FALSE depending on throttle module being enabled. * * Each $block_listing[$region] contains an array of blocks for that region. * @@ -18,7 +17,6 @@ * - $data->block_title: Block title. * - $data->region_select: Drop-down menu for assigning a region. * - $data->weight_select: Drop-down menu for setting weights. - * - $data->throttle_check: Checkbox to enable throttling. * - $data->configure_link: Block configuration link. * - $data->delete_link: For deleting user added blocks. * @@ -41,9 +39,6 @@ - - - @@ -51,19 +46,16 @@ $title): ?> - + - + $data): ?> block_title; ?> region_select; ?> weight_select; ?> - - throttle_check; ?> - configure_link; ?> delete_link; ?> diff --git a/modules/block/block.admin.inc b/modules/block/block.admin.inc index ab125d79288..2c53c998c90 100644 --- a/modules/block/block.admin.inc +++ b/modules/block/block.admin.inc @@ -35,7 +35,6 @@ function block_admin_display_form(&$form_state, $blocks, $theme = NULL) { $custom_theme = isset($theme) ? $theme : variable_get('theme_default', 'garland'); init_theme(); - $throttle = module_exists('throttle'); $block_regions = system_region_list($theme_key) + array(BLOCK_REGION_NONE => '<' . t('none') . '>'); // Build form tree @@ -70,10 +69,6 @@ function block_admin_display_form(&$form_state, $blocks, $theme = NULL) { '#default_value' => $block['region'], '#options' => $block_regions, ); - - if ($throttle) { - $form[$key]['throttle'] = array('#type' => 'checkbox', '#default_value' => isset($block['throttle']) ? $block['throttle'] : FALSE); - } $form[$key]['configure'] = array('#value' => l(t('configure'), 'admin/build/block/configure/' . $block['module'] . '/' . $block['delta'])); if ($block['module'] == 'block') { $form[$key]['delete'] = array('#value' => l(t('delete'), 'admin/build/block/delete/' . $block['delta'])); @@ -95,7 +90,7 @@ function block_admin_display_form_submit($form, &$form_state) { foreach ($form_state['values'] as $block) { $block['status'] = $block['region'] != BLOCK_REGION_NONE; $block['region'] = $block['status'] ? $block['region'] : ''; - db_query("UPDATE {blocks} SET status = %d, weight = %d, region = '%s', throttle = %d WHERE module = '%s' AND delta = '%s' AND theme = '%s'", $block['status'], $block['weight'], $block['region'], isset($block['throttle']) ? $block['throttle'] : 0, $block['module'], $block['delta'], $block['theme']); + db_query("UPDATE {blocks} SET status = %d, weight = %d, region = '%s' WHERE module = '%s' AND delta = '%s' AND theme = '%s'", $block['status'], $block['weight'], $block['region'], $block['module'], $block['delta'], $block['theme']); } drupal_set_message(t('The block settings have been updated.')); cache_clear_all(); @@ -354,7 +349,6 @@ function template_preprocess_block_admin_display_form(&$variables) { global $theme_key; $block_regions = system_region_list($theme_key); - $variables['throttle'] = module_exists('throttle'); $variables['block_regions'] = $block_regions + array(BLOCK_REGION_NONE => t('Disabled')); foreach ($block_regions as $key => $value) { @@ -386,7 +380,6 @@ function template_preprocess_block_admin_display_form(&$variables) { $variables['block_listing'][$region][$i]->block_title = drupal_render($block['info']); $variables['block_listing'][$region][$i]->region_select = drupal_render($block['region']) . drupal_render($block['theme']); $variables['block_listing'][$region][$i]->weight_select = drupal_render($block['weight']); - $variables['block_listing'][$region][$i]->throttle_check = $variables['throttle'] ? drupal_render($block['throttle']) : ''; $variables['block_listing'][$region][$i]->configure_link = drupal_render($block['configure']); $variables['block_listing'][$region][$i]->delete_link = !empty($block['delete']) ? drupal_render($block['delete']) : ''; $variables['block_listing'][$region][$i]->printed = FALSE; diff --git a/modules/block/block.install b/modules/block/block.install index 83bc7b8d170..23cb8f30ea0 100644 --- a/modules/block/block.install +++ b/modules/block/block.install @@ -62,13 +62,6 @@ function block_schema() { 'size' => 'tiny', 'description' => t('Flag to indicate how users may control visibility of the block. (0 = Users cannot control, 1 = On by default, but can be hidden, 2 = Hidden by default, but can be shown)'), ), - 'throttle' => array( - 'type' => 'int', - 'not null' => TRUE, - 'default' => 0, - 'size' => 'tiny', - 'description' => t('Flag to indicate whether or not to remove block when website traffic is high. (1 = throttle, 0 = do not throttle)'), - ), 'visibility' => array( 'type' => 'int', 'not null' => TRUE, diff --git a/modules/block/block.module b/modules/block/block.module index c6e9ebd0bd0..3d4a9445057 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -72,7 +72,6 @@ function block_help($path, $arg) { $output .= '

' . t('When working with blocks, remember that:') . '

'; $output .= '