You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Create project settings file (settings.local.php) during "ddev config" instead of import-db #692
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.
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.
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.
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
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.
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.
Activity
rfay commentedon Feb 28, 2018
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.
mglaman commentedon Feb 28, 2018
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.
rfay commentedon Feb 28, 2018
The problem is that lots of people check in the settings.php, and in that case we have no business touching it.
mglaman commentedon Feb 28, 2018
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.
rfay commentedon Feb 28, 2018
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.
mglaman commentedon Feb 28, 2018
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.
rfay commentedon Feb 28, 2018
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.
[-]When configuring a project, always create a settings file.[/-][+]Create project settings file (settings.local.php) during "ddev config" instead of import-db[/+]rfay commentedon Feb 28, 2018
In this one we'll use the exact same strategy as we were using after import-db, and remove the logic from import-db.
rickmanelius commentedon Feb 28, 2018
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.
rickmanelius commentedon Feb 28, 2018
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.
Merge branch 'master' into ddevgh-692-always-create-settings-file
rickmanelius commentedon Mar 5, 2018
Updated labels, status.
Merge branch 'master' into ddevgh-692-always-create-settings-file