|
4 | 4 | How to Set External Parameters in the Service Container
|
5 | 5 | =======================================================
|
6 | 6 |
|
7 |
| -In the chapter :doc:`/cookbook/configuration/environments`, you learned how |
8 |
| -to manage your application configuration. At times, it may benefit your application |
| 7 | +In the chapter :doc:`/cookbook/configuration/environments`, you learned how |
| 8 | +to manage your application configuration. At times, it may benefit your application |
9 | 9 | to store certain credentials outside of your project code. Database configuration
|
10 | 10 | is one such example. The flexibility of the symfony service container allows
|
11 | 11 | you to easily do this.
|
@@ -38,16 +38,16 @@ the following ``VirtualHost`` configuration:
|
38 | 38 |
|
39 | 39 | .. note::
|
40 | 40 |
|
41 |
| - The example above is for an Apache configuration, using the `SetEnv`_ |
| 41 | + The example above is for an Apache configuration, using the `SetEnv`_ |
42 | 42 | directive. However, this will work for any web server which supports
|
43 | 43 | the setting of environment variables.
|
44 |
| - |
| 44 | + |
45 | 45 | Also, in order for your console to work (which does not use Apache),
|
46 | 46 | you must export these as shell variables. On a Unix system, you can run
|
47 | 47 | the following:
|
48 |
| - |
| 48 | + |
49 | 49 | .. code-block:: bash
|
50 |
| - |
| 50 | +
|
51 | 51 | $ export SYMFONY__DATABASE__USER=user
|
52 | 52 | $ export SYMFONY__DATABASE__PASSWORD=secret
|
53 | 53 |
|
@@ -116,18 +116,18 @@ key, and define the type as ``constant``.
|
116 | 116 |
|
117 | 117 | This only works for XML configuration. If you're *not* using XML, simply
|
118 | 118 | import an XML file to take advantage of this functionality:
|
119 |
| - |
| 119 | + |
120 | 120 | .. code-block:: yaml
|
121 |
| - |
122 |
| - // app/config/config.yml |
| 121 | +
|
| 122 | + # app/config/config.yml |
123 | 123 | imports:
|
124 | 124 | - { resource: parameters.xml }
|
125 | 125 |
|
126 | 126 | Miscellaneous Configuration
|
127 | 127 | ---------------------------
|
128 | 128 |
|
129 |
| -The ``imports`` directive can be used to pull in parameters stored elsewhere. |
130 |
| -Importing a PHP file gives you the flexibility to add whatever is needed |
| 129 | +The ``imports`` directive can be used to pull in parameters stored elsewhere. |
| 130 | +Importing a PHP file gives you the flexibility to add whatever is needed |
131 | 131 | in the container. The following imports a file named ``parameters.php``.
|
132 | 132 |
|
133 | 133 | .. configuration-block::
|
|
0 commit comments