Problem/Motivation
There are several useful developer tools and tricks that people who are "in the know" know about, and others do not. We should make them more discoverable.
Proposed resolution
a) Add documentation to default.settings.php about the location of the developer-oriented example.settings.local.php file that is one directory up and that people do not notice is there. Right now it just says:
/**
* Load local development override configuration, if available.
*
* Use settings.local.php to override variables on secondary (staging,
* development, etc) installations of this site. Typically used to disable
* caching, JavaScript/CSS compression, re-routing of outgoing emails, and
* other things that should not happen on development and testing sites.
*
* Keep this code block at the end of this file to take full effect.
*/
# if (file_exists(__DIR__ . '/settings.local.php')) {
# include __DIR__ . '/settings.local.php';
# }
which implies that the file should be in the sites/default directory, and there is no mention of the sample file at all.
b) Write a landing-page topic for api.drupal.org telling about this file and any other useful tips we can think of, and development tools.
Some things to list:
- drush cr / rebuild.php
- this sites/example.settings.local.php file
- phpStorm
Remaining tasks
Make a patch.
User interface changes
None.
API changes
None.
Data model changes
None.
Comments
Comment #1
jhodgdonComment #2
chx commentedI said several times that minimal should ship with
$config['system.logging']['error_level'] = 'verbose';Comment #3
dawehner#2313059: Add a link to the error settings form on "website encounted an error" message is an issue which dramatically can help here as it will show an actual helpful message, if possible.
I could agree more. Hiding for example notices and log them instead, is a pain in the ass. I would assume logging them while being hidden
has the potential to slow things down actually quite a lot.
Comment #4
jhodgdonI wonder if we should rename the example.settings.local.php to developer.settings.local.php or something like that? It's all developer stuff.
See also #2321407: Suggested setting in example.settings.local.php for render doesn't work in install
Comment #5
pwolanin commentedSo, I think the idea is that core should default to a "production" mode since too many people don't know how to move out of a developer mode or never look.
Still, I think naming the file as jhodgdon suggests with some pre-baked settings would be very helpful - I'm certainly bit by the error reporting every time I reinstall
Comment #6
jhodgdonCould we also default to having the local file stuff at the end of settings.php uncommented? I mean, it already has:
So it would definitely work ... I guess there is a small cost associated with checking file_exists on every page load but it sure is annoying to have to have to either uncomment this every time you copy default.settings.php to settings.php to reinstall, or to have to stash default.settings.php every time you pull.
Maybe we should also include instructions on how to reinstall...
Comment #7
pwolanin commentedMaybe a drush flag to uncomment this and populate the developer one if absent?
Comment #8
davidhernandezI was thinking the same thing. I would love a drush command. "drush setup-all-this-stuff-for-me"
Comment #9
tim.plunkettComment #10
chx commentedThey will install standard.
Comment #11
moshe weitzman commentedDon't try to rename the local file in this issue please. It got bikeshed a lot in the prior issue.
Comment #12
jhodgdonOK, but it's one level up from the default.settings.php file, so it is, in my experience anyway, not "discoverable". At least, I didn't know it existed until this week when someone pointed it out in IRC. Would moving it into the sites/default directory be a bikeshedding problem? It has to live in the same directory as settings.php eventually, so that would seem to be a better spot for it.
Comment #13
clemens.tolboomGreat we have a developer oriented settings file.
The location
sites/example.settings.local.phpis not the expected one. I did not discover it either? @moshe weitzman what was the prior 'bikeshed' issue #?I disagree with "Local development override configuration feature" as the file is supposed to get into the git as mentioned in #6.
What are the reasons to places site related stuff out of default?
Comment #14
moshe weitzman commentedThat was #2226761: Change all default settings and config to fast/safe production values.
Comment #15
chx commented@moshe weitzman, please answer jhodgdon's question and unblock this issue:
Comment #16
moshe weitzman commentedMoving the file to sites/default would be fine, I think.
Comment #18
mortendk commentedi know theres a few themers as well who really would like to know when we make the site explode when we accedently forgets to do close
{% endif %}so i guess the only way is to drop in$config['system.logging']['error_level'] = 'verbose';in our local enviroment ?... asking for a friend offcourse ;)
Comment #19
mortendk commentedi know theres a few themers as well who really would like to know when we make the site explode when we accedently forgets to do close
{% endif %}so i guess the only way is to drop in$config['system.logging']['error_level'] = 'verbose';in our local enviroment ?... asking for a friend offcourse ;)
Comment #20
moshe weitzman commentedNo activity. Please reopen if you have a concrete suggestion.
Comment #21
jhodgdonThere are two concrete suggestions already in the issue summary. Just because no one has made a patch is not a great reason to close an issue.
Anyway, I've added a properly templated summary, and edited it to remove the objection that was raised earlier about moving the local settings example file elsewhere or renaming it. But still, at least some people don't find it (myself and one other commenter), so it would be helpful if we had a pointer to it.
Comment #26
wdev commentedOn a development site I would suggest uncommenting the following lines in the settings.php file. emacs sites/default/settings.php
if (file_exists(__DIR__ . '/settings.local.php')) {
include __DIR__ . '/settings.local.php';
}
and then copying the file example.settings.local.php from /sites folder to /sites/default folder and rename it to settings.local.php
cp sites/example.settings.local.php sites/default/settings.local.php
In addition to adding the following setting
$config['system.logging']['error_level'] = 'verbose';
it also adds a few other settings which will help you in debugging and making development easier. If you don't want any of them in particular, you can always comment them out.
Comment #35
quietone commentedSuggesting a new title that tells the reader what is being added. Because I didn't know what 'tricks' meant here.