Skip to content

Commit 7f5aeb7

Browse files
committed
bug #25258 [link] Prevent warnings when running link with 2.7 (dunglas)
This PR was merged into the 2.7 branch. Discussion ---------- [link] Prevent warnings when running link with 2.7 | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no | Deprecations? | no <!-- don't forget to update UPGRADE-*.md files --> | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Prevent warnings when linking from 2.7 because some directories (like the Bridge/Propel1) don't contain `composer.json` files. Commits ------- 3e7780c [link] Prevent warnings when running link with 2.7
2 parents 5a6e2d7 + 3e7780c commit 7f5aeb7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

link

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,14 @@ if (!is_dir("$argv[1]/vendor/symfony")) {
3535
}
3636

3737
$sfPackages = array('symfony/symfony' => __DIR__);
38+
39+
$filesystem = new Filesystem();
3840
foreach (glob(__DIR__.'/src/Symfony/{Bundle,Bridge,Component,Component/Security}/*', GLOB_BRACE | GLOB_ONLYDIR | GLOB_NOSORT) as $dir) {
39-
$sfPackages[json_decode(file_get_contents("$dir/composer.json"))->name] = $dir;
41+
if ($filesystem->exists($composer = "$dir/composer.json")) {
42+
$sfPackages[json_decode(file_get_contents($composer))->name] = $dir;
43+
}
4044
}
4145

42-
$filesystem = new Filesystem();
4346
foreach (glob("$argv[1]/vendor/symfony/*", GLOB_ONLYDIR | GLOB_NOSORT) as $dir) {
4447
$package = 'symfony/'.basename($dir);
4548
if (is_link($dir)) {

0 commit comments

Comments
 (0)