Skip to content

FileLocator paths are missing since v5 so cannot load resources from ../src as said in docs #35381

@simPod

Description

@simPod

In this PR #33285 the second and third argument of FileLocator::__construct were removed.

Before (<= v4.4) the lookup for resources was done from 2 paths.

/Users/path/src
/Users/path/src/Resources

+ current path /Users/path/src/Home/Config/routes

Now (v5) the $paths property in FileLocator is empty so only current path is applied.

The resource is atemped to be resolved only as /Users/path/src/Home/Config/routes/../src/Home/Application/Controller for my definition <import resource="../src/Home/Application/Controller" prefix="/home" type="annotation" />

The documentation still says to do this:

# config/routes.yaml
controllers:
    resource: '../src/Controller/'
    type:     annotation

But for that cannot work. Is the documentation outdated and this is the correct behaviour or the root_dir should have been replaced by project_dir instead and this is a bug? Thanks-

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions