I'm creating a package for composer, and I'm wanting to (from inside a class in my package) check if a configuration option exists, and if not set a default.
Is there a best practice etc for package configuration (or is that done in composer.json)? I couldnt find anything on composers website. As in, is there a standard, like all apps should put key=>value pairs into an app/confg.php file for composer packages to use or anything like that?
Or should the package just document how to configure, seems like there would be a standard of some sorts so all packages aren't using different config methods
Usage: building a command line app in php, using Symfony's console component. want to allow the option to set a base directory other than the apps base dir (../ out of vendor folder)
ie
- the app lives at foo/
- package inside foo/vendor
- default base dir is foo/
- configuration option allows the pacakge to use foo/app as the base directory instead
I can set this as an option using Symfonys console package command --base="app"
, but I'm wondering if theres a way for the user to set it in a config file so they dont have to type it every time
Thanks so much for the help.