function expire_get_base_urls in Cache Expiration 7
Same name and namespace in other branches
- 6 expire.module \expire_get_base_urls()
Get all base url's where this node can appear.
Parameters
$node: node object
Return value
array array(0 => array($base_url . '/'))
1 call to expire_get_base_urls()
- expire_cache_derivative in ./
expire.module - Finds all possible paths/redirects/aliases given the root path.
File
- ./
expire.domain.inc, line 36
Code
function expire_get_base_urls($node) {
global $base_url, $base_path;
// Get list of URL's if using domain access
$base_urls = array();
$domains = array();
// Get domains from node/user object
foreach ($node->domains as $key => $domain_id) {
if ($key != $domain_id) {
continue;
}
$domains[$domain_id] = $domain_id;
}
// Get domains from database
foreach (expire_get_domains($node) as $domain_id) {
$domains[$domain_id] = $domain_id;
}
// Get aliases and set base url
foreach ($domains as $domain_id) {
$domain = domain_lookup($domain_id);
if ($domain['valid'] == 1) {
if (isset($domain['path'])) {
$base_urls[$domain_id][] = $domain['path'];
}
if (is_array($domain['aliases'])) {
foreach ($domain['aliases'] as $alias) {
if ($alias['redirect'] != 1) {
$temp_domain = array(
'scheme' => $domain['scheme'],
'subdomain' => $alias['pattern'],
);
$base_urls[$domain_id][] = domain_get_path($temp_domain);
}
}
}
}
}
return $base_urls;
}