我正在使用composer开发一个名为php-app-config的PHP组件.这个组件,一旦需要另一个项目,并使用,应该在根包的config文件夹中查找配置文件,如.composer installroot_package/config/config.yml
所述./config/config.yml应该只存在于根包,而不是由进口组件里面的"要求"中composer.json,如下:
? root-package/
? bin/
? build/
? config/
? locales/
config.yml
? src/
? tests/
? vendor/
? composer/
? phpdocumentor/
? phpspec/
? phpunit/
? robotdance/
? php-app-config/
? src/
Config.php -> how to get the root "config/config.yml" path from here?
? tests/
composer.json
composer.lock
phpunit.xml
README.md
Run Code Online (Sandbox Code Playgroud)
根包可以是Web应用程序或命令行实用程序.有没有办法使用composer获取根包路径?如果没有,有什么更好的方法?