You are here

public function backup_migrate_destination_filesource::get_excluded_paths in Backup and Migrate 7.3

Same name and namespace in other branches
  1. 8.3 includes/sources.filesource.inc \backup_migrate_destination_filesource::get_excluded_paths()
  2. 6.3 includes/sources.filesource.inc \backup_migrate_destination_filesource::get_excluded_paths()

Breaks the excluded paths string into a usable list of paths.

4 calls to backup_migrate_destination_filesource::get_excluded_paths()
backup_migrate_destination_filesource::_backup_to_file_cli in includes/sources.filesource.inc
Backup from this source.
backup_migrate_destination_filesource::_backup_to_file_php in includes/sources.filesource.inc
Backup from this source.
backup_migrate_files_destination_archivesource::_backup_to_file_cli in includes/sources.archivesource.inc
Backup from this source.
backup_migrate_files_destination_archivesource::_backup_to_file_php in includes/sources.archivesource.inc
Backup from this source.

File

includes/sources.filesource.inc, line 295
A destination type for saving locally to the server.

Class

backup_migrate_destination_filesource
A destination type for saving locally to the server.

Code

public function get_excluded_paths($settings) {
  $base_dir = $this
    ->get_realpath() . '/';
  $paths = empty($settings->filters['exclude_filepaths']) ? '' : $settings->filters['exclude_filepaths'];
  $out = explode("\n", $paths);
  foreach ($out as $key => $val) {
    $path = trim($val, "/ \t\r\n");

    // If the path specified is a stream url or absolute path add the
    // normalized version.
    if ($real = drupal_realpath($path)) {
      $out[$key] = $real;
    }
    elseif ($real = drupal_realpath($base_dir . $path)) {
      $out[$key] = $real;
    }
    else {
      $out[$key] = $path;
    }
  }
  return $out;
}