@@ -217,28 +217,15 @@ Troubleshooting
217217Deployments not Using the ``composer.json `` File
218218~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
219219
220- Symfony applications provide a ``kernel.project_dir `` parameter and a related
221- :method: `Symfony\\ Component\\ HttpKernel\\ Kernel::getProjectDir ` method.
222- You can use this method to perform operations with file paths relative to your
223- project's root directory. The logic to find that project root directory is based
224- on the location of the main ``composer.json `` file.
225-
226- If your deployment method doesn't use Composer, you may have removed the
227- ``composer.json `` file and the application won't work on the production server.
228- The solution is to override the ``getProjectDir() `` method in the application
229- kernel and return your project's root directory::
230-
231- // src/Kernel.php
232- // ...
233- class Kernel extends BaseKernel
234- {
235- // ...
236-
237- public function getProjectDir()
238- {
239- return dirname(__DIR__);
240- }
241- }
220+ The :ref: `project root directory <configuration-kernel-project-directory >`
221+ (whose value is used via the ``kernel.project_dir `` parameter and the
222+ :method: `Symfony\\ Component\\ HttpKernel\\ Kernel::getProjectDir ` method) is
223+ calculated automatically by Symfony as the directory where the main
224+ ``composer.json `` file is stored.
225+
226+ In deployments not using the ``composer.json `` file, you'll need to override the
227+ :method: `Symfony\\ Component\\ HttpKernel\\ Kernel::getProjectDir ` method
228+ :ref: `as explained in this section <configuration-kernel-project-directory >`.
242229
243230Learn More
244231----------
0 commit comments