backdrop-contrib / backdrop-drush-extension

A set of commands and boot class for Drush and Backdrop CMS.
GNU General Public License v2.0
13 stars 18 forks source link

Allow `drush site-install` to save db credentials, active/staging config directories, and hash_salt in settings.local.php #246

Open klonos opened 3 years ago

klonos commented 3 years ago

Backdrop core already supports reading configuration from a settings.local.php file (see https://github.com/backdrop/backdrop/blob/1.x/settings.php#L458), although there's no such file shipped with core OOTB - it needs to be created manually.

Drush currently supports this:

drush si standard --db-url=mysql://root:backdrop@localhost/backdrop --site-name="My test site"

Additionally, I would like to be able to do something like this:

drush si standard --db-url=mysql://root:backdrop@localhost/backdrop --site-name="My test site" --settings-path=settings.local.php

This would allow the settings.php file in my local to remain unchanged, so that I do not have to manually exclude it when doing git add (settings.local.php is automatically excluded OOTB: https://github.com/backdrop/backdrop/blob/1.x/.gitignore#L5).

As it is now, I have to:

  1. run drush si -> things get saved into settings.php
  2. manually create a settings.local.php file
  3. manually copy things from settings.php to settings.local.php

Allowing drush si to accept a parameter to specify the settings file would save me the 2 manual steps from the process above.

oadaeh commented 3 years ago

AFAIK, the future of CLI for Backdrop is https://github.com/backdrop-contrib/bee

yorkshire-pudding commented 1 year ago

I'm not sure how drush does the site install, but for bee it uses core/scripts/install.sh which in turn uses core/includes/install.core.inc which has the filename hard-coded in as settings.php.

Without changes to core to support this, I can't see how any CLI using these functions would be able to do this.