You are here

function _background_process_unparse_url in Background Process 7.2

Same name and namespace in other branches
  1. 8 background_process.module \_background_process_unparse_url()
  2. 6 background_process.module \_background_process_unparse_url()
  3. 7 background_process.module \_background_process_unparse_url()

Reverse logic of parse_url().

Parameters

$parsed_url: Array from parse_url()

Return value

string URL

1 call to _background_process_unparse_url()
_background_process_secure_url in ./background_process.http.inc
Secure a URL by obfuscating the password if present.

File

./background_process.http.inc, line 510
This contains the HTTP functions for Background Process.

Code

function _background_process_unparse_url($parsed_url) {
  $scheme = isset($parsed_url['scheme']) ? $parsed_url['scheme'] . '://' : '';
  $host = isset($parsed_url['host']) ? $parsed_url['host'] : '';
  $port = isset($parsed_url['port']) ? ':' . $parsed_url['port'] : '';
  $user = isset($parsed_url['user']) ? $parsed_url['user'] : '';
  $pass = isset($parsed_url['pass']) ? ':' . $parsed_url['pass'] : '';
  $pass = $user || $pass ? "{$pass}@" : '';
  $path = isset($parsed_url['path']) ? $parsed_url['path'] : '';
  $query = isset($parsed_url['query']) ? '?' . $parsed_url['query'] : '';
  $fragment = isset($parsed_url['fragment']) ? '#' . $parsed_url['fragment'] : '';
  return "{$scheme}{$user}{$pass}{$host}{$port}{$path}{$query}{$fragment}";
}