1
1
.. index ::
2
2
single: Configuration reference; Kernel class
3
3
4
- Configuration in the `` AppKernel ``
5
- ==================================
4
+ Configuring in the Kernel (e.g. AppKernel)
5
+ ==========================================
6
6
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.
11
10
12
11
Configuration
13
12
-------------
14
13
15
- * `kernel name `_
16
- * `root directory `_
17
- * `cache directory `_
18
- * `log directory `_
14
+ * `Kernel Name `_
15
+ * `Root Directory `_
16
+ * `Cache Directory `_
17
+ * `Log Directory `_
19
18
20
- kernel name
19
+ Kernel Name
21
20
~~~~~~~~~~~
22
21
23
- **type **: ``string `` **default **: ``$this->name ``
22
+ **type **: ``string `` **default **: ``app `` (i.e. the directory name holding the kernel class)
24
23
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 ``).
27
33
28
- root directory
34
+ Root Directory
29
35
~~~~~~~~~~~~~~
30
36
31
37
**type **: ``string `` **default **: the directory of ``AppKernel ``
32
38
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.
35
41
36
42
To change this setting, override the
37
43
:method: `Symfony\\ Component\\ HttpKernel\\ Kernel::getRootDir ` method::
@@ -49,20 +55,20 @@ To change this setting, override the
49
55
}
50
56
}
51
57
52
- cache directory
58
+ Cache Directory
53
59
~~~~~~~~~~~~~~~
54
60
55
61
**type **: ``string `` **default **: ``$this->rootDir/cache/$this->environment ``
56
62
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
58
64
:method: `Symfony\\ Component\\ HttpKernel\\ Kernel::getCacheDir ` method. Read
59
65
":ref: `override-cache-dir `" for more information.
60
66
61
- log directory
67
+ Log Directory
62
68
~~~~~~~~~~~~~
63
69
64
70
**type **: ``string `` **default **: ``$this->rootDir/logs ``
65
71
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
67
73
:method: `Symfony\\ Component\\ HttpKernel\\ Kernel::getLogDir ` method. Read
68
74
":ref: `override-logs-dir `" for more information.
0 commit comments