Skip to content

adding docs about configurable flex paths #11114

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
wants to merge 1 commit into from
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
30 changes: 30 additions & 0 deletions setup/flex.rst
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,36 @@ manual steps:
#. Remove the ``bin/symfony_requirements`` script and if you need a replacement
for it, use the new `Symfony Requirements Checker`_.

Customizing Flex Paths
----------------------

The Flex recipes make a few assumptions about your project's directory structure.
Some of these assumptions can be customized by adding a key under the ``extra``
section of your ``composer.json`` file. For example, to tell Flex to copy any
PHP classes into ``src/App`` instead of ``src``:

.. code-block:: json

{
"...": "...",

"extra": {
"src-dir": "src/App"
}
}

The configurable paths are:

* ``bin-dir``: defaults to ``bin/``
* ``config-dir``: defaults to ``config/``
* ``src-dir`` defaults to ``src/``
* ``var-dir`` defaults to ``var/``
* ``public-dir`` defaults to ``public/``

If you customize these paths, some files copied from a recipe still may contain
references to the original path. In other words: you may need to update some things
manually after a recipe is installed.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should also note that official recipes do not need such extra treatment, because they use %PUBLIC_DIR% placeholder.
We could even mention that cause as advice for creating custom/contributed recipes.

Copy link
Member

Choose a reason for hiding this comment

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

@HeahDude are you saying that using things like %PUBLIC_DIR% is mandatory for official recipes but not for community recipes? Why? It should be mandatory for both, right?

Copy link
Contributor

@HeahDude HeahDude Mar 11, 2019

Choose a reason for hiding this comment

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

are you saying that using things like %PUBLIC_DIR% is mandatory for official recipes but not for community recipes

No I'm not 😅
Just saying that we should document that fact too while documenting contrib recipes here https://github.com/symfony/recipes/blob/master/README.rst#copy-from-recipe-configurator.
It's shown in the example but never really explained.
If we were to do it here I suggest to add a note and even a link to that section.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks. I've created symfony/recipes#545 to better explain this ... but I don't think we should add more links between them. Each repo explains this a bit differently to adapt to their readers.


.. _`Symfony Flex`: https://github.com/symfony/flex
.. _`Symfony Installer`: https://github.com/symfony/symfony-installer
.. _`Symfony Standard Edition`: https://github.com/symfony/symfony-standard
Expand Down