Skip to content

docs(config): add warn about invalid characters in env name #20875

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

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,13 @@ going to production:
use `symbolic links`_ between ``config/packages/<environment-name>/``
directories to reuse the same configuration.

.. warning::

Some characters are not allowed in environment name, e.g. the
``-`` character. If you try to use it, it will throw this exception:
The environment "%s" contains invalid characters, it can only contain
characters allowed in PHP class names.
Comment on lines +597 to +602
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not sure we really need to document this — from my point of view, the exception is clear enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason of this PR is that I got surprised that the doc did not mention it, and devs could easily use kebab-case for their environment name (especially on infrastructures they can't use locally).

But I agree, the exception is self-explanatory and devs will face this only once.


Instead of creating new environments, you can use environment variables as
explained in the following section. This way you can use the same application
and environment (e.g. ``prod``) but change its behavior thanks to the
Expand Down
Loading