You are here

function _akamai_get_all_paths in Akamai 6

Same name and namespace in other branches
  1. 8 akamai.module \_akamai_get_all_paths()
  2. 8.2 akamai.module \_akamai_get_all_paths()
  3. 6.2 akamai.module \_akamai_get_all_paths()
  4. 7 akamai.module \_akamai_get_all_paths()
  5. 7.2 akamai.module \_akamai_get_all_paths()

Return all system and alias paths for the provided URL.

Parameters

$url: The URL to find all aliases

$node: The Node for the URL being cleared if one exists, NULL otherwise

Return value

An array of all paths aliased to the provided URL.

1 call to _akamai_get_all_paths()
akamai_clear_url in ./akamai.module
Clear a URL from Akamai. Clears node/id and any url aliases.

File

./akamai.module, line 211
akamai.module Integration with the Akamai CDN Cache Control Web Service.

Code

function _akamai_get_all_paths($url, $node = NULL) {
  global $language;

  // If it is not a node path, get the system path
  if (strpos($url, 'node') !== 0) {
    $src = drupal_lookup_path('source', $url);
  }
  if (!isset($src) || !$src) {
    $src = $url;
  }
  $src = preg_replace("/^\\//", "", $src);
  $paths[] = $src;
  $result = db_query("SELECT dst FROM {url_alias} WHERE src = '%s' AND language IN('%s', '')", $src, $language->language);
  while ($alias = db_result($result)) {
    $paths[] = $alias;
  }

  // Allow other modules to add/modify paths to be cleared
  drupal_alter('akamai_paths', $paths, $node);
  return $paths;
}