8000 minor #26091 Update Repository Symlink Helper (zanbaldwin) · symfony/symfony@573e462 · GitHub
[go: up one dir, main page]

Skip to content

Commit 573e462

Browse files
minor #26091 Update Repository Symlink Helper (zanbaldwin)
This PR was submitted for the 3.3 branch but it was merged into the 2.7 branch instead (closes #26091). Discussion ---------- Update Repository Symlink Helper The `link` script is super-useful (thanks @dunglas!) for development - but for some it's unusable in its current form due to the use of `GLOB_BRACE` which is [unavailable on certain platforms](zendframework/zend-stdlib#58 (comment)) (such as Alpine) and is a platform-specific problem that will not be fixed in future versions of PHP. I know the code is a little condensed and not the easiest to read, but I thought that wasn't really an issue considering this is just a development helper script and not part of the 'official' Symfony code base. | Q | A | ------------- | --- | Branch? | `3.3` | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | No tests for `/link` | Fixed tickets | | License | MIT | Doc PR | can't find documentation for `/link` <!-- - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. - Replace this comment by a description of what your PR is solving. --> Commits ------- a9568d7 Update Repository Symlink Helper
2 parents 65bab99 + a9568d7 commit 573e462

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

link

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ if (!is_dir("$argv[1]/vendor/symfony")) {
3737
$sfPackages = array('symfony/symfony' => __DIR__);
3838

3939
$filesystem = new Filesystem();
40-
foreach (glob(__DIR__.'/src/Symfony/{Bundle,Bridge,Component,Component/Security}/*', GLOB_BRACE | GLOB_ONLYDIR | GLOB_NOSORT) as $dir) {
40+
$braces = array('Bundle', 'Bridge', 'Component', 'Component/Security');
41+
$directories = call_user_func_array('array_merge', array_values(array_map(function ($part) {
42+
return glob(__DIR__.'/src/Symfony/'.$part.'/*', GLOB_ONLYDIR | GLOB_NOSORT);
43+
}, $braces)));
44+
45+
foreach ($directories as $dir) {
4146
if ($filesystem->exists($composer = "$dir/composer.json")) {
4247
$sfPackages[json_decode(file_get_contents($composer))->name] = $dir;
4348
}

0 commit comments

Comments
 (0)
0