File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Original file line number Diff line number Diff line change @@ -56,6 +56,10 @@ directory and rename it to something else (e.g. ``foo``).
56
56
Root Directory
57
57
~~~~~~~~~~~~~~
58
58
59
+ .. versionadded :: 3.3
60
+ The ``getRootDir() `` method is deprecated since Symfony 3.3. Use the new
61
+ ``getProjectDir() `` method instead.
62
+
59
63
**type **: ``string `` **default **: the directory of ``AppKernel ``
60
64
61
65
This returns the root directory of your kernel. If you use the Symfony Standard
@@ -77,6 +81,34 @@ To change this setting, override the
77
81
}
78
82
}
79
83
84
+ Project Directory
85
+ ~~~~~~~~~~~~~~~~~
86
+
87
+ .. versionadded :: 3.3
88
+ The ``getProjectDir() `` method was introduced in Symfony 3.3.
89
+
90
+ **type **: ``string `` **default **: the directory of the project ``composer.json ``
91
+
92
+ This returns the root directory of your Symfony project. It's calculated as
93
+ the directory where the main ``composer.json `` file is stored.
94
+
95
+ If for some reason the ``composer.json `` file is not stored at the root of your
96
+ project, you can override the :method: `Symfony\\ Component\\ HttpKernel\\ Kernel::getProjectDir `
97
+ method to return the right project directory::
98
+
99
+ // app/AppKernel.php
100
+
101
+ // ...
102
+ class AppKernel extends Kernel
103
+ {
104
+ // ...
105
+
106
+ public function getProjectDir()
107
+ {
108
+ return realpath(__DIR__.'/../');
109
+ }
110
+ }
111
+
80
112
Cache Directory
81
113
~~~~~~~~~~~~~~~
82
114
You can’t perform that action at this time.
0 commit comments