1 backup.database.inc | public BackupDatabase::backupSettingsForm() |
Get the form for the backup settings for this destination.
Overrides Backup::backupSettingsForm
File
- core/
includes/ backup/ backup.database.inc, line 148 - Functions to handle the direct to/from database backup source.
Class
- BackupDatabase
- A destination type for saving to a database server.
Code
public function backupSettingsForm() {
$objects = $this->getObjectNames();
$settings = $this->settings;
$form['help'] = array(
'#type' => 'help',
'#markup' => t('You may omit specific tables, or specific table data from the backup file. Only omit data that you know you will not need such as cache data, or tables from other applications. Restoring a partial backup can break your Backdrop install. It is usually best to leave the defaults.'),
);
$form['include_exclude'] = array(
'#type' => 'select',
'#title' => t('Include/exclude tables'),
'#options' => array(
'exclude' => t('Exclude specific tables'),
'include' => t('Include specific tables'),
),
'#default_value' => $settings['include_tables'] ? 'include' : 'exclude',
'#attributes' => array(
'class' => array('backup-include-exclude-mode'),
),
);
$form['include_tables'] = array(
'#type' => 'select',
'#multiple' => TRUE,
'#title' => t('Include only the following tables'),
'#options' => backdrop_map_assoc($objects),
'#default_value' => $settings['include_tables'],
'#description' => t('Only the selected tables will be added to the backup.'),
'#states' => array(
'visible' => array(
':input.backup-include-exclude-mode' => array(
'value' => 'include',
),
),
),
);
$form['exclude_tables'] = array(
'#type' => 'select',
'#multiple' => TRUE,
'#title' => t('Exclude the following tables altogether'),
'#options' => backdrop_map_assoc($objects),
'#default_value' => $settings['exclude_tables'],
'#description' => t('The selected tables will not be added to the backup.'),
'#states' => array(
'visible' => array(
':input.backup-include-exclude-mode' => array(
'value' => 'exclude',
),
),
),
);
$form['nodata_tables'] = array(
'#type' => 'select',
'#multiple' => TRUE,
'#title' => t('Exclude the data from the following tables'),
'#options' => backdrop_map_assoc($objects),
'#default_value' => $settings['nodata_tables'],
'#description' => t('The selected tables will have their structure backed up but not their contents. This is useful for excluding cache data to reduce file size.'),
);
$form['lock_tables'] = array(
'#type' => 'checkbox',
'#title' => t('Lock tables during backup'),
'#default_value' => !empty($settings['lock_tables']) ? $settings['lock_tables'] : NULL,
'#description' => t('This can help reduce data corruption, but will make your site unresponsive.'),
);
return $form;
}