You are here

function boost_glue_url in Boost 6

Alt to Drupal's url() function.

http://php.net/parse-url#85963

See also

http://drupal.org/node/513860

3 calls to boost_glue_url()
boost_exit in ./boost.module
Implementation of hook_exit(). Performs cleanup tasks.
boost_init in ./boost.module
Implementation of hook_init(). Performs page setup tasks if page not cached.
boost_redirect_handler in ./boost.module
Grabs drupal_goto requests via boost_exit and looks for redirects.

File

./boost.module, line 4793
Provides static file caching for Drupal text output. Pages, Feeds, ect...

Code

function boost_glue_url($parsed) {
  if (!is_array($parsed)) {
    return FALSE;
  }
  $uri = isset($parsed['scheme']) ? $parsed['scheme'] . ':' . (strtolower($parsed['scheme']) == 'mailto' ? '' : '//') : '';
  $uri .= isset($parsed['user']) ? $parsed['user'] . (isset($parsed['pass']) ? ': ' . $parsed['pass'] : '') . '@' : '';
  $uri .= isset($parsed['host']) ? $parsed['host'] : '';
  $uri .= isset($parsed['port']) ? ':' . $parsed['port'] : '';
  if (isset($parsed['path'])) {
    $uri .= substr($parsed['path'], 0, 1) == '/' ? $parsed['path'] : (!empty($uri) ? '/' : '') . $parsed['path'];
  }
  $uri .= isset($parsed['query']) ? '?' . $parsed['query'] : '';
  $uri .= isset($parsed['fragment']) ? '#' . $parsed['fragment'] : '';
  return $uri;
}