8000 Adds deprecation for non-string env values. by dbrumann · Pull Request #11311 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Adds deprecation for non-string env values. #11311

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 2 commits into from
Apr 6, 2019
Merged
Changes from 1 commit
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
Prev Previous commit
Made the deprecation notice more concise
  • Loading branch information
javiereguiluz authored Apr 6, 2019
commit 77f390b70db68c0ac3a6e301c2c237ad237c8a19
31 changes: 5 additions & 26 deletions configuration/environment_variables.rst
8000
Original file line number Diff line number Diff line change
Expand Up @@ -99,32 +99,9 @@ whenever the corresponding environment variable is *not* found:

.. deprecated:: 4.3

Passing non-string values as default values for environment variables is no longer supported. Any non-string value,
e.g. an integer or float must be passed as string.

.. code-block:: yaml

# config/services.yaml
parameters:
env(DATABASE_PORT): '3306'

.. code-block:: xml

<!-- config/services.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd">

<parameters>
<parameter key="env(DATABASE_PORT)">3306</parameter>
</parameters>
</container>

.. code-block:: php

// config/services.php
$container->setParameter('env(DATABASE_PORT)', '3306');
Passing non-string values as default values for environment variables is
deprecated since Symfony 4.3. Use :ref:`environment variable processors <env-var-processors>`
if you need to transform those string default values into other data types.

.. _configuration-env-var-in-prod:

Expand Down Expand Up @@ -161,6 +138,8 @@ the following:
:doc:`Symfony profiler </profiler>`. In practice this shouldn't be a
problem because the web profiler must **never** be enabled in production.

.. _env-var-processors:

Environment Variable Processors
-------------------------------

Expand Down
0