Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge develop into main #30

Merged
merged 52 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
2fcb11e
ACMS-1866: Supports PHP 8.2.
vishalkhode1 Jun 26, 2023
c9291ab
ACMS-1866: Code cleanup & fixed PHPCS issue.
vishalkhode1 Jun 26, 2023
e316649
Merge pull request #10 from acquia/ACMS-1866
vishalkhode1 Jun 26, 2023
395e3a2
ACMS-1934: Remove drupal/config_sync_without_site_uuid plugin.
rajeshreeputra Aug 16, 2023
7852629
ACMS-1935: Add acquia/memcache-settings plugin.
rajeshreeputra Aug 16, 2023
be38e49
Merge pull request #11 from acquia/ACMS-1934
vishalkhode1 Aug 18, 2023
5733b3c
ACMS-1935: Remove acquia/memcache-settings.
rajeshreeputra Aug 18, 2023
e9b79e9
Merge pull request #12 from acquia/ACMS-1935
vishalkhode1 Aug 18, 2023
2fe2ebb
ACMS-1933: Revisit dependencies for drupal-recommended-settings plugin.
deepakmishra2 Aug 24, 2023
d617c21
ACMS-1933: Remove lock file.
chandan-singh7929 Aug 29, 2023
8334eac
ACMS-1933: downgrade require dependency to work for PHP7.4.
deepakmishra2 Aug 30, 2023
2ed9479
ACMS-1933: checking if we can drop 4.4 support.
deepakmishra2 Aug 30, 2023
9410763
Merge pull request #13 from acquia/ACMS-1933
chandan-singh7929 Aug 30, 2023
122f0f6
ACMS-3281: Add CI.
rajeshreeputra Nov 14, 2023
c472ba3
Merge pull request #18 from acquia/ACMS-3281-ci-branch
vishalkhode1 Nov 15, 2023
a61b963
Update acquia/coding-standards requirement from ^1.0 to ^2.0
dependabot[bot] Nov 15, 2023
308d931
Merge pull request #19 from acquia/dependabot/composer/develop/acquia…
vishalkhode1 Nov 15, 2023
2afeda3
Merge branch 'main' into develop
vishalkhode1 Nov 21, 2023
1d2458e
ACMS-000: Refactor code.
vishalkhode1 Nov 1, 2023
8ea2bbb
ACMS-000: Minor issues fixed and better error handling.
vishalkhode1 Nov 6, 2023
16d8809
ACMS-1951: Updated config_sync & site_studio_sync directory path.
vishalkhode1 Nov 6, 2023
6f069b7
ACMS-3281: PHPCS fixes.
rajeshreeputra Nov 10, 2023
7653984
ACMS-3281: Add PHPUnit tests.
rajeshreeputra Nov 10, 2023
23556d7
ACMS-3281: Update Readme and review feedback updates.
rajeshreeputra Nov 14, 2023
03ddd55
ACMS-3281: Run phpunit tests
rajeshreeputra Nov 20, 2023
7a3887f
ACMS-000: Fixed conflicts and minor changes.
vishalkhode1 Nov 21, 2023
22c4638
ACMS-000: Fixed PHPCS issues.
vishalkhode1 Nov 21, 2023
a1fd67d
ACMS-000: Updated composer dependencies.
vishalkhode1 Nov 21, 2023
30242a0
ACMS-000: Fixed failing PHPUnit tests.
vishalkhode1 Nov 21, 2023
b097f4d
ACMS-000: Updated README.md.
vishalkhode1 Nov 21, 2023
61381a8
Merge pull request #22 from acquia/ACMS-minor-fixes
vishalkhode1 Nov 21, 2023
f170762
ACMS-000: Remove symfony/yaml dependency as it's already required by …
vishalkhode1 Nov 21, 2023
2b890e5
ACMS-000: Minor issue fixed.
vishalkhode1 Nov 21, 2023
3bdd688
Merge pull request #15 from acquia/refactor-code
vishalkhode1 Nov 21, 2023
370d423
Update dealerdirect/phpcodesniffer-composer-installer requirement
dependabot[bot] Nov 21, 2023
1fdf9b1
Update phpro/grumphp-shim requirement from ^1.5 to ^2.2
dependabot[bot] Nov 22, 2023
435e275
ACMS-1826: Add Acquia global commands in DRS.
rajeshreeputra Nov 10, 2023
7418df5
Merge pull request #17 from acquia/ACMS-1826
vishalkhode1 Nov 22, 2023
def8a95
Merge pull request #21 from acquia/dependabot/composer/develop/dealer…
vishalkhode1 Nov 29, 2023
9ab9562
Merge pull request #24 from acquia/dependabot/composer/develop/phpro/…
vishalkhode1 Nov 29, 2023
3774fa4
ACMS-1896: fix drs deprectaion.
deepakmishra2 Dec 28, 2023
ea351d1
Merge pull request #25 from acquia/ACMS-1896
vishalkhode1 Jan 3, 2024
24b5831
ACMS-3462: update Acquia Global Command to ACMS-3462.
rajeshreeputra Jan 4, 2024
cf381e6
ACMS-3462: Update files-private path.
rajeshreeputra Jan 4, 2024
a38526d
ACMS-3462: Update acquia global commands to dev-develop.
rajeshreeputra Jan 11, 2024
8b62680
Merge pull request #26 from acquia/ACMS-3462
vishalkhode1 Jan 11, 2024
18f9c5b
ACMS-000: Remove global drush command.
vishalkhode1 Jan 16, 2024
81e1c02
ACMS-000: Add the Multisite global drush command.
vishalkhode1 Jan 16, 2024
dd0bcf8
Merge pull request #29 from acquia/testing
vishalkhode1 Jan 17, 2024
74f3c36
ACMS-3478: Update README.md file.
apathak18 Jan 10, 2024
01b51ac
ACMS-3478: Updated README.md file.
vishalkhode1 Jan 17, 2024
5c06103
Merge pull request #27 from acquia/ACMS-3478
vishalkhode1 Jan 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "daily"
# Use Indian Standard Time (UTC +05:30)
timezone: "Asia/Kolkata"
time: "09:00"
# Raise pull requests for version updates
# to pip against the `develop` branch
target-branch: "develop"
77 changes: 77 additions & 0 deletions .github/workflows/drs_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: drupal-recommended-settings CI
on:
# schedule:
# "At minute 0 past hour 4 and 8 UTC."
# - cron: '0 4,8 * * *'
push:
branches: [ develop, main, ACMS* ]
paths-ignore:
- README.md
pull_request:
branches: [ develop ]
paths-ignore:
- README.md
env:
ORCA_SUT_NAME: acquia/drupal-recommended-settings
ORCA_SUT_BRANCH: develop
ORCA_VERSION: ^4
ORCA_PACKAGES_CONFIG_ALTER: ../drupal-recommended-settings/tests/packages_alter.yml
ORCA_ENABLE_NIGHTWATCH: "FALSE"
ORCA_PHPCS_STANDARD: AcquiaPHP
COMPOSER_PROCESS_TIMEOUT: 1800
jobs:
STATIC_CODE_ANALYSIS:
name: "Static Code Analysis"
runs-on: ubuntu-latest
env:
ORCA_JOB: STATIC_CODE_ANALYSIS
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
php-version: 8.2
coverage: xdebug
- name: Download ORCA
run: composer create-project --no-dev --ignore-platform-req=php acquia/orca ../orca "$ORCA_VERSION" -n
- name: Before Install
run: ../orca/bin/ci/before_install.sh
- name: Install
run: ../orca/bin/ci/install.sh
- name: Before script
run: ../orca/bin/ci/before_script.sh
- name: Script
run: ../orca/bin/ci/script.sh
- name: After script
run: |
../orca/bin/ci/after_success.sh
../orca/bin/ci/after_failure.sh
../orca/bin/ci/after_script.sh
PHPUNIT_TESTS:
name: "Execute PHPUnit tests"
runs-on: ubuntu-latest
env:
ORCA_FIXTURE_DIR: "/home/runner/work/drupal-recommended-settings/orca-build"
CI: TRUE
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
php-version: 8.2
coverage: xdebug
- name: Download ORCA
run: composer create-project --no-dev --ignore-platform-req=php acquia/orca ../orca "$ORCA_VERSION" -n
- name: Before Install
run: ../orca/bin/ci/before_install.sh
- name: Install
run: ../orca/bin/ci/install.sh
- name: Before script
run: ../orca/bin/ci/before_script.sh
- name: Run PHPUnit tests
run: |
composer install
./vendor/bin/phpunit tests
- name: After script
run: |
../orca/bin/ci/after_success.sh
../orca/bin/ci/after_failure.sh
../orca/bin/ci/after_script.sh
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
vendor
.idea/
.DS_Store
composer.lock
116 changes: 82 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,108 @@
# 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
- configuration sync directory path.
- public/private etc. file directory path.
- The required database credentials.
- Configuration sync directory path.
- File directory path i.e public/private etc.
- 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

You can also install this using Composer like so:
### Install using Composer

```
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.

- Remove BLT plugin using below command
### Multi-site features with Acquia DRS
The Drupal Recommended Settings offer the multi-site feature out of the box.
To configure a multi-site, run the following command, and the plugin will
automatically generate the settings.php in the backend.
```
composer remove acquia/blt
drush site:install --uri site1
```

- Remove BLT reference from settings.php file located at
``/docroot/sites/default/settings.php``.
```php
require DRUPAL_ROOT . "/../vendor/acquia/blt/settings/blt.settings.php";
The plugin offers various events that allow you to implement custom logic based
on when these events are triggered. You can find the examples of such
implementations from [here](examples).

# Quick examples
## Generate settings for a given site
```
<?php

/**
* IMPORTANT.
*
* Do not include additional settings here. Instead, add them to settings
* included by `blt.settings.php`. See BLT's documentation for more detail.
*
* @link https://docs.acquia.com/blt/
* @file
* Include DRS settings.
*/
```

- Require Acquia Drupal Recommended Settings plugin using
use Acquia\Drupal\RecommendedSettings\Exceptions\SettingsException;
use Acquia\Drupal\RecommendedSettings\Settings;

// Create settings object.
$siteUri = "site1";
$settings = new Settings(DRUPAL_ROOT, $siteUri);

try {
// Call generate method.
$settings->generate();
}
catch (SettingsException $e) {
echo $e->getMessage();
}
```
composer require acquia/drupal-recommended-settings

## Generate settings for a given site passing database credentials

```

- 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;
+ use Acquia\Drupal\RecommendedSettings\Helpers\EnvironmentDetector;
<?php

/**
* @file
* Include DRS settings.
*/

use Acquia\Drupal\RecommendedSettings\Exceptions\SettingsException;
use Acquia\Drupal\RecommendedSettings\Settings;

// Create settings object.
$siteUri = "site1";
$settings = new Settings(DRUPAL_ROOT, $siteUri);

// Database details.
$dbSpec = [
'drupal' => [
'db' => [
'database' => 'drupal', // In case of multi-site database name is replaced with the site name.
'username' => 'drupal',
'password' => 'drupal',
'host' => 'localhost',
'port' => '3306',
],
],
];

try {
// Call generate method passing database details.
$settings->generate($dbSpec);
}
catch (SettingsException $e) {
echo $e->getMessage();
}
```

# License

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.
57 changes: 28 additions & 29 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,50 @@
{
"name": "acquia/drupal-recommended-settings",
"type": "composer-plugin",
"description": "The composer plugin for adding drupal-recommended-settings for Acquia Cloud.",
"license": "GPL-2.0-only",
"type": "composer-plugin",
"keywords": [
"drupal",
"acquia",
"drupal-recommended-settings"
],
"license": "GPL-2.0-only",
"authors": [
{
"name": "Vishal Khode",
"email": "[email protected]"
}
],
"support": {
"issues": "https://github.com/acquia/drupal-recommended-settings/issues",
"docs": "https://docs.acquia.com/drupal-recommended-settings/"
},
"require": {
"php": ">=7.4",
"php": ">=8.1",
"composer-plugin-api": "^2",
"acquia/drupal-environment-detector": "^1.5.3",
"composer/composer": "^2.5",
"consolidation/config": "^1.0.0 || ^2.0.0",
"dflydev/dot-access-data": "^1.1.0 || ^2 || ^3",
"drupal/config_sync_without_site_uuid": "^1.0",
"grasmash/yaml-expander": "^3",
"loophp/phposinfo": "^1.7.1",
"symfony/filesystem": "^6.2",
"symfony/yaml": "^4.4 || ^5 || ^6"
},
"conflict": {
"acquia/blt": "*"
"consolidation/config": "^2.0.0",
"grasmash/yaml-expander": "^3.0",
"loophp/phposinfo": "^1.7.1"
},
"require-dev": {
"acquia/coding-standards": "^1.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.2",
"ergebnis/composer-normalize": "~2.15.0",
"phpro/grumphp-shim": "^1.5"
"acquia/coding-standards": "^2.0",
"composer/composer": "^2.2",
"dealerdirect/phpcodesniffer-composer-installer": "^1.0.0",
"ergebnis/composer-normalize": "^2.30.2",
"phpro/grumphp-shim": "^2.2",
"phpunit/phpunit": "^9 || ^10"
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-4": {
"Acquia\\Drupal\\RecommendedSettings\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Acquia\\Drupal\\RecommendedSettings\\Tests\\": "tests/src"
}
},
"config": {
"allow-plugins": {
Expand All @@ -45,16 +55,5 @@
},
"extra": {
"class": "Acquia\\Drupal\\RecommendedSettings\\Plugin"
},
"autoload": {
"psr-4": {
"Acquia\\Drupal\\RecommendedSettings\\": "src/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"support": {
"issues": "https://github.com/acquia/drupal-recommended-settings/issues",
"docs": "https://docs.acquia.com/drupal-recommended-settings/"
}
}
Loading