Currently there is a template for settings.php but it would be better and more flexible to dynamically generate this in the same way we generate the drush aliases file. This would be more flexibele if had a set of defaults that could be extended and if we generated

  1. ini_sets
  2. conf variable
  3. database variable
  4. current environment variable
  5. an array of `require()`'s (used for including a site-settings.php file if one exists)

Comments

tizzo’s picture

Category: bug » task

Didn't mean to mark this as a bug report, it's really a task.

greg.1.anderson’s picture

If you want to generate settings.php from scratch, see #1368242: drush generate-profile. It contains a fairly slick set of routines for programatically describing data structures, and then emitting them to a file (like Drupal render arrays for .info files, et.al.). This could be applied to the settings.php file as well. I am planning on getting back to this, and hope to get it committed to Drush core soon.

See also related issue #1331924: Setting certain configuration values in settings.php (e.g. conf=1) can make Site-install fail. Skip the part at the top, start reading at #12.

tizzo’s picture

Version: » 7.x-1.x-dev
Issue summary: View changes
Status: Active » Fixed

Given that the issue greg mentions seems to have died with the move to github, I recreated this functionality in fetcher.

greg.1.anderson’s picture

Sorry, I did not intend #2 to come off as "don't do it"; rather, I merely wanted to point out some resources I thought might be useful to you. Might have been helpful to fetcher if Drush had put something into site-install to support this, but #1331924: Setting certain configuration values in settings.php (e.g. conf=1) can make Site-install fail was marked "won't fix" for reasons unrelated to the move to github.

I might return to #1368242: drush generate-profile someday, but at the moment I am more interested in seeing if we can replace drush make with composer; c.f. Command ecosystem. This discussion is still in its early stages.

In any event, it's good that fetcher has this capability now; this tool provides a useful service. Thanks for maintaining it.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.