Skip to content

Commit ca53cb5

Browse files
javiereguiluzxabbuh
authored andcommitted
Use the standard cache and logs dir for the micro kernel example
1 parent 3682e6b commit ca53cb5

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

configuration/micro_kernel_trait.rst

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,18 @@ to hold the kernel. Now it looks like this::
195195
// load the annotation routes
196196
$routes->import(__DIR__.'/../src/App/Controller/', '/', 'annotation');
197197
}
198+
199+
// optional, to use the standard Symfony cache directory
200+
public function getCacheDir()
201+
{
202+
return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();
203+
}
204+
205+
// optional, to use the standard Symfony logs directory
206+
public function getLogDir()
207+
{
208+
return dirname(__DIR__).'/var/logs';
209+
}
198210
}
199211

200212
Unlike the previous kernel, this loads an external ``app/config/config.yml`` file,
@@ -294,9 +306,7 @@ this:
294306
your-project/
295307
├─ app/
296308
| ├─ AppKernel.php
297-
│ ├─ cache/
298309
│ ├─ config/
299-
│ ├─ logs/
300310
│ └─ Resources
301311
| └─ views
302312
| ├─ base.html.twig
@@ -306,6 +316,9 @@ this:
306316
│ └─ App
307317
| └─ Controller
308318
| └─ MicroController.php
319+
├─ var/
320+
| ├─ cache/
321+
│ └─ logs/
309322
├─ vendor/
310323
│ └─ ...
311324
├─ web/

0 commit comments

Comments
 (0)