@@ -12,12 +12,16 @@ directory structure is:
1212
1313 your-project/
1414 ├─ app/
15- │ ├─ cache/
1615 │ ├─ config/
17- │ ├─ logs/
1816 │ └─ ...
1917 ├─ src/
2018 │ └─ ...
19+ ├─ tests/
20+ │ └─ ...
21+ ├─ var/
22+ │ ├─ cache/
23+ │ ├─ logs/
24+ │ └─ ...
2125 ├─ vendor/
2226 │ └─ ...
2327 └─ web/
@@ -41,13 +45,13 @@ in the ``AppKernel`` class of you application::
4145
4246 public function getCacheDir()
4347 {
44- return $this->rootDir.' /'.$this->environment.'/cache';
48+ return dirname(__DIR__).'/var /'.$this->environment.'/cache';
4549 }
4650 }
4751
48- ``$this->rootDir `` is the absolute path to the `` app `` directory and `` $this->environment ``
49- is the current environment (i.e. `` dev ``). In this case you have changed
50- the location of the cache directory to `` app /{environment}/cache ``.
52+ In this code, ``$this->environment `` is the current environment (i.e. `` dev ``).
53+ In this case you have changed the location of the cache directory to
54+ `` var /{environment}/cache ``.
5155
5256.. caution ::
5357
@@ -74,35 +78,34 @@ method::
7478
7579 public function getLogDir()
7680 {
77- return $this->rootDir.' /'.$this->environment.'/logs';
81+ return dirname(__DIR__).'/var /'.$this->environment.'/logs';
7882 }
7983 }
8084
81- Here you have changed the location of the directory to ``app /{environment}/logs ``.
85+ Here you have changed the location of the directory to ``var /{environment}/logs ``.
8286
8387.. _override-web-dir :
8488
8589Override the ``web `` Directory
8690------------------------------
8791
8892If you need to rename or move your ``web `` directory, the only thing you
89- need to guarantee is that the path to the ``app `` directory is still correct
93+ need to guarantee is that the path to the ``var `` directory is still correct
9094in your ``app.php `` and ``app_dev.php `` front controllers. If you simply
9195renamed the directory, you're fine. But if you moved it in some way, you
9296may need to modify these paths inside those files::
9397
94- require_once __DIR__.'/../Symfony/app/bootstrap.php.cache';
95- require_once __DIR__.'/../Symfony/app/AppKernel.php';
98+ require_once __DIR__.'/../path/to/var/bootstrap.php.cache';
9699
97- You also need to change the ``extra.symfony-web-dir `` option in the `` composer.json ``
98- file:
100+ You also need to change the ``extra.symfony-web-dir `` option in the
101+ `` composer.json `` file:
99102
100- .. code-block :: javascript
103+ .. code-block :: json
101104
102105 {
103- ...
106+ " ..." : " ... " ,
104107 "extra" : {
105- ...
108+ " ..." : " ... " ,
106109 "symfony-web-dir" : " my_new_web_dir"
107110 }
108111 }
@@ -154,8 +157,8 @@ file:
154157
155158 .. code-block :: bash
156159
157- $ php app /console cache:clear --env=prod
158- $ php app /console assetic:dump --env=prod --no-debug
160+ $ php bin /console cache:clear --env=prod
161+ $ php bin /console assetic:dump --env=prod --no-debug
159162
160163 Override the ``vendor `` Directory
161164---------------------------------
@@ -179,6 +182,7 @@ The change in the ``composer.json`` will look like this:
179182 Then, update the path to the ``autoload.php `` file in ``app/autoload.php ``::
180183
181184 // app/autoload.php
185+
182186 // ...
183187 $loader = require '/some/dir/vendor/autoload.php';
184188
0 commit comments