-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
merging configs #51
Comments
What would you want? Being able to call it twice and have the 2 configs merged? I would probably add a method to load the config array into the Config object without configuring it (i.e. parse and interpret). /**
* Load configuration options from a file or a string without configuring Cascade
*
* @param string $resource path to config file or string or array
*/
public static function loadConfig($resource)
{
self::$config = new Config($resource, new ConfigLoader());
self::$config->load();
} And then call it one or more times: Cascade::loadConfig('./my/first_config.yml');
Cascade::loadConfig('./my/second_config.yml');
Cascade::getConfig()->configure(); You would also need to add an |
The alternative would be to do the merging offline before you even use Cascade. You read your config files merge them into an array using |
yup. i already went with the array way. but for future would be good if cascade supported this out of the box. symfony does so ;) |
Idea taken from theorchard/monolog-cascade#51
hi
i would like to have "dist" config and "local" configs, so most of the things, like declaring formatters, processors, handlers are done in "dist" file and loggers from "local" file
from current code reading i see Cascade::fileConfig would just overwrite
self::$config
, so no merging there.The text was updated successfully, but these errors were encountered: