You are here

function _backup_migrate_destination_glue_url in Backup and Migrate 5.2

Glue a URLs component parts back into a URL.

4 calls to _backup_migrate_destination_glue_url()
backup_migrate_backup_migrate_destinations in includes/destinations.inc
Implementation of hook_backup_migrate_destinations().
backup_migrate_db_backup in includes/db.inc
Build the database dump file. Takes a list of tables to exclude and some formatting options.
backup_migrate_destination_db_conf_submit in includes/destinations.db.inc
Validate the configuration form. Make sure the email address is valid.
backup_migrate_destination_db_save in includes/destinations.db.inc
Databse save download destination callback.

File

includes/destinations.inc, line 658
All of the destination handling code needed for Backup and Migrate.

Code

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

  // Obscure the password if we need to.
  $password = $hide_password ? str_repeat("*", drupal_strlen($parts['password'])) : $parts['password'];

  // Assemble the URL.
  $out = "";
  $out .= $parts['scheme'] . '://';
  $out .= $parts['user'] ? $parts['user'] : '';
  $out .= $parts['user'] && $parts['password'] ? ":" . $password : '';
  $out .= $parts['user'] || $parts['password'] ? "@" : "";
  $out .= $parts['host'];
  $out .= "/" . $parts['path'];
  return $out;
}