1 | <?php |
||
13 | class Extension implements ExtensionInterface |
||
14 | { |
||
15 | public function load(ContainerBuilder $container, array $config) |
||
16 | { |
||
17 | $container->setParameter('rezzza.json_api.rest.base_url', $config['rest']['base_url']); |
||
18 | $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/Resources')); |
||
19 | $loader->load('services.xml'); |
||
20 | |||
21 | if (true === $config['rest']['store_response']) { |
||
22 | $definitionRestApiBrowser = $container->findDefinition('rezzza.json_api.rest.rest_api_browser'); |
||
23 | $definitionRestApiBrowser->addMethodCall('enableResponseStorage', [new Reference('rezzza.json_api.json.json_storage')]); |
||
24 | } |
||
25 | } |
||
26 | |||
27 | public function configure(ArrayNodeDefinition $builder) |
||
28 | { |
||
29 | $builder |
||
30 | ->addDefaultsIfNotSet() |
||
31 | ->children() |
||
32 | ->arrayNode('rest') |
||
33 | ->addDefaultsIfNotSet() |
||
34 | ->children() |
||
35 | ->scalarNode('base_url')->end() |
||
36 | ->booleanNode('store_response') |
||
37 | ->defaultTrue()->end() |
||
38 | ->end() |
||
39 | ->end() |
||
40 | ->end() |
||
41 | ->end() |
||
42 | ; |
||
43 | } |
||
44 | |||
45 | public function getConfigKey() |
||
49 | |||
50 | public function process(ContainerBuilder $container) |
||
53 | |||
54 | public function initialize(ExtensionManager $extensionManager) |
||
57 | } |
||
58 | |||
59 |