8000 Explain Symfony packs · symfony/symfony-docs@9d07ac3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9d07ac3

Browse files
committed
Explain Symfony packs
1 parent c1d40e9 commit 9d07ac3

10 files changed

+41
-18
lines changed

best_practices/business-logic.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ library or strategy you want for this.
123123
In practice, many Symfony applications rely on the independent
124124
`Doctrine project`_ to define their model using entities and repositories.
125125

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

130130
.. code-block:: terminal
131131

doctrine.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ Databases are a broad topic, so the documentation is divided in three articles:
2525
Installing Doctrine
2626
-------------------
2727

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

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

576576
Automatically Fetching Objects (ParamConverter)
577577
-----------------------------------------------

doctrine/dbal.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ data manipulations.
2222
Read the official Doctrine `DBAL Documentation`_ to learn all the details
2323
and capabilities of Doctrine's DBAL library.
2424

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

2727
.. code-block:: terminal
2828

page_creation.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,9 @@ The Web Debug Toolbar: Debugging Dream
182182
--------------------------------------
183183

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

188189
You will see a black bar along the bottom of the page. You'll learn more about all the information it holds
189190
along the way, but feel free to experiment: hover over and click

profiler.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Installation
99
------------
1010

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

1414
.. code-block:: terminal
1515

quick_tour/flex_recipes.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ But for a *truly* rich API, try installing `API Platform`_:
181181
182182
$ composer require api
183183
184-
This is an alias to ``api-platform/api-pack``, which has dependencies on several
185-
other packages, like Symfony's Validator and Security components, as well as the Doctrine
186-
ORM. In fact, Flex installed *5* recipes!
184+
This is an alias to ``api-platform/api-pack`` :ref:`Symfony pack <symfony-packs>`,
185+
which has dependencies on several other packages, like Symfony's Validator and
186+
Security components, as well as the Doctrine ORM. In fact, Flex installed *5* recipes!
187187

188188
But like usual, we can immediately start using the new library. Want to create a
189189
rich API for a ``product`` table? Create a ``Product`` entity and give it the

serializer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Installation
1515
------------
1616

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

2020
.. code-block:: terminal
2121

setup.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,27 @@ two public repositories:
179179
Read the `Symfony Recipes documentation`_ to learn everything about how to
180180
create recipes for your own packages.
181181

182+
.. _symfony-packs:
183+
184+
Symfony Packs
185+
~~~~~~~~~~~~~
186+
187+
Sometimes a single feature requires installing several packages and bundles.
188+
Instead of installing them individually, Symfony provides **packs**, which are
189+
Composer metapackages that include several dependencies.
190+
191+
For example, to add debugging features in your application, you can run the
192+
``composer require --dev debug`` command. This installs the ``symfony/debug-pack``,
193+
which in turn installs several packages like ``symfony/debug-bundle``,
194+
``symfony/monolog-bundle``, ``"symfony/var-dumper"``, etc.
195+
196+
By default, when installing Symfony packs, your ``composer.json`` file shows the
197+
pack dependency (e.g. ``"symfony/debug-pack": "^1.0"``) instead of the actual
198+
packages installed. To show the packages, add the ``--unpack`` option when
199+
installing a pack (e.g. ``composer require debug --dev --unpack``) or run this
200+
command to unpack the already installed packs: ``composer unpack PACK_NAME``
201+
(e.g. ``composer unpack debug``).
202+
182203
.. _security-checker:
183204

184205
Checking Security Vulnerabilities

setup/web_server_configuration.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@ to use PHP :ref:`with Nginx <web-server-nginx>`.
3535
Adding Rewrite Rules
3636
--------------------
3737

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

4041
.. code-block:: terminal
4142
4243
$ composer require symfony/apache-pack
4344
44-
This recipe installs a ``.htaccess`` file in the ``public/`` directory that contains
45+
This pack installs a ``.htaccess`` file in the ``public/`` directory that contains
4546
the rewrite rules.
4647

4748
.. tip::

testing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ document::
278278
.. tip::
279279

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

283283
.. code-block:: terminal
284284

0 commit comments

Comments
 (0)
0