From 76151a8bc900ebb38c76170283a05df791311f76 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 16 Apr 2008 11:35:52 +0000 Subject: - Patch #245504 by catch, David_Rothstein, Freso, et al: removed the throttle module from Drupal core. --- modules/system/system.admin.inc | 33 --------------------------------- modules/system/system.install | 22 +++++++++++++++------- modules/system/system.module | 14 +++++--------- 3 files changed, 20 insertions(+), 49 deletions(-) (limited to 'modules/system') diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc index 8c9d0aa0e..c92ac2acb 100644 --- a/modules/system/system.admin.inc +++ b/modules/system/system.admin.inc @@ -588,7 +588,6 @@ function _system_is_incompatible(&$incompatible, $files, $file) { /** * 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 = array()) { // 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 = array()) { 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 = array()) { '#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, &$form_state) { $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])) { diff --git a/modules/system/system.install b/modules/system/system.install index a8aa9d927..6d9625774 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -1149,13 +1149,6 @@ function system_schema() { 'default' => 0, 'size' => 'tiny', ), - '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', @@ -2852,6 +2845,21 @@ function system_update_7004(&$sandbox) { return $ret; } +/** + * 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. diff --git a/modules/system/system.module b/modules/system/system.module index 432881ef9..52c183a5e 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -73,11 +73,7 @@ function system_help($path, $arg) { case 'admin/build/themes/settings': return '

' . 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.') . '

'; case 'admin/build/modules': - $output = '

' . t('Modules are plugins that extend Drupal\'s core functionality. Enable modules by selecting the Enabled checkboxes below and clicking the Save configuration button. Once a module is enabled, new permissions may be available. To reduce server load, modules with their Throttle checkbox selected are temporarily disabled when your site becomes extremely busy. (Note that the Throttle 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 throttle configuration page after having enabled the throttle module.', array('@throttle' => url('admin/settings/throttle'))); - } - $output .= '

'; + $output = '

' . t('Modules are plugins that extend Drupal\'s core functionality. Enable modules by selecting the Enabled checkboxes below and clicking the Save configuration button. Once a module is enabled, new permissions may be available.)', array('@permissions' => url('admin/user/permissions'))) . '

'; $output .= '

' . t('It is important that update.php is run every time a module is updated to a newer version.', array('@update-php' => $base_url . '/update.php')) . '

'; $output .= '

' . t('You can find all administration tasks belonging to a particular module on the administration by module page.', array('@by-module' => url('admin/by-module'))) . '

'; $output .= '

' . t('To extend the functionality of your site, a number of contributed modules are available.', array('@modules' => 'http://drupal.org/project/modules')) . '

'; @@ -899,7 +895,7 @@ function system_check_directory($form_element) { */ 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($theme) { 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']); } } } -- cgit v1.2.3