Try to prevent triggering warnings in composer package source
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3084615. -->
Reported by: [feyp](https://www.drupal.org/user/998680)
>>>
<h2>Synopsis</h2>
<p>To support different kinds of composer setups, for Drupal Core, we try to read a composer.json from different places on the file system. One of those places is one level above the document root. Depending on the kind of composer setup and system configuration, this might trigger a PHP warning. Let's try to prevent those without using evil stuff like <code>@</code>.</p>
<h2>Proposed resolution</h2>
<p>Checking <code>stream_resolve_include_path()</code> should prevent warnings, that would otherwise be triggered by <code>realpath()</code> or <code>file_exists()</code>, so let's call it before doing anything else.</p>
issue