@@ -75,37 +75,33 @@ configuration options (see below for some usage examples).
75
75
Directory Structure
76
76
-------------------
77
77
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:
80
79
81
80
.. code-block :: text
82
81
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/
101
96
102
97
**The following files are mandatory **, because they ensure a structure convention
103
98
that automated tools can rely on:
104
99
105
100
* ``AcmeBlogBundle.php ``: This is the class that transforms a plain directory
106
101
into a Symfony bundle;
107
102
* ``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 ``);
109
105
* ``Resources/meta/LICENSE ``: The full license for the code. The license file
110
106
can also be stored in the bundle's root directory to follow the generic
111
107
conventions about packages;
@@ -220,7 +216,7 @@ following standardized instructions in your ``README.md`` file.
220
216
Step 2: Enable the Bundle
221
217
-------------------------
222
218
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`
224
220
file of your project:
225
221
226
222
```php
@@ -315,6 +311,11 @@ Retrieve the configuration parameters in your code from the container::
315
311
Even if this mechanism is simple enough, you should consider using the more
316
312
advanced :doc: `semantic bundle configuration </cookbook/bundles/configuration >`.
317
313
314
+ Versioning
315
+ ----------
316
+
317
+ Bundles must be versioned following the `Semantic Versioning Standard `_.
318
+
318
319
Services
319
320
--------
320
321
@@ -344,6 +345,12 @@ The ``composer.json`` file should include at least the following metadata:
344
345
* ``type ``, use the ``symfony-bundle `` value;
345
346
* ``license ``, ``MIT `` is the preferred license for Symfony bundles, but you
346
347
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.
347
354
348
355
Learn more from the Cookbook
349
356
----------------------------
@@ -352,3 +359,5 @@ Learn more from the Cookbook
352
359
353
360
.. _`PSR-0` : http://www.php-fig.org/psr/psr-0/
354
361
.. _`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