@@ -27,14 +27,9 @@ to create files and execute the following commands:
27
27
28
28
.. code-block :: bash
29
29
30
- # Linux, Mac OS X
31
30
$ cd projects/
32
31
$ symfony new blog
33
32
34
- # Windows
35
- c:\> cd projects/
36
- c:\p rojects\> php symfony.phar new blog
37
-
38
33
This command creates a new directory called ``blog `` that contains a fresh new
39
34
project based on the most recent stable Symfony version available. In addition,
40
35
the installer checks if your system meets the technical requirements to execute
@@ -58,27 +53,35 @@ number of files and directories generated automatically:
58
53
59
54
blog/
60
55
├─ app/
61
- │ ├─ console
62
- │ ├─ cache/
63
56
│ ├─ config/
64
- │ ├─ logs/
65
57
│ └─ Resources/
58
+ ├─ bin
59
+ │ └─ console
66
60
├─ src/
67
61
│ └─ AppBundle/
62
+ ├─ var/
63
+ │ ├─ cache/
64
+ │ ├─ logs/
65
+ │ └─ sessions/
66
+ ├─ tests/
67
+ │ └─ AppBundle/
68
68
├─ vendor/
69
69
└─ web/
70
70
71
71
This file and directory hierarchy is the convention proposed by Symfony to
72
72
structure your applications. The recommended purpose of each directory is the
73
73
following:
74
74
75
- * ``app/cache/ ``, stores all the cache files generated by the application;
76
75
* ``app/config/ ``, stores all the configuration defined for any environment;
77
- * ``app/logs/ ``, stores all the log files generated by the application;
78
76
* ``app/Resources/ ``, stores all the templates and the translation files for the
79
77
application;
80
78
* ``src/AppBundle/ ``, stores the Symfony specific code (controllers and routes),
81
79
your domain code (e.g. Doctrine classes) and all your business logic;
80
+ * ``var/cache/ ``, stores all the cache files generated by the application;
81
+ * ``var/logs/ ``, stores all the log files generated by the application;
82
+ * ``var/sessions/ ``, stores all the session files generated by the application;
83
+ * ``tests/AppBundle/ ``, stores the automatic tests (e.g. Unit tests) of the
84
+ application.
82
85
* ``vendor/ ``, this is the directory where Composer installs the application's
83
86
dependencies and you should never modify any of its contents;
84
87
* ``web/ ``, stores all the front controller files and all the web assets, such
@@ -123,13 +126,18 @@ that follows these best practices:
123
126
124
127
blog/
125
128
├─ app/
126
- │ ├─ console
127
- │ ├─ cache/
128
129
│ ├─ config/
129
- │ ├─ logs/
130
130
│ └─ Resources/
131
+ ├─ bin/
132
+ │ └─ console
131
133
├─ src/
132
134
│ └─ AppBundle/
135
+ ├─ tests/
136
+ │ └─ AppBundle/
137
+ ├─ var/
138
+ │ ├─ cache/
139
+ │ ├─ logs/
140
+ └─ sessions/
133
141
├─ vendor/
134
142
└─ web/
135
143
├─ app.php
@@ -142,7 +150,7 @@ that follows these best practices:
142
150
143
151
.. code-block :: bash
144
152
145
- $ php app /console generate:bundle --namespace=AppBundle --dir=src --format=annotation --no-interaction
153
+ $ php bin /console generate:bundle --namespace=AppBundle --dir=src --format=annotation --no-interaction
146
154
147
155
Extending the Directory Structure
148
156
---------------------------------
@@ -152,27 +160,6 @@ structure of Symfony, you can
152
160
:doc: `override the location of the main directories </cookbook/configuration/override_dir_structure >`:
153
161
``cache/ ``, ``logs/ `` and ``web/ ``.
154
162
155
- In addition, Symfony3 will use a slightly different directory structure when
156
- it's released:
157
-
158
- .. code-block :: text
159
-
160
- blog-symfony3/
161
- ├─ app/
162
- │ ├─ config/
163
- │ └─ Resources/
164
- ├─ bin/
165
- │ └─ console
166
- ├─ src/
167
- ├─ var/
168
- │ ├─ cache/
169
- │ └─ logs/
170
- ├─ vendor/
171
- └─ web/
172
-
173
- The changes are pretty superficial, but for now, we recommend that you use
174
- the Symfony directory structure.
175
-
176
163
.. _`Composer` : https://getcomposer.org/
177
164
.. _`Get Started` : https://getcomposer.org/doc/00-intro.md
178
165
.. _`Composer download page` : https://getcomposer.org/download/
0 commit comments