function backup_migrate_destination_remote::glue_url in Backup and Migrate 6.2
Same name and namespace in other branches
- 8.2 includes/destinations.inc \backup_migrate_destination_remote::glue_url()
- 7.2 includes/destinations.inc \backup_migrate_destination_remote::glue_url()
Glue a URLs component parts back into a URL.
2 calls to backup_migrate_destination_remote::glue_url()
- 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_destination_remote::url in includes/
destinations.inc - Get a url from the parts.
File
- includes/
destinations.inc, line 1013
Class
- backup_migrate_destination_remote
- A base class for creating destinations.
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;
}