domain_get_path

Versions
domain
domain_get_path($domain)

Determine an absolute path for a domain

Parameters

$domain The currently active $domain array, provided by domain_lookup().

Return value

The base url of the requested domain.

▾ 3 functions call domain_get_path()

domain_check_response in ./domain.admin.inc
Checks to see if the webserver returns a valid response for a request to a domain.
domain_content_list in domain_content/domain_content.admin.inc
List the available domains for this user.
domain_domainload in ./domain.module
Implement hook_domainload()

Code

./domain.module, line 1030

<?php
function domain_get_path($domain) {
  global $base_url;
  if (empty($base_url)) {
    return check_url($domain['scheme'] .'://'. $domain['subdomain']);
  }
  $_url = parse_url($base_url);
  // PHP 5 does not return an empty path element.
  if (!isset($_url['path'])) {
    $_url['path'] = '/';
  }
  // We need a trailing slash at the end of the path
  if (substr($_url['path'], -1) != '/') {
    $_url['path'] .= '/';
  }
  $path = check_url($domain['scheme'] .'://'. $domain['subdomain'] . $_url['path']);
  return $path;
}
?>

Contact

  • agentrickard [at] gmail [dot] com

Donations

My Amazon.com Wish List