diff --git a/web/sites/default/settings.php b/web/sites/default/settings.php index a85cc129effcd569dc80e5488237bc1baef43295..e98dade78b9b9ce5ec5a65e3fc16216c8ed767fd 100644 --- a/web/sites/default/settings.php +++ b/web/sites/default/settings.php @@ -19,8 +19,31 @@ /** * Place the config directory outside of the Drupal root. */ +if (is_dir($_ENV['HOME'] . '/files/private/config')) { + // error_log("Config sync dir: _ENV[HOME]/files/private/config exists, using this."); + $config_sync_dir = $_ENV['HOME'] . '/files/private/config'; +} +else if(!empty($_ENV['FILEMOUNT'])) { + // error_log("Config sync dir: _ENV[FILEMOUNT] exists, using it."); + $config_sync_dir = DRUPAL_ROOT . '/' . $_ENV['FILEMOUNT'] . '/private/config'; +} +else { + // error_log("Config sync dir: fell through to default."); + $config_sync_dir = DRUPAL_ROOT . '/sites/default/files/private/config'; +} +// error_log("Config sync dir: $config_sync_dir"); + +if(!is_dir($config_sync_dir)) { + error_log("Config sync dir '$config_sync_dir' doesn't exist, attempting to create it."); + if(mkdir($config_sync_dir, 0700, true)) { + error_log("$config_sync_dir created"); + } + else { + error_log("Failed to create $config_sync_dir"); + } +} $config_directories = array( - CONFIG_SYNC_DIRECTORY => $_ENV['HOME'] . '/files/private/config', + CONFIG_SYNC_DIRECTORY => $config_sync_dir, ); /**