/[drupal]/contributions/modules/db_maintenance/db_maintenance.module
ViewVC logotype

Diff of /contributions/modules/db_maintenance/db_maintenance.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.11.2.2.2.1, Wed Oct 1 05:05:30 2008 UTC revision 1.11.2.2.2.2, Wed Oct 1 05:14:01 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: db_maintenance.module,v 1.11.2.2 2008/05/28 18:57:38 deekayen Exp $  // $Id: db_maintenance.module,v 1.11.2.2.2.1 2008/10/01 05:05:30 jgraham Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 121  function db_maintenance_cron() { Line 121  function db_maintenance_cron() {
121    }    }
122    
123    $last_db_backup = variable_get('db_maintenance_last_db_backup', 0);    $last_db_backup = variable_get('db_maintenance_last_db_backup', 0);
124    $db_backup_freq = variable_get('db_maintenance_db_backup_frequency', 0);    $db_backup_freq = variable_get('db_maintenance_db_backup_frequency', -1);
125    $files_backup_freq = variable_get('db_maintenance_files_backup_frequency', 0);    $files_backup_freq = variable_get('db_maintenance_files_backup_frequency', -1);
126    $last_files_backup = variable_get('db_maintenance_last_files_backup', 0);    $last_files_backup = variable_get('db_maintenance_last_files_backup', 0);
127    
128    if ($db_backup_freq != -1 && $last_db_backup <= $now - $db_backup_freq) {    if ($db_backup_freq != -1 && $last_db_backup <= $now - $db_backup_freq) {
# Line 217  function db_maintenance_admin_settings() Line 217  function db_maintenance_admin_settings()
217      '#description'   => t('If enabled and a table receives a non-okay status from the OPTIMIZE then a repair of that table will be attempted. In the case of REPAIR all resulting status are logged via watchdog.')      '#description'   => t('If enabled and a table receives a non-okay status from the OPTIMIZE then a repair of that table will be attempted. In the case of REPAIR all resulting status are logged via watchdog.')
218    );    );
219    
220    $options = array(    $frequency = array(
221      -1 => t('Never'),      -1 => t('Never'),
222      0 => t('Run during every cron'),      0 => t('Run during every cron'),
223      3600 => t('Hourly'),      3600 => t('Hourly'),
# Line 232  function db_maintenance_admin_settings() Line 232  function db_maintenance_admin_settings()
232    $form['db_maintenance_cron_frequency'] = array(    $form['db_maintenance_cron_frequency'] = array(
233      '#type'          => 'select',      '#type'          => 'select',
234      '#title'         => t('Optimize tables'),      '#title'         => t('Optimize tables'),
235      '#options'       => $options,      '#options'       => $frequency,
236      '#default_value' => variable_get('db_maintenance_cron_frequency', 86400),      '#default_value' => variable_get('db_maintenance_cron_frequency', 86400),
237      '#description'   => t('Select how often database tables should be optimized.') .' '. l(t('Optimize now.'), 'db_maintenance/optimize'),      '#description'   => t('Select how often database tables should be optimized.') .' '. l(t('Optimize now.'), 'db_maintenance/optimize'),
238    );    );
# Line 264  function db_maintenance_admin_settings() Line 264  function db_maintenance_admin_settings()
264      '#title' => t('Database Backup frequency'),      '#title' => t('Database Backup frequency'),
265      '#description' => t('How often to backup the database. This is the most frequent this will run, but no more often than the frequency of the drupal cron script.'),      '#description' => t('How often to backup the database. This is the most frequent this will run, but no more often than the frequency of the drupal cron script.'),
266      '#options' => $frequency,      '#options' => $frequency,
267      '#default_value' => variable_get('db_maintenance_db_backup_frequency', 0),      '#default_value' => variable_get('db_maintenance_db_backup_frequency', -1),
268    );    );
269    
270    $form['db_maintenance_files_backup_frequency'] = array(    $form['db_maintenance_files_backup_frequency'] = array(
# Line 272  function db_maintenance_admin_settings() Line 272  function db_maintenance_admin_settings()
272      '#title' => t('Files Backup frequency'),      '#title' => t('Files Backup frequency'),
273      '#description' => t('How often to backup the files directory. This is the most frequent this will run, but no more often than the frequency of the drupal cron script.'),      '#description' => t('How often to backup the files directory. This is the most frequent this will run, but no more often than the frequency of the drupal cron script.'),
274      '#options' => $frequency,      '#options' => $frequency,
275      '#default_value' => variable_get('db_maintenance_files_backup_frequency', 0),      '#default_value' => variable_get('db_maintenance_files_backup_frequency', -1),
276    );    );
277    
278    $form['db_maintenance_backup_directory'] = array(    $form['db_maintenance_backup_directory'] = array(

Legend:
Removed from v.1.11.2.2.2.1  
changed lines
  Added in v.1.11.2.2.2.2

  ViewVC Help
Powered by ViewVC 1.1.2