Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[configuration][override_dir_structure] Update override Symfony default directory structure#21257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
tdutrion wants to merge1 commit intosymfony:7.2
base:7.2
Choose a base branch
Loading
fromtdutrion:update-override-default-directories-docs
Open
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 58 additions & 3 deletionsconfiguration/override_dir_structure.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -74,14 +74,41 @@ Web front-controller::
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
// ...

.. _override-bin-dir:

Override the Binary Directory
-----------------------------

You can change the binary directory by adding the ``extra.bin-dir`` option
in the ``composer.json`` file:

.. code-block:: json

{
"...": "...",
"extra": {
"...": "...",
"bin-dir": "my_new_bin_dir"
}
}

.. _override-config-dir:

Override the Configuration Directory
------------------------------------

The configuration directory is the only one which cannot be overridden in a
Symfony application. Its location is hardcoded as the ``config/`` directory
at your project root directory.
You can change the configuration directory by adding the ``extra.config-dir`` option
in the ``composer.json`` file:

.. code-block:: json

{
"...": "...",
"extra": {
"...": "...",
"config-dir": "my_new_config_dir"
}
}

.. _override-cache-dir:

Expand DownExpand Up@@ -147,6 +174,34 @@ Here you have changed the location of the directory to ``var/{environment}/log/`
You can also change the log directory defining an environment variable named
``APP_LOG_DIR`` whose value is the full path of the log folder.

.. _override-src-dir:

Override the Source Directory
-----------------------------

You can change the source directory by adding the ``extra.src-dir`` option
and updating the ``autoload.psr-4`` option in the ``composer.json`` file:

.. code-block:: json

{
"...": "...",
"autoload": {
"psr-4": {
"App\\": "my_new_src_dir/"
}
},
"extra": {
"...": "...",
"src-dir": "my_new_src_dir"
}
}

.. tip::

Don't forget to run the ``composer dump-autoload`` command once ``autoload.psr-4``
has been changed.

.. _override-templates-dir:

Override the Templates Directory
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp