Update Repository Symlink Helper

Add workaround for GLOB_BRACE, which is unavailable on certain platforms (such as Alpine).
This commit is contained in:
Zan Baldwin 2018-02-08 14:20:36 +00:00 committed by Nicolas Grekas
parent 65bab998e5
commit a9568d7c60
1 changed files with 6 additions and 1 deletions

7
link
View File

@ -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;
}