@@ -53,8 +53,8 @@ Options
53
53
``aliases `` option
54
54
~~~~~~~~~~~~~~~~~~
55
55
56
- This option (not available in the ``recipes-contrib `` repository) defines one or
57
- more alternative names that can be used to install the dependency.
56
+ This option (not available in the ``recipes-contrib `` repository) defines one or
57
+ more alternative names that can be used to install the dependency.
58
58
Its value is an array of strings. For example, if a dependency
59
59
is published as ``acme-inc/acme-log-monolog-handler ``, it can define one or
60
60
more aliases to make it easier to install:
@@ -143,11 +143,14 @@ directory of the application:
143
143
}
144
144
}
145
145
146
- The ``%BIN_DIR% `` string is a special value that it's turned into the absolute
147
- path of the binaries directory of the Symfony application. These are the special
148
- variables available: ``%BIN_DIR% ``, ``%CONF_DIR% ``, ``%CONFIG_DIR% ``, ``%SRC_DIR% ``
149
- ``%VAR_DIR% `` and ``%PUBLIC_DIR% ``. You can also access to any variable defined in
150
- the ``extra `` section of your ``composer.json `` file:
146
+ The ``%BIN_DIR% `` string is a placeholder that, when installing the recipe, is
147
+ turned into the absolute path of the binaries directory of the Symfony app.
148
+ These are the available placeholders: ``%BIN_DIR% ``, ``%CONF_DIR% ``,
149
+ ``%CONFIG_DIR% ``, ``%SRC_DIR% `` ``%VAR_DIR% `` and ``%PUBLIC_DIR% ``.
150
+
151
+ Recipes must use these placeholders instead of hardcoding the paths to be truly
152
+ reusable. The placeholder values can be overridden in the ``extra `` section of
153
+ your ``composer.json `` file (where you can define your own placeholders too):
151
154
152
155
.. code-block :: json
153
156
@@ -156,12 +159,19 @@ the ``extra`` section of your ``composer.json`` file:
156
159
"..." : " ..." ,
157
160
158
161
"extra" : {
162
+ // overriding the value of the default placeholders
163
+ "bin-dir" : " bin/" ,
164
+ "config-dir" : " config/" ,
165
+ "src-dir" : " src/" ,
166
+ "var-dir" : " var/" ,
167
+ "public-dir" : " public/" ,
168
+
169
+ // defining a custom placeholder (can be accessed using
170
+ // %MY_SPECIAL_DIR% in the recipe)
159
171
"my-special-dir" : " ..."
160
172
}
161
173
}
162
174
163
- Now you can use ``%MY_SPECIAL_DIR% `` in your recipes.
164
-
165
175
``copy-from-recipe `` Configurator
166
176
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
167
177
0 commit comments