Skip to content

Create project settings file (settings.local.php) during "ddev config" instead of import-db #692

Closed

Description

@mglaman

What happened (or feature request):

When I ran ddev config and tried to install Drupal, I had to run ddev describe and copy my database information.

What you expected to happen:

I expected a scaffolded CMS settings file which provided my required configuration.

How to reproduce this:

Run ddev config. The settings.php is only generated if ImportDB is executed.

Version: Please include the output of ddev version, docker version and the project's .ddev/config.yaml.

$ ddev version
commit	v0.14.0                        
domain	ddev.local                     
cli   	v0.14.0                        
web   	drud/nginx-php-fpm-local:v1.0.0
db    	drud/mariadb-local:v0.7.1      
dba   	drud/phpmyadmin:v0.2.0         
router	drud/ddev-router:v0.5.0  

Anything else do we need to know:

Related source links or issues:

This was due to debugging #454 and when working on #691.

Please use a complexity rating of 1-5 (5 is high) for a feature request. (High complexity implies more PR planning)

1

Activity

  1. rfay commented on Feb 28, 2018

    @rfay
    Member

    I like this. Our other tentative approach to solving this problem was #603, removing the creation from import-db and making it standalone. But your approach may be even better.

    There's still the problem that some/many main settings files don't include settings.local.php or the equivalent. I suspect we'll never get past that problem and we'll have to rely on people's knowledge of their CMS behavior.

  2. mglaman commented on Feb 28, 2018

    @mglaman
    ContributorAuthor

    I think the best we can do is prep the created settings.php (and equivalent for the CMS) to load a local file if available if it is present. Then documentation fills the gap.

  3. rfay commented on Feb 28, 2018

    @rfay
    Member

    The problem is that lots of people check in the settings.php, and in that case we have no business touching it.

  4. mglaman commented on Feb 28, 2018

    @mglaman
    ContributorAuthor

    Ah, I see. Yeah. In my tool I created a basic settings.php, but then the local.settings.php had my docker and host config.

  5. rfay commented on Feb 28, 2018

    @rfay
    Member

    That doesn't make any of this invalid. It just means a bit of complexity for some users. The D6 and D7 default settings.php, for example, don't include settings.local.php, and I don't think we're going to be able to solve that.

  6. mglaman commented on Feb 28, 2018

    @mglaman
    ContributorAuthor

    Is there harm in providing an optimized settings.php? I mean Platform.sh does it https://github.com/platformsh/platformsh-example-drupal8/blob/master/web/sites/default/settings.php

    We obvious can't override if it exists. But if it is a new project I don't see the harm in providing one.

  7. rfay commented on Feb 28, 2018

    @rfay
    Member

    Actually, if a settings.php doesn't exist, we write that instead of the settings.local.php. And we hope it's optimized, but there's always more to do.

  8. changed the title [-]When configuring a project, always create a settings file.[/-] [+]Create project settings file (settings.local.php) during "ddev config" instead of import-db[/+] on Feb 28, 2018
  9. rfay commented on Feb 28, 2018

    @rfay
    Member

    In this one we'll use the exact same strategy as we were using after import-db, and remove the logic from import-db.

  10. added this to the v1.0.0 milestone on Feb 28, 2018
  11. rickmanelius commented on Feb 28, 2018

    @rickmanelius
    Contributor

    It should be noted that we recently had a support request in the Drupal #ddev channel from @nerdstein that would have been (likely) solved by already having this in place. We traced it down to the site being in some weird intermediate state where it didn't pick up the install.php page and yet it wasn't a successfully stood up site. If the credentials were in place, it would have at least displayed the DB error and made this easier to debug.

  12. rickmanelius commented on Feb 28, 2018

    @rickmanelius
    Contributor

    Advantages of this approach over existing behavior (create during import-db): better odds at successful first startup, one less thing to do during site install (and sending the end-user off searching for the DB credentials), and DDEV has a better chance at managing the settings file.

  13. added a commit that references this issue on Mar 4, 2018
  14. modified the milestones: v1.0.0, v0.15.0 on Mar 5, 2018
  15. rickmanelius commented on Mar 5, 2018

    @rickmanelius
    Contributor

    Updated labels, status.

  16. added a commit that references this issue on Mar 6, 2018
  17. modified the milestones: v0.15.0, v0.16.0 on Mar 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions