8000 Added a new section with recommendations for Composer · symfony/symfony-docs@7bf1a4c · GitHub
[go: up one dir, main page]

Skip to content
Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7bf1a4c

Browse files
committed
Added a new section with recommendations for Composer
1 parent 34d2e8a commit 7bf1a4c

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

cookbook/bundles/best_practices.rst

Lines changed: 16 additions & 2 deletions
8000
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,7 @@ Services
319319
--------
320320

321321
If the bundle defines services, they must be prefixed with the bundle alias.
322-
For an AcmeBlogBundle for instance, all services must be prefixed with
323-
``acme_blog``.
322+
For example, AcmeBlogBundle services must be prefixed with ``acme_blog``.
324323

325324
In addition, services not meant to be used by the application directly, should
326325
be :ref:`defined as private <container-private-services>`.
@@ -330,6 +329,21 @@ be :ref:`defined as private <container-private-services>`.
330329
You can learn much more about service loading in bundles reading this article:
331330
:doc:`How to Load Service Configuration inside a Bundle </cookbook/bundles/extension>`.
332331

332+
Composer Metadata
333+
-----------------
334+
335+
The ``composer.json`` file should include at least the following metadata:
336+
337+
* ``name``, which includes the vendor and the short bundle name. If you are
338+
releasing the bundle on your own instead of on behalf of a company, use your
339+
personal name (e.g. ``johnsmith/blog-bundle``). The bundle short name excludes
340+
the vendor name and separates each word with an hyphen. For example:
341+
``AcmeBlogBundle`` is transformed into ``blog-bundle`` and ``AcmeSocialConnectBundle``
342+
is transformed into ``acme-social-bundle``;
343+
* ``description``, a brief explanation of the purpose of the bundle;
344+
* ``type``, use the ``symfony-bundle`` value;
345+
* ``license``, use the ``MIT`` value.
346+
333347
Learn more from the Cookbook
334348
----------------------------
335349

0 commit comments

Comments
 (0)
0