Skip to content

Commit d8dee69

Browse files
committed
Implemented all the changes suggested by reviewers
1 parent 490ead0 commit d8dee69

File tree

1 file changed

+31
-22
lines changed

1 file changed

+31
-22
lines changed

cookbook/bundles/best_practices.rst

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -75,37 +75,33 @@ configuration options (see below for some usage examples).
7575
Directory Structure
7676
-------------------
7777

78-
The basic directory structure of an AcmeBlogBundle must read as follows (if you
79-
use `PSR-4`_ the ``Acme/`` and ``BlogBundle/`` folders might not exist):
78+
The basic directory structure of an AcmeBlogBundle must read as follows:
8079

8180
.. code-block:: text
8281
83-
<your-project>/
84-
├─ ...
85-
└─ src/
86-
└─ Acme/
87-
└─ BlogBundle/
88-
├─ AcmeBlogBundle.php
89-
├─ Controller/
90-
├─ README.md
91-
├─ Resources/
92-
│ ├─ meta/
93-
│ │ └─ LICENSE
94-
│ ├─ config/
95-
│ ├─ doc/
96-
│ │ └─ index.rst
97-
│ ├─ translations/
98-
│ ├─ views/
99-
│ └─ public/
100-
└─ Tests/
82+
<your-bundle>/
83+
├─ AcmeBlogBundle.php
84+
├─ Controller/
85+
├─ README.md
86+
├─ Resources/
87+
│ ├─ meta/
88+
│ │ └─ LICENSE
89+
│ ├─ config/
90+
│ ├─ doc/
91+
│ │ └─ index.rst
92+
│ ├─ translations/
93+
│ ├─ views/
94+
│ └─ public/
95+
└─ Tests/
10196
10297
**The following files are mandatory**, because they ensure a structure convention
10398
that automated tools can rely on:
10499

105100
* ``AcmeBlogBundle.php``: This is the class that transforms a plain directory
106101
into a Symfony bundle;
107102
* ``README.md``: This file contains the basic description of the bundle and it
108-
usually shows some basic examples and links to its full documentation;
103+
usually shows some basic examples and links to its full documentation (it
104+
can use any of the markup formats supported by GitHub, such as ``README.rst``);
109105
* ``Resources/meta/LICENSE``: The full license for the code. The license file
110106
can also be stored in the bundle's root directory to follow the generic
111107
conventions about packages;
@@ -220,7 +216,7 @@ following standardized instructions in your ``README.md`` file.
220216
Step 2: Enable the Bundle
221217
-------------------------
222218
223-
Then, enable the bundle by adding the following line in the `app/AppKernel.php`
219+
Then, enable the bundle by adding the following in the `app/AppKernel.php`
224220
file of your project:
225221
226222
```php
@@ -315,6 +311,11 @@ Retrieve the configuration parameters in your code from the container::
315311
Even if this mechanism is simple enough, you should consider using the more
316312
advanced :doc:`semantic bundle configuration </cookbook/bundles/configuration>`.
317313

314+
Versioning
315+
----------
316+
317+
Bundles must be versioned following the `Semantic Versioning Standard`_.
318+
318319
Services
319320
--------
320321

@@ -344,6 +345,12 @@ The ``composer.json`` file should include at least the following metadata:
344345
* ``type``, use the ``symfony-bundle`` value;
345346
* ``license``, ``MIT`` is the preferred license for Symfony bundles, but you
346347
can use any other value.
348+
* ``autoload``, this information is used by Symfony to load the classes of the
349+
bundle. The `PSR-4`_ autoload standard is recommended for modern bundles, but
350+
`PSR-0`_ standard is also supported.
351+
352+
In order to make it easier for developers to find your bundle, register it on
353+
`Packagist`_, the official repository for Composer packages.
347354

348355
Learn more from the Cookbook
349356
----------------------------
@@ -352,3 +359,5 @@ Learn more from the Cookbook
352359

353360
.. _`PSR-0`: http://www.php-fig.org/psr/psr-0/
354361
.. _`PSR-4`: http://www.php-fig.org/psr/psr-4/
362+
.. _`Semantic Versioning Standard`: http://semver.org/
363+
.. _`Packagist`: https://packagist.org/

0 commit comments

Comments
 (0)