Skip to content

Commit 672ded5

Browse files
committed
[symfony#2217] Tweaks to new entry about overriding kernel configuration by @wouterj. Thanks to @stof for some of the details here.
1 parent 65edac6 commit 672ded5

File tree

2 files changed

+29
-23
lines changed

2 files changed

+29
-23
lines changed

reference/configuration/kernel.rst

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,43 @@
11
.. index::
22
single: Configuration reference; Kernel class
33

4-
Configuration in the ``AppKernel``
5-
==================================
4+
Configuring in the Kernel (e.g. AppKernel)
5+
==========================================
66

7-
Some configuration can be done in the ``AppKernel`` class (which is located in
8-
``app/AppKernel.php``. You can do this by overriding the method of the
9-
:class:`Symfony\\Component\\HttpKernel\\Kernel` class, which is extended by
10-
the ``AppKernel`` class.
7+
Some configuration can be done on the kernel class itself (usually called
8+
``app/AppKernel.php``). You can do this by overriding specific methods in
9+
the parent :class:`Symfony\\Component\\HttpKernel\\Kernel` class.
1110

1211
Configuration
1312
-------------
1413

15-
* `kernel name`_
16-
* `root directory`_
17-
* `cache directory`_
18-
* `log directory`_
14+
* `Kernel Name`_
15+
* `Root Directory`_
16+
* `Cache Directory`_
17+
* `Log Directory`_
1918

20-
kernel name
19+
Kernel Name
2120
~~~~~~~~~~~
2221

23-
**type**: ``string`` **default**: ``$this->name``
22+
**type**: ``string`` **default**: ``app`` (i.e. the directory name holding the kernel class)
2423

25-
To change this setting, override the
26-
:method:`Symfony\\Component\\HttpKernel\\Kernel::getName` method.
24+
To change this setting, override the :method:`Symfony\\Component\\HttpKernel\\Kernel::getName`
25+
method. Alternatively, move your kernel into a different directory. For example,
26+
if you moved the kernel into a ``foo`` directory (instead of ``app``), the
27+
kernel name will be ``foo``.
28+
29+
The name of the kernel isn't usually directly important - it's used in the
30+
generation of cache files. If you have an application with multiple kernels,
31+
the easiest way to make each have a unique name is to duplicate the ``app``
32+
directory and rename it to something else (e.g. ``foo``).
2733

28-
root directory
34+
Root Directory
2935
~~~~~~~~~~~~~~
3036

3137
**type**: ``string`` **default**: the directory of ``AppKernel``
3238

33-
This returns the root directory of you Symfony2 application. If you use the
34-
Symfony Standard edition, the root directory refers to the ``app`` directory.
39+
This returns the root directory of your kernel. If you use the Symfony Standard
40+
edition, the root directory refers to the ``app`` directory.
3541

3642
To change this setting, override the
3743
:method:`Symfony\\Component\\HttpKernel\\Kernel::getRootDir` method::
@@ -49,20 +55,20 @@ To change this setting, override the
4955
}
5056
}
5157

52-
cache directory
58+
Cache Directory
5359
~~~~~~~~~~~~~~~
5460

5561
**type**: ``string`` **default**: ``$this->rootDir/cache/$this->environment``
5662

57-
This returns the cache directory. You need to override the
63+
This returns the path to the cache directory. To change it, override the
5864
:method:`Symfony\\Component\\HttpKernel\\Kernel::getCacheDir` method. Read
5965
":ref:`override-cache-dir`" for more information.
6066

61-
log directory
67+
Log Directory
6268
~~~~~~~~~~~~~
6369

6470
**type**: ``string`` **default**: ``$this->rootDir/logs``
6571

66-
This returns the log directory. You need to override the
72+
This returns the path to the log directory. To change it, override the
6773
:method:`Symfony\\Component\\HttpKernel\\Kernel::getLogDir` method. Read
6874
":ref:`override-logs-dir`" for more information.

reference/map.rst.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
* :doc:`doctrine </reference/configuration/doctrine>`
1010
* :doc:`security </reference/configuration/security>`
1111
* :doc:`assetic </reference/configuration/assetic>`
12-
* :doc:`swiftMailer </reference/configuration/swiftmailer>`
12+
* :doc:`swiftmailer </reference/configuration/swiftmailer>`
1313
* :doc:`twig </reference/configuration/twig>`
1414
* :doc:`monolog </reference/configuration/monolog>`
1515
* :doc:`web_profiler </reference/configuration/web_profiler>`
1616

17-
* :doc:`Configuration in the Kernel </reference/configuration/kernel>`
17+
* :doc:`Configuring the Kernel (e.g. AppKernel) </reference/configuration/kernel>`
1818

1919
* **Forms and Validation**
2020

0 commit comments

Comments
 (0)