Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 5c07e0a

Browse files
authored
Fixes #211: Store filepaths intelligently. (#359)
1 parent b48b0c2 commit 5c07e0a

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

template/docroot/sites/default/settings/base.settings.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@
2323
* Cloud Free tier vs Acquia Cloud Professional and Enterprise.
2424
*/
2525
$ah_env = isset($_ENV['AH_SITE_ENVIRONMENT']) ? $_ENV['AH_SITE_ENVIRONMENT'] : NULL;
26+
$ah_group = isset($_ENV['AH_SITE_GROUP']) ? $_ENV['AH_SITE_GROUP'] : NULL;
2627
$is_ah_env = (bool) $ah_env;
2728
$is_ah_prod_env = ($ah_env == 'prod' || $ah_env == '01live');
2829
$is_ah_stage_env = ($ah_env == 'test' || $ah_env == '01test');
2930
$is_ah_dev_cloud = (!empty($_SERVER['HTTP_HOST']) && strstr($_SERVER['HTTP_HOST'], 'devcloud'));
3031
$is_ah_dev_env = (preg_match('/^dev[0-9]*$/', $ah_env) || $ah_env == '01dev');
31-
$is_acsf = (isset($_ENV['AH_SITE_GROUP']) && file_exists("/mnt/files/{$_ENV['AH_SITE_GROUP']}.$ah_env/files-private/sites.json"));
32+
$is_acsf = (!empty($ah_group) && file_exists("/mnt/files/$ah_group.$ah_env/files-private/sites.json"));
33+
$acsf_db_name = $is_acsf ? $GLOBALS['gardens_site_settings']['conf']['acsf_db_name'] : NULL;
3234
$is_local_env = !$is_ah_env;
3335

3436
/**

template/docroot/sites/default/settings/filesystem.settings.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77

88
$settings['file_public_path'] = 'sites/default/files';
99

10-
/**
11-
* Acquia cloud file paths.
12-
*/
13-
if ($is_ah_env) {
10+
// ACSF file paths.
11+
if ($is_acsf) {
12+
$settings['file_private_path'] = "/mnt/gfs/$ah_group.$ah_env/files-private/$acsf_db_name";
13+
}
14+
// Acquia cloud file paths.
15+
elseif ($is_ah_env) {
1416
$config['system.file']['path']['temporary'] = '/mnt/tmp/' . $_ENV['AH_SITE_NAME'];
15-
$settings['file_private_path'] = '/mnt/files/' . $_ENV['AH_SITE_NAME'] . '/files-private';
17+
$settings['file_private_path'] = "/mnt/files/$ah_group.$ah_env/files-private";
1618
}

0 commit comments

Comments
 (0)