Skip to content

Commit

Permalink
Allow hash_salt and file paths to be taken from ENV or env.settings.p…
Browse files Browse the repository at this point in the history
…hp files before default values.
  • Loading branch information
back-2-95 committed Feb 18, 2020
1 parent 30629a7 commit e6eac72
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/DrupalEnvDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,20 +160,20 @@ private function setGlobalDefaults() {
$this->settings['config_sync_directory'] = '../' . self::CMI_PATH;

// Hash salt.
$this->settings['hash_salt'] = getenv('DRUPAL_HASH_SALT') ?: '0000000000000000';
$this->settings['hash_salt'] = getenv('DRUPAL_HASH_SALT') ?: $this->settings['hash_salt'] ?? '0000000000000000';

// Public files path.
$this->settings['file_public_path'] = 'sites/default/files';
$this->settings['file_public_path'] = $this->settings['file_public_path'] ?? 'sites/default/files';

// Private files path.
$this->settings['file_private_path'] = getenv('DRUPAL_FILES_PRIVATE') ?: FALSE;
$this->settings['file_private_path'] = getenv('DRUPAL_FILES_PRIVATE') ?: $this->settings['file_private_path'] ?? FALSE;

// Temp path.
$this->settings['file_temp_path'] = getenv('DRUPAL_TMP_PATH') ?: $this->settings['file_temp_path'] ?? '/tmp';

if ($older_than_88) {
$this->config['system.file']['path']['temporary'] = getenv('DRUPAL_TMP_PATH') ?: '/tmp';
$this->config['system.file']['path']['temporary'] = $this->settings['file_temp_path'];
}

$this->settings['file_temp_path'] = getenv('DRUPAL_TMP_PATH') ?: '/tmp';
}

/**
Expand Down

0 comments on commit e6eac72

Please sign in to comment.