Skip to content

Commit

Permalink
Merge pull request #6 from druidfi/bump-up-versions
Browse files Browse the repository at this point in the history
Bump up versions
  • Loading branch information
back-2-95 authored Oct 21, 2021
2 parents 6f0afb8 + ae33066 commit f415d99
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 26 deletions.
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
test:
test: vendor
@echo "Run composer test (all tests)"
@docker run --rm -it --volume $$PWD:/app druidfi/drupal:7.4 composer test
@docker run --rm -it --volume $$PWD:/app druidfi/drupal:php-7.4 composer test

test-%:
test-%: vendor
@echo "Run composer test-$*"
@docker run --rm -it --volume $$PWD:/app druidfi/drupal:7.4 composer test-$*
@docker run --rm -it --volume $$PWD:/app druidfi/drupal:php-7.4 composer test-$*

vendor:
composer install
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ See the whole example [here](settings.php).

## What is detected?

- Loading of setting files and service configurations
- Database connection
- Trusted host pattern(s)
- File paths (public, private, tmp)
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
}
},
"require": {
"php": "^7.1 || ^8.0"
"php": "^7.3 || ^8.0",
"drupal/core-recommended": "^8.9 || ^9.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.17.0",
Expand Down
28 changes: 7 additions & 21 deletions src/DrupalEnvDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ public function __construct($settings_dir) {
*/
public function getConfiguration() : array {
$conf = [
'config' => (array) $this->config,
'databases' => (array) $this->databases,
'settings' => (array) $this->settings,
'config' => $this->config,
'databases' => $this->databases,
'settings' => $this->settings,
];

if (!empty($this->config_directories)) {
$conf['config_directories'] = (array) $this->config_directories;
$conf['config_directories'] = $this->config_directories;
}

if (getenv('OMEN_TOKEN') && isset($_GET['_show_omens'])) {
Expand All @@ -142,8 +142,7 @@ public function getConfiguration() : array {
* Print out configuration.
*/
public function showConfiguration() {
$conf = $this->getConfiguration();
$this->printConfiguration($conf);
$this->printConfiguration($this->getConfiguration());
}

protected function printConfiguration($conf) {
Expand Down Expand Up @@ -184,14 +183,7 @@ private function setEnvDefaults() {
* Set global values. Same for all environments.
*/
private function setGlobalDefaults() {
$older_than_88 = version_compare($this->drupal_version, '8.8.0', '<');

// Set directory for loading CMI configuration.
if ($older_than_88) {
$this->config_directories['sync'] = '../' . self::CMI_PATH;
}

// In Drupal 8.8 this is in $settings array.
$this->settings['config_sync_directory'] = '../' . self::CMI_PATH;

// Hash salt.
Expand All @@ -206,14 +198,8 @@ private function setGlobalDefaults() {
// 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'] = $this->settings['file_temp_path'];
}

// Exclude these modules from configuration export if Drupal 8.8+.
if (!$older_than_88) {
$this->settings['config_exclude_modules'] = ['devel', 'stage_file_proxy'];
}
// Exclude these modules from configuration export.
$this->settings['config_exclude_modules'] = ['devel', 'stage_file_proxy', 'upgrade_status'];
}

/**
Expand Down

0 comments on commit f415d99

Please sign in to comment.