This is originally meant to port the whole resolver chain into configuration,
but doesn't work because some options are taken from other configuration paths.
Need to come up with a referencing mechanism of a config value from one another,
along with expressions and default values.
But then creating too much custom syntax just ruined the whole idea.
$resolvers = conf::get('web::resolvers');
array_walk($resolvers, function($options) use($resolver) {
if ( empty($options['enable']) || $options['enable'] ) {
// FQCN or prepends with "resolvers\" namespace.
if ( strpos($options['class'], '\\') === false ) {
$options['class'] = "resolvers\\$options[class]";
}
$args = array(
new $options['class']((array) $options['options'])
);
if ( !empty($options['weight']) ) {
$args[] = $options['weight'];
}
call_user_func_array(array($resolver, 'registerResolver'), $args);
}
});
unset($resolvers);
This is originally meant to port the whole resolver chain into configuration, but doesn't work because some options are taken from other configuration paths.
Need to come up with a referencing mechanism of a config value from one another, along with expressions and default values.
But then creating too much custom syntax just ruined the whole idea.
Designated config format: