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

[FrameworkBundle] allow to reference files directly from kernel.root_dir#21231

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

Merged
fabpot merged 1 commit intosymfony:masterfromfabpot:file-locator-fix
Jan 10, 2017

Conversation

@fabpot
Copy link
Member

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsn/a
LicenseMIT
Doc PRn/a

While working on a bundleless app, I want to be able to reference a directory for routing annotations like this:

app:resource:"../src/Controller/"type:annotation

but that does not work because Symfony expects a bundle resource (@AppBundle...) or a directory referenced from the main appResources directory. But as I don't have such a directory, even using../../src/Controller does not work.

So, I propose to add the %kernel.root_dir% to the list of allowed directories.

By the way, we don't have the same issue with the routing annotationfile loader as it does not use the locator for whatever reason. Should we fix it?

dunglas, theofidry, lunika, sstok, and yceruto reacted with thumbs up emoji
@fabpotfabpot merged commit80b61e9 intosymfony:masterJan 10, 2017
fabpot added a commit that referenced this pull requestJan 10, 2017
…om kernel.root_dir (fabpot)This PR was merged into the 3.3-dev branch.Discussion----------[FrameworkBundle] allow to reference files directly from kernel.root_dir| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | n/a| License       | MIT| Doc PR        | n/aWhile working on a bundleless app, I want to be able to reference a directory for routing annotations like this:```yamlapp:    resource: "../src/Controller/"    type: annotation```but that does not work because Symfony expects a bundle resource (`@AppBundle...`) or a directory referenced from the main app `Resources` directory. But as I don't have such a directory, even using `../../src/Controller` does not work.So, I propose to add the %kernel.root_dir% to the list of allowed directories.By the way, we don't have the same issue with the routing annotation **file** loader as it does not use the locator for whatever reason. Should we fix it?Commits-------80b61e9 [FrameworkBundle] allowed to reference files directly from kernel.root_dir
@dunglas
Copy link
Member

ping@theofidry. We already stumbled on that, this patch will definitely help.

@theofidry
Copy link
Contributor

Indeed, cf.symfony/symfony-docs#7228

@theofidry
Copy link
Contributor

@dunglas not sure this solve the issue completely though, as mine was due to removingapp/Resources completely

@fabpot
Copy link
MemberAuthor

@theofidry I don't have anapp/Resources/ directory either, and that what is fixed here as well.app/Resources/../src/... works well (by chance again) when there is anapp/Resources directory, but does not work as soon as you remove it (this PR fixes that).

@theofidry
Copy link
Contributor

👍 perfect then, it gave me a lot of trouble so thanks for it

@stof
Copy link
Member

Shouldn't the path be relative to the location of the current file instead, to be consistent with other places in Symfony

@Tobion
Copy link
Contributor

I agree with@stof that this makes more sense.

HeahDude reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@fabpot@dunglas@theofidry@stof@Tobion@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp