How to get the root package path using composer
<p>I'm developing a PHP component called <a href="https://github.com/robotdance/php-app-config" rel="noreferrer">php-app-config</a> using <a href="https://getcomposer.org/" rel="noreferrer">composer</a>. 
This component, once required by another project, and installed using <code>composer install</code>, should look for config files inside the config folder of the <a href="https://getcomposer.org/doc/04-schema.md#root-package" rel="noreferrer">root package</a>, something like <code>root_package/config/config.yml</code>.</p>

<p>The <code>./config/config.yml</code> should exists only in the root package and not inside the component imported by the "require:" in <code>composer.json</code>, as below:</p>

<pre><code>▾ root-package/
  ▸ bin/
  ▸ build/
  ▾ config/
    ▸ locales/
      config.yml
  ▸ src/
  ▸ tests/
  ▾ vendor/
    ▸ composer/
    ▸ phpdocumentor/
    ▸ phpspec/
    ▸ phpunit/
    ▾ robotdance/
      ▾ php-app-config/
        ▾ src/                                                                                                                                                                                               
      Config.php -&gt; how to get the root "config/config.yml" path from here?
        ▸ tests/
      composer.json
      composer.lock
      phpunit.xml
      README.md
</code></pre>

<p>The root package can be a web app or command line utility.
Is there any way to get the root package path using composer? If not, what is the better way?</p>