You are here

function gardens_site_data_get_site_from_file in Acquia Cloud Site Factory Connector 8

Same name and namespace in other branches
  1. 8.2 acsf_init/lib/sites/g/sites.inc \gardens_site_data_get_site_from_file()

Parses the entire JSON sites file and returns a result for a single domain.

Use gardens_site_data_refresh_one() for a faster near-equivalent.

Parameters

string $domain: A domain name to search for in the JSON.

Return value

array A gardens site data structure, or zero if the domain was not found.

File

acsf_init/lib/sites/g/sites.inc, line 327
ACSF helper functions for Drupal's multi-site directory aliasing feature.

Code

function gardens_site_data_get_site_from_file($domain) {
  $result = 0;

  // This function does not seem to be used. Issues with the sites.json in here
  // is not handled.
  if ($map = gardens_site_data_load_file()) {
    if (!empty($map['sites'][$domain])) {
      $result = gardens_site_data_build_data($map['sites'][$domain], $map);
    }
  }
  return $result;
}