-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@derrabus thanks for taking the time to update the config syntax of this feature 🙏 |
6ae58f7
to
94f0b72
Compare
src/Symfony/Component/Routing/Loader/schema/routing/routing-1.0.xsd
Outdated
Show resolved
Hide resolved
5328cf2
to
82b3b74
Compare
82b3b74
to
d7df3be
Compare
Thank you @derrabus. |
symfony/recipes#1138 for the recipe update. |
@@ -136,7 +136,11 @@ private function doImport(mixed $resource, string $type = null, bool $ignoreErro | |||
try { | |||
$loader = $this->resolve($resource, $type); | |||
|
|||
if ($loader instanceof self && null !== $this->currentDir) { | |||
if (!$loader instanceof self) { | |||
return $loader->load($resource, $type); |
There was a problem hiding this comment.
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?
…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/A Commits ------- c1f0ccb Fix delegating to PSR-4 loader from subdirectory
…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/A Follow-up to #47916, #47943 This 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
This PR implements an alternative syntax for the PSR-4 route loader introduced in #47916.