From a9568d7c60a5251c651cb0f4d46f8acc8a6a4003 Mon Sep 17 00:00:00 2001 From: Zan Baldwin Date: Thu, 8 Feb 2018 14:20:36 +0000 Subject: [PATCH] Update Repository Symlink Helper Add workaround for GLOB_BRACE, which is unavailable on certain platforms (such as Alpine). --- link | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/link b/link index a5030d0683..6a2ec15e22 100755 --- a/link +++ b/link @@ -37,7 +37,12 @@ if (!is_dir("$argv[1]/vendor/symfony")) { $sfPackages = array('symfony/symfony' => __DIR__); $filesystem = new Filesystem(); -foreach (glob(__DIR__.'/src/Symfony/{Bundle,Bridge,Component,Component/Security}/*', GLOB_BRACE | GLOB_ONLYDIR | GLOB_NOSORT) as $dir) { +$braces = array('Bundle', 'Bridge', 'Component', 'Component/Security'); +$directories = call_user_func_array('array_merge', array_values(array_map(function ($part) { + return glob(__DIR__.'/src/Symfony/'.$part.'/*', GLOB_ONLYDIR | GLOB_NOSORT); +}, $braces))); + +foreach ($directories as $dir) { if ($filesystem->exists($composer = "$dir/composer.json")) { $sfPackages[json_decode(file_get_contents($composer))->name] = $dir; }