? throttle.patch
Index: CHANGELOG.txt
===================================================================
RCS file: /cvs/drupal/drupal/CHANGELOG.txt,v
retrieving revision 1.260
diff -u -p -r1.260 CHANGELOG.txt
--- CHANGELOG.txt	8 Apr 2008 22:50:54 -0000	1.260
+++ CHANGELOG.txt	11 Apr 2008 16:28:50 -0000
@@ -20,6 +20,9 @@ Drupal 7.0, xxxx-xx-xx (development vers
       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
 ----------------------
Index: includes/install.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/install.inc,v
retrieving revision 1.58
diff -u -p -r1.58 install.inc
--- includes/install.inc	12 Feb 2008 13:45:16 -0000	1.58
+++ includes/install.inc	11 Apr 2008 16:28:50 -0000
@@ -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, %d)", $system_path .'/system.module', 'system', 'module', '', 1, 0, 0, $system_version);
   // Now that we've installed things properly, bootstrap the full Drupal environment
   drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
   module_rebuild_cache();
Index: includes/module.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/module.inc,v
retrieving revision 1.115
diff -u -p -r1.115 module.inc
--- includes/module.inc	27 Dec 2007 12:31:05 -0000	1.115
+++ includes/module.inc	11 Apr 2008 16:28:50 -0000
@@ -58,21 +58,15 @@ function module_list($refresh = FALSE, $
     }
     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;
     }
   }
Index: includes/session.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/session.inc,v
retrieving revision 1.46
diff -u -p -r1.46 session.inc
--- includes/session.inc	17 Feb 2008 20:03:42 -0000	1.46
+++ includes/session.inc	11 Apr 2008 16:28:50 -0000
@@ -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());
     }
Index: modules/block/block-admin-display-form.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block-admin-display-form.tpl.php,v
retrieving revision 1.3
diff -u -p -r1.3 block-admin-display-form.tpl.php
--- modules/block/block-admin-display-form.tpl.php	16 Jan 2008 22:57:26 -0000	1.3
+++ modules/block/block-admin-display-form.tpl.php	11 Apr 2008 16:28:50 -0000
@@ -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 @@
       <th><?php print t('Block'); ?></th>
       <th><?php print t('Region'); ?></th>
       <th><?php print t('Weight'); ?></th>
-      <?php if ($throttle): ?>
-        <th><?php print t('Throttle'); ?></th>
-      <?php endif; ?>
       <th colspan="2"><?php print t('Operations'); ?></th>
     </tr>
   </thead>
@@ -51,19 +46,16 @@
     <?php $row = 0; ?>
     <?php foreach ($block_regions as $region => $title): ?>
       <tr class="region region-<?php print $region?>">
-        <td colspan="<?php print $throttle ? '6' : '5'; ?>" class="region"><?php print $title; ?></td>
+        <td colspan="5" class="region"><?php print $title; ?></td>
       </tr>
       <tr class="region-message region-<?php print $region?>-message <?php print empty($block_listing[$region]) ? 'region-empty' : 'region-populated'; ?>">
-        <td colspan="<?php print $throttle ? '6' : '5'; ?>"><em><?php print t('No blocks in this region'); ?></em></td>
+        <td colspan="5"><em><?php print t('No blocks in this region'); ?></em></td>
       </tr>
       <?php foreach ($block_listing[$region] as $delta => $data): ?>
       <tr class="draggable <?php print $row % 2 == 0 ? 'odd' : 'even'; ?><?php print $data->row_class ? ' '. $data->row_class : ''; ?>">
         <td class="block"><?php print $data->block_title; ?></td>
         <td><?php print $data->region_select; ?></td>
         <td><?php print $data->weight_select; ?></td>
-        <?php if ($throttle): ?>
-          <td><?php print $data->throttle_check; ?></td>
-        <?php endif; ?>
         <td><?php print $data->configure_link; ?></td>
         <td><?php print $data->delete_link; ?></td>
       </tr>
Index: modules/block/block.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.admin.inc,v
retrieving revision 1.14
diff -u -p -r1.14 block.admin.inc
--- modules/block/block.admin.inc	22 Dec 2007 23:24:24 -0000	1.14
+++ modules/block/block.admin.inc	11 Apr 2008 16:28:50 -0000
@@ -35,7 +35,6 @@ function block_admin_display_form(&$form
   $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
       '#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
   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
   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
       $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;
Index: modules/block/block.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.install,v
retrieving revision 1.9
diff -u -p -r1.9 block.install
--- modules/block/block.install	15 Mar 2008 12:31:28 -0000	1.9
+++ modules/block/block.install	11 Apr 2008 16:28:50 -0000
@@ -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,
Index: modules/block/block.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.module,v
retrieving revision 1.301
diff -u -p -r1.301 block.module
--- modules/block/block.module	21 Mar 2008 08:41:25 -0000	1.301
+++ modules/block/block.module	11 Apr 2008 16:28:51 -0000
@@ -72,7 +72,6 @@ function block_help($path, $arg) {
       $output .= '<p>'. t('When working with blocks, remember that:') .'</p>';
       $output .= '<ul><li>'. t('since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis.') .'</li>';
       $output .= '<li>'. t('disabled blocks, or blocks not in a region, are never shown.') .'</li>';
-      $output .= '<li>'. t('when throttle module is enabled, throttled blocks (blocks with the <em>Throttle</em> checkbox selected) are hidden during high server loads.') .'</li>';
       $output .= '<li>'. t('blocks can be configured to be visible only on certain pages.') .'</li>';
       $output .= '<li>'. t('blocks can be configured to be visible only when specific conditions are true.') .'</li>';
       $output .= '<li>'. t('blocks can be configured to be visible only for certain user roles.') .'</li>';
@@ -81,11 +80,7 @@ function block_help($path, $arg) {
       $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@block">Block module</a>.', array('@block' => 'http://drupal.org/handbook/modules/block/')) .'</p>';
       return $output;
     case 'admin/build/block':
-      $throttle = module_exists('throttle');
       $output = '<p>'. t('This page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. To change the region or order of a block, grab a drag-and-drop handle under the <em>Block</em> column and drag the block to a new location in the list. (Grab a handle by clicking and holding the mouse while hovering over a handle icon.) Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the <em>Save blocks</em> button at the bottom of the page.') .'</p>';
-      if ($throttle) {
-        $output .= '<p>'. t('To reduce CPU usage, database traffic or bandwidth, blocks may be automatically disabled during high server loads by selecting their <em>Throttle</em> checkbox. Adjust throttle thresholds on the <a href="@throttleconfig">throttle configuration page</a>.', array('@throttleconfig' => url('admin/settings/throttle'))) .'</p>';
-      }
       $output .= '<p>'. t('Click the <em>configure</em> link next to each block to configure its specific title and visibility settings. Use the <a href="@add-block">add block page</a> to create a custom block.', array('@add-block' => url('admin/build/block/add'))) .'</p>';
       return $output;
     case 'admin/build/block/add':
@@ -474,7 +469,7 @@ function _block_load_blocks() {
  *   An array of block objects such as returned for one region by _block_load_blocks()
  *
  * @return
- *   An array of visible or not-throttled blocks with subject and content rendered.
+ *   An array of visible blocks with subject and content rendered.
  */
 function _block_render_blocks($region_blocks) {
   foreach ($region_blocks as $key => $block) {
@@ -483,26 +478,22 @@ function _block_render_blocks($region_bl
       // Erase the block from the static array - we'll put it back if it has content.
       unset($region_blocks[$key]);
       if ($block->enabled && $block->page_match) {
-        // Check the current throttle status and see if block should be displayed
-        // based on server load.
-        if (!($block->throttle && (module_invoke('throttle', 'status') > 0))) {
-          // Try fetching the block from cache. Block caching is not compatible with
-          // node_access modules. We also preserve the submission of forms in blocks,
-          // by fetching from cache only if the request method is 'GET'.
-          if (!count(module_implements('node_grants')) && $_SERVER['REQUEST_METHOD'] == 'GET' && ($cid = _block_get_cache_id($block)) && ($cache = cache_get($cid, 'cache_block'))) {
-            $array = $cache->data;
-          }
-          else {
-            $array = module_invoke($block->module, 'block', 'view', $block->delta);
-            if (isset($cid)) {
-              cache_set($cid, $array, 'cache_block', CACHE_TEMPORARY);
-            }
+        // Try fetching the block from cache. Block caching is not compatible with
+        // node_access modules. We also preserve the submission of forms in blocks,
+        // by fetching from cache only if the request method is 'GET'.
+        if (!count(module_implements('node_grants')) && $_SERVER['REQUEST_METHOD'] == 'GET' && ($cid = _block_get_cache_id($block)) && ($cache = cache_get($cid, 'cache_block'))) {
+          $array = $cache->data;
+        }
+        else {
+          $array = module_invoke($block->module, 'block', 'view', $block->delta);
+          if (isset($cid)) {
+            cache_set($cid, $array, 'cache_block', CACHE_TEMPORARY);
           }
+        }
 
-          if (isset($array) && is_array($array)) {
-            foreach ($array as $k => $v) {
-              $block->$k = $v;
-            }
+        if (isset($array) && is_array($array)) {
+          foreach ($array as $k => $v) {
+            $block->$k = $v;
           }
         }
         if (isset($block->content) && $block->content) {
Index: modules/statistics/statistics.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/statistics/statistics.module,v
retrieving revision 1.274
diff -u -p -r1.274 statistics.module
--- modules/statistics/statistics.module	10 Apr 2008 10:28:23 -0000	1.274
+++ modules/statistics/statistics.module	11 Apr 2008 16:28:51 -0000
@@ -59,7 +59,7 @@ function statistics_exit() {
       }
     }
   }
-  if ((variable_get('statistics_enable_access_log', 0)) && (module_invoke('throttle', 'status') == 0)) {
+  if (variable_get('statistics_enable_access_log', 0)) {
     // Log this page access.
     db_query("INSERT INTO {accesslog} (title, path, url, hostname, uid, sid, timer, timestamp) values('%s', '%s', '%s', '%s', %d, '%s', %d, %d)", strip_tags(drupal_get_title()), $_GET['q'], referer_uri(), ip_address(), $user->uid, session_id(), timer_read('page'), time());
   }
Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.69
diff -u -p -r1.69 system.admin.inc
--- modules/system/system.admin.inc	10 Apr 2008 01:43:32 -0000	1.69
+++ modules/system/system.admin.inc	11 Apr 2008 16:28:51 -0000
@@ -588,7 +588,6 @@ function _system_is_incompatible(&$incom
 /**
  * Menu callback; provides module enable/disable interface.
  *
- * Modules can be enabled or disabled and set for throttling if the throttle module is enabled.
  * The list of modules gets populated by module.info files, which contain each module's name,
  * description and dependencies.
  * @see drupal_parse_info_file for information on module.info descriptors.
@@ -642,7 +641,6 @@ function system_modules($form_state = ar
 
   // Array for disabling checkboxes in callback system_module_disable.
   $disabled = array();
-  $throttle = array();
   // Traverse the files retrieved and build the form.
   foreach ($files as $filename => $file) {
     $form['name'][$filename] = array('#value' => $file->info['name']);
@@ -658,9 +656,6 @@ function system_modules($form_state = ar
     if ($file->status) {
       $status[] = $file->name;
     }
-    if ($file->throttle) {
-      $throttle[] = $file->name;
-    }
 
     $dependencies = array();
     // Check for missing dependencies.
@@ -736,21 +731,6 @@ function system_modules($form_state = ar
     '#incompatible_modules_php' => $incompatible_php,
   );
 
-  // Handle throttle checkboxes, including overriding the
-  // generated checkboxes for required modules.
-  if (module_exists('throttle')) {
-    $form['throttle'] = array(
-      '#type' => 'checkboxes',
-      '#default_value' => $throttle,
-      '#options' => $options,
-      '#process' => array(
-        'expand_checkboxes',
-        'system_modules_disable',
-      ),
-      '#disabled_modules' => array_merge($modules_required, array('throttle')),
-    );
-  }
-
   $form['buttons']['submit'] = array(
     '#type' => 'submit',
     '#value' => t('Save configuration'),
@@ -861,13 +841,6 @@ function system_modules_submit($form, &$
     $dependencies = NULL;
   }
 
-  // Update throttle settings, if present
-  if (isset($form_state['values']['throttle'])) {
-    foreach ($form_state['values']['throttle'] as $key => $choice) {
-      db_query("UPDATE {system} SET throttle = %d WHERE type = 'module' and name = '%s'", $choice ? 1 : 0, $key);
-    }
-  }
-
   // If there where unmet dependencies and they haven't confirmed don't process
   // the submission yet. Store the form submission data needed later.
   if ($dependencies) {
@@ -2085,9 +2058,6 @@ function theme_system_modules($form) {
   // Individual table headers.
   $header = array();
   $header[] = array('data' => t('Enabled'), 'class' => 'checkbox');
-  if (module_exists('throttle')) {
-    $header[] = array('data' => t('Throttle'), 'class' => 'checkbox');
-  }
   $header[] = t('Name');
   $header[] = t('Version');
   $header[] = t('Description');
@@ -2127,9 +2097,6 @@ function theme_system_modules($form) {
         $status = drupal_render($form['status'][$key]);
       }
       $row[] = array('data' => $status, 'class' => 'checkbox');
-      if (module_exists('throttle')) {
-        $row[] = array('data' => drupal_render($form['throttle'][$key]), 'class' => 'checkbox');
-      }
 
       // Add labels only when there is also a checkbox.
       if (isset($form['status'][$key])) {
Index: modules/system/system.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.install,v
retrieving revision 1.246
diff -u -p -r1.246 system.install
--- modules/system/system.install	10 Apr 2008 10:28:23 -0000	1.246
+++ modules/system/system.install	11 Apr 2008 16:28:52 -0000
@@ -1142,13 +1142,6 @@ function system_schema() {
         'not null' => TRUE,
         'default' => 0,
       ),
-      'throttle' => array(
-        'description' => t('Boolean indicating whether this item is disabled when the throttle.module disables throttleable items.'),
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-        'size' => 'tiny',
-      ),
       'bootstrap' => array(
         'description' => t("Boolean indicating whether this module is loaded during Drupal's early bootstrapping phase (e.g. even before the page cache is consulted)."),
         'type' => 'int',
@@ -2846,6 +2839,21 @@ function system_update_7004(&$sandbox) {
 }
 
 /**
+ * Remove throttle columns and variables.
+ */
+function system_update_7005() { 
+  $ret = array();
+  db_drop_field($ret, 'blocks', 'throttle');
+  db_drop_field($ret, 'system', 'throttle');
+  variable_del('throttle_user');
+  variable_del('throttle_anonymous');
+  variable_del('throttle_level');
+  variable_del('throttle_probability_limiter');  
+   
+  return $ret;
+}
+
+/**
  * @} End of "defgroup updates-6.x-to-7.x"
  * The next series of updates should start at 8000.
  */
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.596
diff -u -p -r1.596 system.module
--- modules/system/system.module	10 Apr 2008 10:28:23 -0000	1.596
+++ modules/system/system.module	11 Apr 2008 16:28:52 -0000
@@ -73,11 +73,7 @@ function system_help($path, $arg) {
     case 'admin/build/themes/settings':
       return '<p>'. t('These options control the default display settings for your entire site, across all themes. Unless they have been overridden by a specific theme, these settings will be used.') .'</p>';
     case 'admin/build/modules':
-      $output = '<p>'. t('Modules are plugins that extend Drupal\'s core functionality. Enable modules by selecting the <em>Enabled</em> checkboxes below and clicking the <em>Save configuration</em> button. Once a module is enabled, new <a href="@permissions">permissions</a> may be available. To reduce server load, modules with their <em>Throttle</em> checkbox selected are temporarily disabled when your site becomes extremely busy. (Note that the <em>Throttle</em> checkbox is only available if the Throttle module is enabled.)', array('@permissions' => url('admin/user/permissions')));
-      if (module_exists('throttle')) {
-        $output .= ' '. t('The auto-throttle functionality must be enabled on the <a href="@throttle">throttle configuration page</a> after having enabled the throttle module.', array('@throttle' => url('admin/settings/throttle')));
-      }
-      $output .= '</p>';
+      $output = '<p>'. t('Modules are plugins that extend Drupal\'s core functionality. Enable modules by selecting the <em>Enabled</em> checkboxes below and clicking the <em>Save configuration</em> button. Once a module is enabled, new <a href="@permissions">permissions</a> may be available.', array('@permissions' => url('admin/user/permissions'))) .'</p>';
       $output .= '<p>'. t('It is important that <a href="@update-php">update.php</a> is run every time a module is updated to a newer version.', array('@update-php' => $base_url .'/update.php')) .'</p>';
       $output .= '<p>'. t('You can find all administration tasks belonging to a particular module on the <a href="@by-module">administration by module page</a>.', array('@by-module' => url('admin/by-module'))) .'</p>';
       $output .= '<p>'. t('To extend the functionality of your site, a number of <a href="@modules">contributed modules</a> are available.', array('@modules' => 'http://drupal.org/project/modules')) .'</p>';
@@ -899,7 +895,7 @@ function system_check_directory($form_el
  */
 function system_get_files_database(&$files, $type) {
   // Extract current files from database.
-  $result = db_query("SELECT filename, name, type, status, throttle, schema_version FROM {system} WHERE type = '%s'", $type);
+  $result = db_query("SELECT filename, name, type, status, schema_version FROM {system} WHERE type = '%s'", $type);
   while ($file = db_fetch_object($result)) {
     if (isset($files[$file->name]) && is_object($files[$file->name])) {
       $file->old_filename = $file->filename;
@@ -969,7 +965,7 @@ function system_theme_data() {
       $theme->owner = '';
     }
 
-    db_query("INSERT INTO {system} (name, owner, info, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', '%s', '%s', '%s', %d, %d, %d)", $theme->name, $theme->owner, serialize($theme->info), 'theme', $theme->filename, isset($theme->status) ? $theme->status : 0, 0, 0);
+    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);
   }
 
   return $themes;
@@ -1155,8 +1151,8 @@ function system_initialize_theme_blocks(
       if (!array_key_exists($block['region'], $regions)) {
         $block['region'] = system_default_region($theme);
       }
-      db_query("INSERT INTO {blocks} (module, delta, theme, status, weight, region, visibility, pages, custom, throttle, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', %d, '%s', %d, %d, %d)",
-          $block['module'], $block['delta'], $theme, $block['status'], $block['weight'], $block['region'], $block['visibility'], $block['pages'], $block['custom'], $block['throttle'], $block['cache']);
+      db_query("INSERT INTO {blocks} (module, delta, theme, status, weight, region, visibility, pages, custom, cache) VALUES ('%s', '%s', '%s', %d, %d, '%s', %d, '%s', %d, %d)",
+          $block['module'], $block['delta'], $theme, $block['status'], $block['weight'], $block['region'], $block['visibility'], $block['pages'], $block['custom'], $block['cache']);
     }
   }
 }
Index: modules/throttle/throttle.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/throttle/throttle.admin.inc,v
retrieving revision 1.2
diff -u -p -r1.2 throttle.admin.inc
--- modules/throttle/throttle.admin.inc	8 Jan 2008 10:35:43 -0000	1.2
+++ modules/throttle/throttle.admin.inc	11 Apr 2008 16:28:52 -0000
@@ -1,55 +0,0 @@
-<?php
-// $Id: throttle.admin.inc,v 1.2 2008/01/08 10:35:43 goba Exp $
-
-/**
- * @file
- * Admin page callbacks for the throttle module.
- */
-
-/**
- * Form builder; Configure the throttle system.
- *
- * @ingroup forms
- * @see system_settings_form()
- * @see throttle_admin_settings_validate()
- */
-function throttle_admin_settings() {
-  $probabilities = array(0 => '100%', 1 => '50%', 2 => '33.3%', 3 => '25%', 4 => '20%', 5 => '16.6%', 7 => '12.5%', 9 => '10%', 19 => '5%', 99 => '1%', 199 => '.5%', 399 => '.25%', 989 => '.1%');
-
-  $form['throttle_anonymous'] = array(
-    '#type' => 'textfield',
-    '#title' => t('Auto-throttle on anonymous users'),
-    '#default_value' => variable_get('throttle_anonymous', 0),
-    '#size' => 5,
-    '#maxlength' => 6,
-    '#description' => t('The congestion control throttle can be automatically enabled when the number of anonymous users currently visiting your site exceeds the specified threshold. For example, to start the throttle when your site has 250 anonymous users online at once, enter \'250\' in this field. Leave this value blank or set to "0" if you do not wish to auto-throttle on anonymous users. You can inspect the current number of anonymous users using the "Who\'s online" block.')
-  );
-  $form['throttle_user'] = array(
-    '#type' => 'textfield',
-    '#title' => t('Auto-throttle on authenticated users'),
-    '#default_value' => variable_get('throttle_user', 0),
-    '#size' => 5,
-    '#maxlength' => 6,
-    '#description' => t('The congestion control throttle can be automatically enabled when the number of authenticated users currently visiting your site exceeds the specified threshold. For example, to start the throttle when your site has 50 registered users online at once, enter \'50\' in this field. Leave this value blank or set to "0" if you do not wish to auto-throttle on authenticated users. You can inspect the current number of authenticated users using the "Who\'s online" block.')
-  );
-  $form['throttle_probability_limiter'] = array(
-    '#type' => 'select',
-    '#title' => t('Auto-throttle probability limiter'),
-    '#default_value' => variable_get('throttle_probability_limiter', 9),
-    '#options' => $probabilities,
-    '#description' => t('The auto-throttle probability limiter is an efficiency mechanism to statistically reduce the overhead of the auto-throttle. The limiter is expressed as a percentage of page views, so for example if set to the default of 10% we only perform the extra database queries to update the throttle status 1 out of every 10 page views. The busier your site, the lower you should set the limiter value.')
-  );
-
-  $form['#validate'] = array('throttle_admin_settings_validate');
-
-  return system_settings_form($form);
-}
-
-function throttle_admin_settings_validate($form, &$form_state) {
-  if (!is_numeric($form_state['values']['throttle_anonymous']) || $form_state['values']['throttle_anonymous'] < 0) {
-    form_set_error('throttle_anonymous', t("%value is not a valid auto-throttle setting. Please enter a positive numeric value.", array('%value' => $form_state['values']['throttle_anonymous'])));
-  }
-  if (!is_numeric($form_state['values']['throttle_user']) || $form_state['values']['throttle_user'] < 0) {
-    form_set_error('throttle_user', t("%value is not a valid auto-throttle setting. Please enter a positive numeric value.", array('%value' => $form_state['values']['throttle_user'])));
-  }
-}
Index: modules/throttle/throttle.info
===================================================================
RCS file: /cvs/drupal/drupal/modules/throttle/throttle.info,v
retrieving revision 1.5
diff -u -p -r1.5 throttle.info
--- modules/throttle/throttle.info	18 Feb 2008 19:19:47 -0000	1.5
+++ modules/throttle/throttle.info	11 Apr 2008 16:28:52 -0000
@@ -1,6 +1 @@
-; $Id: throttle.info,v 1.5 2008/02/18 19:19:47 dries Exp $
-name = Throttle
-description = Handles the auto-throttling mechanism, to control site congestion.
-package = Core - optional
-version = VERSION
-core = 7.x
+
Index: modules/throttle/throttle.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/throttle/throttle.module,v
retrieving revision 1.83
diff -u -p -r1.83 throttle.module
--- modules/throttle/throttle.module	14 Dec 2007 18:08:49 -0000	1.83
+++ modules/throttle/throttle.module	11 Apr 2008 16:28:52 -0000
@@ -1,128 +0,0 @@
-<?php
-// $Id: throttle.module,v 1.83 2007/12/14 18:08:49 goba Exp $
-
-/**
- * @file
- * Allows configuration of congestion control auto-throttle mechanism.
- */
-
-function throttle_menu() {
-  $items['admin/settings/throttle'] = array(
-    'title' => 'Throttle',
-    'description' => 'Control how your site cuts out content during heavy load.',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('throttle_admin_settings'),
-    'access arguments' => array('administer site configuration'),
-    'file' => 'throttle.admin.inc',
-  );
-  return $items;
-}
-
-/**
- * Determine the current load on the site.
- *
- * Call the throttle_status() function from your own modules, themes, blocks,
- * etc. as follows:
- *
- *   $throttle = module_invoke('throttle', 'status');
- *
- * to determine the current throttle status. Use module_invoke() so the
- * call will still work if the throttle module is disabled. For example, in
- * your theme you might choose to disable pictures when your site is too busy
- * (reducing bandwidth), or in your modules you might choose to disable
- * some complicated logic when your site is too busy (reducing CPU utilization).
- *
- * @return
- *   0 or 1. 0 means that the throttle is currently disabled. 1 means that
- *   the throttle is currently enabled. When the throttle is enabled, CPU
- *   and bandwidth intensive functionality should be disabled.
- */
-function throttle_status() {
-  return variable_get('throttle_level', 0);
-}
-
-/**
- * Implementation of hook_exit().
- *
- * Changes the current throttle level based on page hits.
- */
-function throttle_exit() {
-  // The following logic determines what the current throttle level should
-  //  be, and can be disabled by the admin. If enabled, the mt_rand() function
-  //  returns a number between 0 and N, N being specified by the admin. If
-  //  0 is returned, the throttle logic is run, adding two additional database
-  //  queries. Otherwise, the following logic is skipped. This mechanism is
-  //  referred to in the admin page as the 'probability limiter', roughly
-  //  limiting throttle related database calls to 1 in N.
-  if (!mt_rand(0, variable_get('throttle_probability_limiter', 9))) {
-
-    // Count users with activity in the past n seconds.
-    // This value is defined in the user module Who's Online block.
-    $time_period = variable_get('user_block_seconds_online', 900);
-
-    // When determining throttle status in your own module or theme, use
-    // $throttle = module_invoke('throttle', 'status');
-    // as that will still work when throttle.module is disabled.
-    // Clearly here the module is enabled so we call throttle_status() directly.
-    $throttle = throttle_status();
-
-    if ($max_guests = variable_get('throttle_anonymous', 0)) {
-      $guests = sess_count(time() - $time_period, TRUE);
-    }
-    else {
-      $guests = 0;
-    }
-    if ($max_users = variable_get('throttle_user', 0)) {
-      $users = sess_count(time() - $time_period, FALSE);
-    }
-    else {
-      $users = 0;
-    }
-
-    // update the throttle status
-    $message = '';
-    if ($max_users && $users > $max_users) {
-      if (!$throttle) {
-        variable_set('throttle_level', 1);
-        $message = format_plural($users,
-                                 '1 user accessing site; throttle enabled.',
-                                 '@count users accessing site; throttle enabled.');
-      }
-    }
-    elseif ($max_guests && $guests > $max_guests) {
-      if (!$throttle) {
-        variable_set('throttle_level', 1);
-        $message = format_plural($guests,
-                                 '1 guest accessing site; throttle enabled.',
-                                 '@count guests accessing site; throttle enabled.');
-      }
-    }
-    else {
-      if ($throttle) {
-        variable_set('throttle_level', 0);
-        // Note: unorthodox format_plural() usage due to Gettext plural limitations.
-        $message = format_plural($users, '1 user', '@count users') .', ';
-        $message .= format_plural($guests, '1 guest accessing site; throttle disabled', '@count guests accessing site; throttle disabled');
-      }
-    }
-    if ($message) {
-      cache_clear_all();
-      watchdog('throttle', 'Throttle: %message', array('%message' => $message));
-    }
-  }
-}
-
-/**
- * Implementation of hook_help().
- */
-function throttle_help($path, $arg) {
-  switch ($path) {
-    case 'admin/help#throttle':
-      $output = '<p>'. t('The throttle module provides a congestion control mechanism that automatically adjusts to a surge in incoming traffic. If your site is referenced by a popular website, or experiences a "Denial of Service" (DoS) attack, your webserver might become overwhelmed. The throttle mechanism is utilized by modules to temporarily disable CPU-intensive functionality, increasing performance. For instance, via the throttle module, modules may choose to disable resource-intensive blocks or the code within the site theme may temporarily disable user pictures in posts.') .'</p>';
-      $output .= '<p>'. t('The congestion control throttle can be automatically enabled when the number of anonymous or authenticated users currently visiting the site exceeds a specified threshold.') .'</p>';
-      $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@throttle">Throttle module</a>.', array('@throttle' => 'http://drupal.org/handbook/modules/throttle/')) .'</p>';
-      return $output;
-    case 'admin/settings/throttle':
-      return '<p>'. t('The throttle module provides a congestion control mechanism that automatically adjusts to a surge in incoming traffic. If your site is referenced by a popular website, or experiences a "Denial of Service" (DoS) attack, your webserver might become overwhelmed. The throttle mechanism is utilized by modules to temporarily disable CPU-intensive functionality, increasing performance.') .'</p>';
-  }
-}
