Skip to content

Make all scalar config values configurable through environment variables #1784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2025
Merged

Make all scalar config values configurable through environment variables #1784

merged 1 commit into from
Apr 25, 2025

Conversation

wimski
Copy link
Contributor

@wimski wimski commented Apr 25, 2025

This PR makes all scalar values in config/debugbar.php configurable through environment variables. The original values are kept as defaults to be backwards-compatible. The naming of the environment variables always follows these rules:

  • start with the package name
  • use exact keys, including nesting
  • use _ as separator between parts
  • uppercase all

This feature makes it easy to configure the debug bar for specific debugging situations, without having to make actual changes to the config file.

@barryvdh
Copy link
Owner

I guess okay but feels a bit 'overkill' maybe?

@wimski
Copy link
Contributor Author

wimski commented Apr 25, 2025

Not everybody is going to use this, but it shouldn't get in the way if you don't.

I usually configure the debug bar for specific cases by disabling unwanted features (removing clutter) and tweaking settings for the specific area I'm debugging. And developers within a team might have a preference for different default settings. This update makes it easy to configure per such 'environment'.

You could also publish the config, change the values there and add the file to the .gitignore, but that removes the option to have shared defaults on a project level. And it feels a bit weird/dirty to ignore a (explicitly) published config file.

@barryvdh barryvdh merged commit 0cd8c86 into barryvdh:master Apr 25, 2025
27 checks passed
@wimski wimski deleted the feature/config-env branch April 25, 2025 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants