Skip to content

Commit b36de4f

Browse files
author
symfony-flex-server[bot]
authored
Merge pull request #545
2 parents 3fad7b3 + dcd76be commit b36de4f

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

README.rst

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ Options
5353
``aliases`` option
5454
~~~~~~~~~~~~~~~~~~
5555

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.
5858
Its value is an array of strings. For example, if a dependency
5959
is published as ``acme-inc/acme-log-monolog-handler``, it can define one or
6060
more aliases to make it easier to install:
@@ -143,11 +143,14 @@ directory of the application:
143143
}
144144
}
145145
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):
151154

152155
.. code-block:: json
153156
@@ -156,12 +159,19 @@ the ``extra`` section of your ``composer.json`` file:
156159
"...": "...",
157160
158161
"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)
159171
"my-special-dir": "..."
160172
}
161173
}
162174
163-
Now you can use ``%MY_SPECIAL_DIR%`` in your recipes.
164-
165175
``copy-from-recipe`` Configurator
166176
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
167177

0 commit comments

Comments
 (0)