Skip to content

Commit

Permalink
ACMS-3281: PHPCS fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
rajeshreeputra authored and vishalkhode1 committed Nov 21, 2023
1 parent 16d8809 commit 6f069b7
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 19 deletions.
31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Acquia Drupal Recommended Settings
The Acquia Drupal Recommended Settings plugin adds the recommended settings to the Drupal project, so developers won't have to edit settings.php manually.
The Acquia Drupal Recommended Settings plugin adds the recommended settings to
the Drupal project, so developers won't have to edit settings.php manually.

The recommended settings includes:
- the required database credentials
- the required database credentials.
- configuration sync directory path.
- public/private etc. file directory path.
- Acquia site studio sync directory path.
- Includes Drupal module [Config sync without site uuid](https://www.drupal.org/project/config_sync_without_site_uuid) features.

It allows your websites to be easily installed in both Acquia Cloud IDE & local and deployable on Acquia Cloud.
It allows your websites to be easily installed in both Acquia Cloud IDE & local
and deployable on Acquia Cloud.

## Installation

Expand All @@ -18,16 +19,16 @@ You can also install this using Composer like so:
composer require acquia/drupal-recommended-settings
```

## Steps to switch from BLT to Acquia Drupal Recommended Settings
This plugin doesn't work with the acquia/blt plugin. If the plugin exists, it must be removed.
## Steps to use Acquia Drupal Recommended Settings with BLT.
This plugin works with acquia/blt plugin.

- Remove BLT plugin using below command
- Update BLT plugin to latest release.
```
composer remove acquia/blt
composer update acquia/blt -W
```

- Remove BLT reference from settings.php file located at
``/docroot/sites/default/settings.php``.
``/docroot/sites/default/settings.php``.
```php
require DRUPAL_ROOT . "/../vendor/acquia/blt/settings/blt.settings.php";
/**
Expand All @@ -44,7 +45,7 @@ require DRUPAL_ROOT . "/../vendor/acquia/blt/settings/blt.settings.php";
```
composer require acquia/drupal-recommended-settings
```

- Update `default.local.settings.php` and `local.settings.php` to use the Environment Detector provided by this plugin instead of BLT:
```diff
- use Acquia\Blt\Robo\Common\EnvironmentDetector;
Expand All @@ -55,6 +56,12 @@ composer require acquia/drupal-recommended-settings

Copyright (C) 2023 Acquia, Inc.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License version 2 as published by the
Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
3 changes: 0 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@
"ergebnis/composer-normalize": "~2.21.0",
"phpro/grumphp-shim": "^1.5"
},
"conflict": {
"acquia/blt": "*"
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
Expand Down
4 changes: 3 additions & 1 deletion settings/acquia-recommended.settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

/**
* @file
* Setup Acquia Drupal Recommended Settings utility variables, include required files.
* Setup Acquia Drupal Recommended Settings utility variables.
*
* Includes required settings files.
*/

use Acquia\Drupal\RecommendedSettings\Exceptions\SettingsException;
Expand Down
7 changes: 5 additions & 2 deletions settings/global/default.global.settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

/**
* @file
* Generated by Acquia Drupal Recommended Settings. Serves as an example of global includes.
* Generated by Acquia Drupal Recommended Settings.
*
* Serves as an example of global includes.
*/

/**
Expand All @@ -14,7 +16,8 @@
/**
* Include settings files in docroot/sites/settings.
*
* If instead you want to add settings to a specific site, see Acquia Drupal Recommended Settings includes
* If instead you want to add settings to a specific site, see
* Acquia Drupal Recommended Settings includes
* file in docroot/sites/{site-name}/settings/default.includes.settings.php.
*/
$additionalSettingsFiles = [
Expand Down
2 changes: 2 additions & 0 deletions src/Helpers/EnvironmentDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,9 @@ public static function getRepoRoot(): string {
// This is a web or Drush request.
return dirname(DRUPAL_ROOT);
}
// phpcs:ignore
global $repo_root;
// phpcs:enable
return $repo_root;
}

Expand Down
1 change: 0 additions & 1 deletion src/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ public function generate(array $overrideData = []): void {

// The config directory for given site must exists, otherwise Drupal will
// add database credentials to settings.php.
// @todo Using hardcoded sync directory path. Need to better optimise it.
$this->fileSystem->ensureDirectoryExists($this->drupalRoot . "/../config/$site");
}

Expand Down

0 comments on commit 6f069b7

Please sign in to comment.