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

[Config][Routing] Nicer config syntax for PSR-4 route loading#47943

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

Conversation

@derrabus
Copy link
Member

QA
Branch?6.2
Bug fix?no
New feature?yes
Deprecations?no
TicketsFollow-up to#47916
LicenseMIT
Doc PRsymfony/symfony-docs#17373 (WIP)

This PR implements an alternative syntax for the PSR-4 route loader introduced in#47916.

controllers:resource:path:./Controllersnamespace:App\Controllerstype:attribute
<routes>    <importtype="attribute">        <resourcepath="./Controllers"namespace="App\Psr4Controllers" />    </import></routes>

@carsonbotcarsonbot changed the titleNicer config syntax for PSR-4 route loading[Config][Routing] Nicer config syntax for PSR-4 route loadingOct 21, 2022
@carsonbotcarsonbot added this to the6.2 milestoneOct 21, 2022
@javiereguiluz
Copy link
Member

@derrabus thanks for taking the time to update the config syntax of this feature 🙏

derrabus and OskarStark reacted with heart emoji

@derrabusderrabusforce-pushed theimprovement/psr-4-routing-syntax branch from6ae58f7 to94f0b72CompareOctober 21, 2022 13:24
@derrabusderrabusforce-pushed theimprovement/psr-4-routing-syntax branch 3 times, most recently from5328cf2 to82b3b74CompareOctober 21, 2022 14:54
@derrabusderrabusforce-pushed theimprovement/psr-4-routing-syntax branch from82b3b74 tod7df3beCompareOctober 21, 2022 14:55
@fabpot
Copy link
Member

Thank you@derrabus.

@fabpot
Copy link
Member

symfony/recipes#1138 for the recipe update.


if ($loaderinstanceof self &&null !==$this->currentDir) {
if (!$loaderinstanceof self) {
return$loader->load($resource,$type);
Copy link
Member

Choose a reason for hiding this comment

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

@derrabus That does not work as the PSR-4 loader uses the locator but without the current dir, so the resource cannot be found. Or am I missing something?

@derrabusderrabus deleted the improvement/psr-4-routing-syntax branchOctober 22, 2022 10:40
fabpot added a commit that referenced this pull requestOct 23, 2022
…irectory (derrabus)This PR was merged into the 6.2 branch.Discussion----------[Config][Routing] Fix delegating to PSR-4 loader from subdirectory| Q             | A| ------------- | ---| Branch?       | 6.2| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       |#47943 (comment)| License       | MIT| Doc PR        | N/ACommits-------c1f0ccb Fix delegating to PSR-4 loader from subdirectory
@fabpotfabpot mentioned this pull requestOct 24, 2022
fabpot added a commit that referenced this pull requestOct 27, 2022
…iles (derrabus)This PR was merged into the 6.2 branch.Discussion----------[Routing] Add tests for loading PSR-4 classes from PHP files| Q             | A| ------------- | ---| Branch?       | 6.2| Bug fix?      | no| New feature?  | no| Deprecations? | no| Tickets       | N/A| License       | MIT| Doc PR        | N/AFollow-up to#47916,#47943This PR adds more tests, demonstrating how to trigger the new PSR-4 loader from a PHP config file.Commits-------416639c Add tests for loading PSR-4 classes from PHP files
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@stofstofstof left review comments

Assignees

No one assigned

Projects

None yet

Milestone

6.2

Development

Successfully merging this pull request may close these issues.

5 participants

@derrabus@javiereguiluz@fabpot@stof@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp