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

Appearance settings

Deprecate global fallback dir to load resources from #31915

Copy link
Copy link
Closed
@Tobion

Description

@Tobion
Issue body actions

The FileLocator currently defines a global directory where resources can be loaded from. %kernel.root_dir%/Resources and %kernel.root_dir% are the fallback directories for any resources. So in SF 3 this means

  • app/Resources can be used to overwrite resources from Bundles
  • app/ can be used to load any resource if they are not found relative to the current directory the source is loaded from

But that behavior has never officially been unsed in a SF 2/3 symfony-standard or SF 4 flex kernel. They are either loaded relative to the current dir or via glob pattern, not by a global fallback.
Overwriting bundle resources should also not be done like this since forever. See https://symfony.com/doc/current/bundles/override.html
It should be done with compiler passes for services or twig namespace (which uses the /templates/ dir) for templates or translation domains for translations.

We want to remove the %kernel.root_dir%. If we change this to use project_dir, it means the fallback dir is not app/Resources as in SF 3 or src/Resources in SF 4, but Resources/ directly in SF 5. Whatever we put here, it does not make sense and is not documented anywhere.

I suggest to deprecate this global fallback dir in SF 4.4 and remove it in 5. Then this problem is gone.

See #31672 (comment)

sstok

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.