1 backup.inc backup_class_list()

Get all backup/restore class names and file paths.

This acts a miniature version of backdrop_class_list() that lists all available classes that act as backup handlers. Unlike the normal autoloader, this is not modifiable by modules, since a full module bootstrap depends on the database. As an emergency restore cannot depend on either the database nor config to be available, settings.php is the only mechanism to configuring backup/restore handlers. Additional backup handlers can be added by adding the following lines to settings.php:

$settings['backup_handlers'] = array(
  'MyBackupHandler' = BACKDROP_ROOT . '/modules/my_module/includes/my_module.backup.inc';
);

Return value

array: An array of paths to classes, keyed by the class name.

File

core/includes/backup.inc, line 27
Contains functionality related to creating and restoring site backups.

Code

function backup_class_list() {
  $backup_class_directory = 'core/includes/backup/';
  $class_map = array(
    'Backup' => $backup_class_directory . 'backup.class.inc',
    'BackupConfig' => $backup_class_directory . 'backup.config.inc',
    'BackupDatabase' => $backup_class_directory . 'backup.database.inc',
    'BackupFile' => $backup_class_directory . 'backup.file.inc',
    'BackupMySql' => $backup_class_directory . 'backup.mysql.inc',
  );
  return array_merge($class_map, settings_get('backup_handlers', array()));
}