Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Routing] Fixed the importing of files using glob patterns that match multiple resources #26600

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

Closed
wants to merge 3 commits into from

Conversation

skalpa
Copy link
Contributor

@skalpa skalpa commented Mar 19, 2018

Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #22160
License MIT
Doc PR n/a

This fixes the import of resources specified using glob patterns in XmlFileLoader and YamlFileLoader.

@nicolas-grekas This supersedes #25633 that's been in limbo since December despite your comments, so I decided to take care of it as I need this to work. I took care of the two loaders that are affected, and added tests.

@skalpa
Copy link
Contributor Author

skalpa commented Mar 19, 2018

Failures are unrelated.

Also, I didn't know which branch to target: the source of the problem is a change in Symfony\Component\Config\Loader\FileLoader on the 3.3 branch, however in theory one could use v3.3+ of the config component with an older version of the routing component... so I left it against 3.4 for now but can rebase to an older branch if you tell me which one.

@nicolas-grekas nicolas-grekas changed the title [Routing] Fixed the importing of files using glob patterns that match… [Routing] Fixed the importing of files using glob patterns that match multiple resources Mar 19, 2018
@nicolas-grekas nicolas-grekas added this to the 3.4 milestone Mar 19, 2018
@nicolas-grekas
Copy link
Member

@skalpa thank you. Branch 3.4 is the good one. I think RoutingConfigurator also need a similar update (but not exact same logic: the $subCollection need to contain all the routes before passing it to the ImportConfigurator instance, you'll see.

@skalpa
Copy link
Contributor Author

skalpa commented Mar 19, 2018

@nicolas-grekas I took care of RoutingConfigurator too, thanks for pointing that out.

$collection = $routes->collection();

$collection->add('bar_route', '/bar')
->defaults(['_controller' => 'AppBundle:Bar:view']);
Copy link
Member

Choose a reason for hiding this comment

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

array() instead of [] (same below, see fabbot patch)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, old habits. Fixed.

@nicolas-grekas
Copy link
Member

Thank you @skalpa.

nicolas-grekas added a commit that referenced this pull request Mar 22, 2018
… that match multiple resources (skalpa)

This PR was squashed before being merged into the 3.4 branch (closes #26600).

Discussion
----------

[Routing] Fixed the importing of files using glob patterns that match multiple resources

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #22160
| License       | MIT
| Doc PR        | n/a

This fixes the import of resources specified using glob patterns in `XmlFileLoader` and `YamlFileLoader`.

@nicolas-grekas This supersedes #25633 that's been in limbo since December despite your comments, so I decided to take care of it as I need this to work. I took care of the two loaders that are affected, and added tests.

Commits
-------

948b4cf [Routing] Fixed the importing of files using glob patterns that match multiple resources
This was referenced Apr 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants