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

Appearance settings

Commit 148b13c

Browse filesBrowse files
bug #36041 fix import from config file using type: glob (Tobion)
This PR was merged into the 3.4 branch. Discussion ---------- fix import from config file using type: glob | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | | License | MIT | Doc PR | If you try to import configs with glob using ``` imports: - { resource: '../dev/*.{php,xml,yaml,yml}', type: 'glob' } ``` it didn't work because the FileLoader resolves the glob pattern but forwards the glob type. This meant the resolver then choses the GlobFilerLoader again for each already resolved file which does not find the files. So in the end the glob was resolved but the files never imported. The workaround is to remove the `type: glob` from the import above. But the real fix should be to not forward the glob type when it's already resolved. Commits ------- 6b70511 fix import from config file using type: glob
2 parents f020876 + 6b70511 commit 148b13c
Copy full SHA for 148b13c

1 file changed

+1-1Lines changed: 1 addition & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/Symfony/Component/Config/Loader/FileLoader.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Component/Config/Loader/FileLoader.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function import($resource, $type = null, $ignoreErrors = false, $sourceRe
7676
$ret = [];
7777
$isSubpath = 0 !== $i && false !== strpos(substr($resource, 0, $i), '/');
7878
foreach ($this->glob($resource, false, $_, $ignoreErrors || !$isSubpath) as $path => $info) {
79-
if (null !== $res = $this->doImport($path, $type, $ignoreErrors, $sourceResource)) {
79+
if (null !== $res = $this->doImport($path, 'glob' === $type ? null : $type, $ignoreErrors, $sourceResource)) {
8080
$ret[] = $res;
8181
}
8282
$isSubpath = true;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.