You are here

function backup_migrate_location::glue_url in Backup and Migrate 6.3

Same name and namespace in other branches
  1. 8.3 includes/locations.inc \backup_migrate_location::glue_url()
  2. 7.3 includes/locations.inc \backup_migrate_location::glue_url()

Glue a URLs component parts back into a URL.

5 calls to backup_migrate_location::glue_url()
backup_migrate_destination_nodesquirrel::load_file in includes/destinations.nodesquirrel.inc
Load from the NodeSquirrel destination.
backup_migrate_destination_nodesquirrel::save_file in includes/destinations.nodesquirrel.inc
Save to the NodeSquirrel destination.
backup_migrate_destination_remote::edit_form_submit in includes/destinations.inc
Submit the configuration form. Glue the url together and add the old password back if a new one was not specified.
backup_migrate_location::url in includes/locations.inc
Get a url from the parts.
backup_migrate_source_remote::edit_form_submit in includes/sources.inc
Submit the configuration form. Glue the url together and add the old password back if a new one was not specified.
1 method overrides backup_migrate_location::glue_url()
backup_migrate_location_remote::glue_url in includes/locations.inc
Glue a URLs component parts back into a URL.

File

includes/locations.inc, line 382

Class

backup_migrate_location
A base class for creating locations.

Code

function glue_url($parts, $hide_password = TRUE) {

  // Obscure the password if we need to.
  $parts['pass'] = $hide_password ? "" : $parts['pass'];

  // Assemble the URL.
  $out = "";
  $out .= $parts['scheme'] . '://';
  $out .= $parts['user'] ? urlencode($parts['user']) : '';
  $out .= $parts['user'] && $parts['pass'] ? ":" . urlencode($parts['pass']) : '';
  $out .= $parts['user'] || $parts['pass'] ? "@" : "";
  $out .= $parts['host'];
  $out .= !empty($parts['port']) ? ':' . $parts['port'] : '';
  $out .= "/" . $parts['path'];
  return $out;
}