You are here

public function backup_migrate_destination_dropbox::local_path in Backup and Migrate Dropbox 7.3

Same name and namespace in other branches
  1. 7.2 destinations.dropbox.inc \backup_migrate_destination_dropbox::local_path()

Generate a local file path with the correct prefix.

The local path will be $path without the root / and defined sub path part and will be relative, i.e. not start with a /.

Parameters

string $path:

Return value

string A relative local path based on the relative path in the Dropbox app folder.

1 call to backup_migrate_destination_dropbox::local_path()
backup_migrate_destination_dropbox::_list_files in ./destinations.dropbox.inc
Lists all files from the Dropbox destination.

File

./destinations.dropbox.inc, line 372
destinations.dropbox.inc

Class

backup_migrate_destination_dropbox
A destination for sending database backups to a Dropbox account.

Code

public function local_path($path) {
  $base_path = '/';
  if (!empty($this->dest_url['path'])) {
    $base_path .= $this->dest_url['path'] . '/';
  }

  // Strip base path.
  if (substr($path, 0, strlen($base_path)) === $base_path) {
    $path = substr($path, strlen($base_path));
  }
  return $path;
}