1 backup.inc backup_get_handler_name($target)

Given a particular backup/restore target, find the class that applies.

Parameters

string $target: The backup source or restore target as a string, such as "db:default" or "config:active".

Return value

string|false: The name of the class that indicates it can handle the given backup target. Additional classes can be added through $settings['backup_handlers'] in settings.php. If multiple classes match the target, the last class in the list takes priority.

File

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

Code

function backup_get_handler_name($target) {
  $class_list = array_reverse(backup_class_list(), TRUE);
  foreach ($class_list as $class_name => $class_path) {
    if (is_subclass_of($class_name, 'Backup')) {
      if ($class_name::applies($target)) {
        return $class_name;
      }
    }
  }
  return FALSE;
}