Skip to content
Merged
Show file tree
Hide file tree
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
22 changes: 1 addition & 21 deletions bundles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ of the bundle. Now that you've created the bundle, enable it::

And while it doesn't do anything yet, AcmeBlogBundle is now ready to be used.

.. _bundles-legacy-directory-structure:
.. _bundles-directory-structure:

Bundle Directory Structure
Expand Down Expand Up @@ -121,26 +122,6 @@ to be adjusted if needed:
``translations/``
Holds translations organized by domain and locale (e.g. ``AcmeBlogBundle.en.xlf``).

.. _bundles-legacy-directory-structure:

.. warning::

The recommended bundle structure was changed in Symfony 5, read the
`Symfony 4.4 bundle documentation`_ for information about the old
structure.

When using the new ``AbstractBundle`` class, the bundle defaults to the
new structure. Override the ``Bundle::getPath()`` method to change to
the old structure::

class AcmeBlogBundle extends AbstractBundle
{
public function getPath(): string
{
return __DIR__;
}
}

.. tip::

It's recommended to use the `PSR-4`_ autoload standard on your bundle's
Expand Down Expand Up @@ -247,5 +228,4 @@ Learn more
* :doc:`/bundles/prepend_extension`

.. _`third-party bundles`: https://github.com/search?q=topic%3Asymfony-bundle&type=Repositories
.. _`Symfony 4.4 bundle documentation`: https://symfony.com/doc/4.4/bundles.html#bundle-directory-structure
.. _`PSR-4`: https://www.php-fig.org/psr/psr-4/
13 changes: 6 additions & 7 deletions setup/flex.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
Upgrading Existing Applications to Symfony Flex
===============================================

Using Symfony Flex is optional, even in Symfony 4, where Flex is used by
default. However, Flex is so convenient and improves your productivity so much
that it's strongly recommended to upgrade your existing applications to it.
Symfony Flex is optional, but it's so convenient and improves your productivity
so much that it's strongly recommended to use it in all your applications.

Symfony Flex recommends that applications use the following directory structure,
which is the same used by default in Symfony 4, but you can
which is the same used by default in Symfony, but you can
:ref:`customize some directories <flex-customize-paths>`:

.. code-block:: text
Expand Down Expand Up @@ -42,9 +41,9 @@ manual steps:

$ composer require symfony/flex

#. If the project's ``composer.json`` file contains ``symfony/symfony`` dependency,
it still depends on the Symfony Standard Edition, which is no longer available
in Symfony 4. First, remove this dependency:
#. If the project's ``composer.json`` file contains the ``symfony/symfony`` dependency,
it still depends on the legacy Symfony Standard Edition, which is no longer available.
First, remove this dependency:

.. code-block:: terminal

Expand Down