8000 Move routes config for annotations by fabpot · Pull Request #260 · symfony/recipes · GitHub
[go: up one dir, main page]

Skip to content

Move routes config for annotations #260

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
1 commit merged into from
Nov 18, 2017
Merged

Move routes config for annotations #260

1 commit merged into from
Nov 18, 2017

Conversation

fabpot
Copy link
Member
@fabpot fabpot commented Nov 17, 2017
Q A
License MIT

Let's make routes configuration when using annotations automatic.

Copy link
@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10000

Pull request passes validation.

@fabpot fabpot force-pushed the annotations-routes branch from 1084ab9 to 7abd7ca Compare November 17, 2017 10:57
@fabpot fabpot changed the title Moved routes config for annotations Move routes config for annotations Nov 17, 2017
Copy link
@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request passes validation.

Copy link
@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request passes validation.

@fabpot
Copy link
Member Author
fabpot commented Nov 17, 2017

We cannot merge it now as it fails when the src/Controller is empty. But it shouldn't. That's a bug that should be fixed in Symfony first.

Copy link
Member
@xabbuh xabbuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xabbuh
Copy link
Member
xabbuh commented Nov 17, 2017

@fabpot Are you sure? This works for me even when the directory is empty. It only fails when the directory does not exist.

xabbuh
xabbuh previously requested changes Nov 17, 2017
@@ -0,0 +1,3 @@
controllers:
resource: ../../src/Controller/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resource: ../src/Controller/

8000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

relative paths are interpreted relative to the location of kernel (probably related to symfony/symfony#24982)

Copy link
@backbone87 backbone87 Nov 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But then resource: Controller/ should be enough, asuming the Kernel is at src/Kernel.php

@weaverryan
Copy link
Member

Yes, I believe it only errors out when the directory does NOT exist. But, it should always exist in a new Flex app, thanks to the framework-bundle recipe, correct? I mean, it would be better if it did not error if the dir didn't exist, but I think maybe it's not a problem?

Copy link
@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request passes validation.

Copy link
Member Author
@fabpot fabpot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merge now

@ghost ghost merged commit 126f532 into master Nov 18, 2017
ghost pushed a commit that referenced this pull request Nov 18, 2017
@xabbuh xabbuh deleted the annotations-routes branch November 18, 2017 08:05
@Pierstoval
Copy link
Contributor

Shouldn't this have been set for SensioFrameworkBundle instead of doctrine/annotations?

@weaverryan
Copy link
Member

@Pierstoval I was just thinking the same thing. I'm not sure if it was done on purpose or not. Could you open a new PR to suggest adding it to SensioFrameworkExtraBundle instead?

@nicolas-grekas
Copy link
Member
nicolas-grekas commented Nov 20, 2017

The Route annotation doesn't need to be from the bundle: 3.4 has a fine working annotation class.
That's why the config is there. Did you spot any actual issue?

@backbone87
Copy link

But then this should be in the framework recipe, because If i use doctrine annotations without the framework bundle, this config will cause errors, no?

@nicolas-grekas
Copy link
Member

framework is a mandatory requirement of flex apps (and it doesn't require annotation, so double "no" :) )

@fabpot
Copy link
Member Author
fabpot commented Nov 20, 2017

To sum up: it was done on purpose :) Nothing to change here.

@@ -0,0 +1,3 @@
controllers:
resource: ../src/Controller/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since this is relative to %kernel.root_dir% it should be just Controller/

Copy link
Member
@yceruto yceruto Nov 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's relative to the entry point (public/index.php or bin/console) where the kernel is instantiated.

xabbuh added a commit to symfony/symfony-docs that referenced this pull request Nov 23, 2017
< 952A /div>
…yan)

This PR was merged into the 4.0 branch.

Discussion
----------

removing need for annotation route import change

See symfony/recipes#260 - this is not needed anymore 🎆

Commits
-------

c2f8345 removing need for annotation route import change
@michalpipa michalpipa mentioned this pull request Nov 30, 2017
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants
0