8000 Explain Symfony packs by javiereguiluz · Pull Request #12354 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Explain Symfony packs #12354

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

Merged
merged 1 commit into from
Sep 24, 2019
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
6 changes: 3 additions & 3 deletions best_practices/business-logic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ library or strategy you want for this.
In practice, many Symfony applications rely on the independent
`Doctrine project`_ to define their model using entities and repositories.

Doctrine support is not enabled by default in Symfony. So to use Doctrine
as shown in the examples below you will need to install :doc:`Doctrine ORM support </doctrine>`
by executing the following command:
:doc:`Doctrine </doctrine>` support is not enabled by default in Symfony, so you
must install it first by adding the ``orm`` :ref:`Symfony pack <symfony-packs>`
to your application:

.. code-block:: terminal

Expand Down
8 changes: 4 additions & 4 deletions doctrine.rst
8000
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ Databases are a broad topic, so the documentation is divided in three articles:
Installing Doctrine
-------------------

First, install Doctrine support via the ORM pack, as well as the MakerBundle,
which will help generate some code:
First, install Doctrine support via the ``orm`` :ref:`Symfony pack <symfony-packs>`,
as well as the MakerBundle, which will help generate some code:

.. code-block:: terminal

Expand Down Expand Up @@ -570,8 +570,8 @@ the :ref:`doctrine-queries` section.
If the number of database queries is too high, the icon will turn yellow to
indicate that something may not be correct. Click on the icon to open the
Symfony Profiler and see the exact queries that were executed. If you don't
see the web debug toolbar, try running ``composer require --dev symfony/profiler-pack``
to install it.
see the web debug toolbar, install the ``profiler`` :ref:`Symfony pack <symfony-packs>`
by running this command: ``composer require --dev symfony/profiler-pack``.

Automatically Fetching Objects (ParamConverter)
-----------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion doctrine/dbal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ data manipulations.
Read the official Doctrine `DBAL Documentation`_ to learn all the details
and capabilities of Doctrine's DBAL library.

First, install the Doctrine ORM pack:
First, install the Doctrine ``orm`` :ref:`Symfony pack <symfony-packs>`:

.. code-block:: terminal

Expand Down
5 changes: 3 additions & 2 deletions page_creation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,9 @@ The Web Debug Toolbar: Debugging Dream
--------------------------------------

One of Symfony's *killer* features is the Web Debug Toolbar: a bar that displays
a *huge* amount of debugging information along the bottom of your page while developing. This is all
included out of the box using a package called ``symfony/profiler-pack``.
a *huge* amount of debugging information along the bottom of your page while
developing. This is all included out of the box using a :ref:`Symfony pack <symfony-packs>`
called ``symfony/profiler-pack``.

You will see a black bar along the bottom of the page. You'll learn more about all the information it holds
along the way, but feel free to experiment: hover over and click
Expand Down
2 changes: 1 addition & 1 deletion profiler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Installation
------------

In applications using :ref:`Symfony Flex <symfony-flex>`, run this command to
install the profiler before using it:
install the ``profiler`` :ref:`Symfony pack <symfony-packs>` before using it:

.. code-block:: terminal

Expand Down
6 changes: 3 additions & 3 deletions quick_tour/flex_recipes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ But for a *truly* rich API, try installing `API Platform`_:

$ composer require api

This is an alias to ``api-platform/api-pack``, which has dependencies on several
other packages, like Symfony's Validator and Security components, as well as the Doctrine
ORM. In fact, Flex installed *5* recipes!
This is an alias to ``api-platform/api-pack`` :ref:`Symfony pack <symfony-packs>`,
which has dependencies on several other packages, like Symfony's Validator and
Security components, as well as the Doctrine ORM. In fact, Flex installed *5* recipes!

But like usual, we can immediately start using the new library. Want to create a
rich API for a ``product`` table? Create a ``Product`` entity and give it the
Expand Down
2 changes: 1 addition & 1 deletion serializer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Installation
------------

In applications using :ref:`Symfony Flex <symfony-flex>`, run this command to
install the serializer before using it:
install the ``serializer`` :ref:`Symfony pack <symfony-packs>` before using it:

.. code-block:: terminal

Expand Down
21 changes: 21 additions & 0 deletions setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,27 @@ two public repositories:
Read the `Symfony Recipes documentation`_ to learn everything about how to
create recipes for your own packages.

.. _symfony-packs:

Symfony Packs
~~~~~~~~~~~~~

Sometimes a single feature requires installing several packages and bundles.
Instead of installing them individually, Symfony provides **packs**, which are
Composer metapackages that include several dependencies.

For example, to add debugging features in your application, you can run the
``composer require --dev debug`` command. This installs the ``symfony/debug-pack``,
which in turn installs several packages like ``symfony/debug-bundle``,
``symfony/monolog-bundle``, ``"symfony/var-dumper"``, etc.

By default, when installing Symfony packs, your ``composer.json`` file shows the
pack dependency (e.g. ``"symfony/debug-pack": "^1.0"``) instead of the actual
packages installed. To show the packages, add the ``--unpack`` option when
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if it would make sense to have a new command provided by Flex which actually just displays these packages instead of really unpacking the pack (and thus modifying the composer.json file).

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can add it to the RFC symfony/flex#518

Copy link
Member

Choose a reason for hiding this comment

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

great idea @maxhelias

Copy link
Member

Choose a reason for hiding this comment

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

I would say you composer.json depends on the pack rather than shows the pack

installing a pack (e.g. ``composer require debug --dev --unpack``) or run this
command to unpack the already installed packs: ``composer unpack PACK_NAME``
(e.g. ``composer unpack debug``).

.. _security-checker:

Checking Security Vulnerabilities
Expand Down
5 changes: 3 additions & 2 deletions setup/web_server_configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ to use PHP :ref:`with Nginx <web-server-nginx>`.
Adding Rewrite Rules
--------------------

The easiest way is to install the Apache recipe by executing the following command:
The easiest way is to install the ``apache`` :ref:`Symfony pack <symfony-packs>`
by executing the following command:

.. code-block:: terminal

$ composer require symfony/apache-pack

This recipe installs a ``.htaccess`` file in the ``public/`` directory that contains
This pack installs a ``.htaccess`` file in the ``public/`` directory that contains
the rewrite rules.

.. tip::
Expand Down
2 changes: 1 addition & 1 deletion testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ document::
.. tip::

Instead of installing each testing dependency individually, you can use the
Symfony Test pack to install all those dependencies at once:
``test`` :ref:`Symfony pack <symfony-packs>` to install all those dependencies at once:

.. code-block:: terminal

Expand Down
0