mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-07 15:25:00 +00:00
generate document with relatorio: config and driver
This commit is contained in:
@@ -44,25 +44,6 @@ class ChillDocGeneratorExtension extends Extension implements PrependExtensionIn
|
||||
$this->prependClientConfig($container);
|
||||
}
|
||||
|
||||
private function prependClientConfig(ContainerBuilder $container)
|
||||
{
|
||||
$configs = $container->getExtensionConfig($this->getAlias());
|
||||
$resolvingBag = $container->getParameterBag();
|
||||
$configs = $resolvingBag->resolveValue($configs);
|
||||
|
||||
$config = $this->processConfiguration(new Configuration(), $configs);
|
||||
|
||||
$container->prependExtensionConfig('framework', [
|
||||
'http_client' => [
|
||||
'scoped_clients' => [
|
||||
'relatorio.client' => [
|
||||
'scope' => $config['driver']['relatorio']['url'],
|
||||
]
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
protected function prependCruds(ContainerBuilder $container)
|
||||
{
|
||||
$container->prependExtensionConfig('chill_main', [
|
||||
@@ -102,4 +83,23 @@ class ChillDocGeneratorExtension extends Extension implements PrependExtensionIn
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
private function prependClientConfig(ContainerBuilder $container)
|
||||
{
|
||||
$configs = $container->getExtensionConfig($this->getAlias());
|
||||
$resolvingBag = $container->getParameterBag();
|
||||
$configs = $resolvingBag->resolveValue($configs);
|
||||
|
||||
$config = $this->processConfiguration(new Configuration(), $configs);
|
||||
|
||||
$container->prependExtensionConfig('framework', [
|
||||
'http_client' => [
|
||||
'scoped_clients' => [
|
||||
'relatorio.client' => [
|
||||
'scope' => $config['driver']['relatorio']['url'],
|
||||
],
|
||||
],
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@@ -23,27 +23,26 @@ class Configuration implements ConfigurationInterface
|
||||
|
||||
$rootNode
|
||||
->children()
|
||||
->arrayNode('driver')
|
||||
->addDefaultsIfNotSet()
|
||||
->children()
|
||||
->enumNode('type')
|
||||
->isRequired()
|
||||
->values(['relatorio'])
|
||||
->defaultValue('relatorio')
|
||||
->end()
|
||||
->arrayNode('relatorio')
|
||||
->addDefaultsIfNotSet()
|
||||
->children()
|
||||
->scalarNode('url')
|
||||
->isRequired()
|
||||
->defaultValue('http://relatorio:8888/')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('driver')
|
||||
->addDefaultsIfNotSet()
|
||||
->children()
|
||||
->enumNode('type')
|
||||
->isRequired()
|
||||
->values(['relatorio'])
|
||||
->defaultValue('relatorio')
|
||||
->end()
|
||||
;
|
||||
->arrayNode('relatorio')
|
||||
->addDefaultsIfNotSet()
|
||||
->children()
|
||||
->scalarNode('url')
|
||||
->isRequired()
|
||||
->defaultValue('http://relatorio:8888/')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end();
|
||||
|
||||
return $treeBuilder;
|
||||
}
|
||||
|
Reference in New Issue
Block a user