Skip to content

Commit

Permalink
Add settings file path
Browse files Browse the repository at this point in the history
  • Loading branch information
danepowell committed Feb 20, 2021
1 parent 5278f6f commit 7bd7903
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/FilePaths.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,29 @@
*/
class FilePaths {

/**
* Path to primary site settings file with db, memcache, and other info.
*
* @param string $ah_group
* The Acquia Hosting site group.
* @param string $site_name
* The site name (e.g. `default`).
*
* @return string
* The path to the settings include file.
*/
public static function ahSettingsFile(string $ah_group, string $site_name) {
// The default site uses ah_group-settings.inc.
if ($site_name === 'default') {
$site_name = $ah_group;
}

// Acquia Cloud does not support periods in db names.
$site_name = str_replace('.', '_', $site_name);

return "/var/www/site-php/$ah_group/$site_name-settings.inc";
}

/**
* Path to sites.json on ACSF.
*
Expand All @@ -20,6 +43,7 @@ class FilePaths {
* The Acquia Hosting environment.
*
* @return string
* The path to sites.json.
*/
public static function acsfSitesJson(string $ah_group, string $ah_env) {
return "/mnt/files/$ah_group.$ah_env/files-private/sites.json";
Expand Down

0 comments on commit 7bd7903

Please sign in to comment.