You are here

function gardens_site_data_build_data in Acquia Cloud Site Factory Connector 8.2

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

Returns the data structure for a single site.

Parameters

array $site: An array of information about a specific site, containing keys including 'conf', 'flags', 'name' etc.

array $map: An array containing global information that applies to all sites (site, env, memcache_inc).

Return value

array A data structure containing information about a single site.

4 calls to gardens_site_data_build_data()
gardens_site_data_from_multi_site_config in acsf_init/lib/sites/g/sites.inc
Returns data for the specified domains using hosting's php interface.
gardens_site_data_get_site_from_file in acsf_init/lib/sites/g/sites.inc
Parses the entire JSON sites file and returns a result for a single domain.
gardens_site_data_refresh_all in acsf_init/lib/sites/g/sites.inc
Fully refreshes the APC cached site/domain data, rewriting every key.
gardens_site_data_refresh_domains in acsf_init/lib/sites/g/sites.inc
Returns data for the specified domains directly from the JSON file.

File

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

Code

function gardens_site_data_build_data(array $site, array $map) {
  $db_name = $site['conf']['acsf_db_name'];
  $private_files_directory = gardens_site_data_get_private_files_directory($db_name);
  $public_files_directory = gardens_site_data_get_public_files_directory($db_name);
  return [
    'dir' => "g/files/{$site['name']}",
    // Put some settings into a global used in settings.php.
    'gardens_site_settings' => [
      'site' => $map['cloud']['site'],
      'env' => $map['cloud']['env'],
      'memcache_inc' => !empty($map["memcache_inc"]) ? $map["memcache_inc"] : '',
      'flags' => !empty($site['flags']) ? $site['flags'] : [],
      'conf' => !empty($site['conf']) ? $site['conf'] : [],
      'file_private_path' => file_exists($private_files_directory) ? $private_files_directory : NULL,
      'file_public_path' => file_exists($public_files_directory) ? $public_files_directory : NULL,
    ],
  ];
}