Deleted "name" element in the configuration of services
This commit is contained in:
parent
581ebaf865
commit
81118f8d47
|
@ -33,11 +33,9 @@ class Configuration
|
||||||
$rootNode
|
$rootNode
|
||||||
->children()
|
->children()
|
||||||
->arrayNode('services')
|
->arrayNode('services')
|
||||||
|
->useAttributeAsKey('name')
|
||||||
->prototype('array')
|
->prototype('array')
|
||||||
->children()
|
->children()
|
||||||
->scalarNode('name')
|
|
||||||
->isRequired()
|
|
||||||
->end()
|
|
||||||
->scalarNode('namespace')
|
->scalarNode('namespace')
|
||||||
->isRequired()
|
->isRequired()
|
||||||
->end()
|
->end()
|
||||||
|
|
|
@ -44,12 +44,12 @@ class WebServiceExtension extends Extension
|
||||||
|
|
||||||
$config = $processor->process($configuration->getConfigTree(), $configs);
|
$config = $processor->process($configuration->getConfigTree(), $configs);
|
||||||
|
|
||||||
foreach($config['services'] as $serviceContextConfig) {
|
foreach($config['services'] as $name => $serviceConfig) {
|
||||||
$this->createWebServiceContext($serviceContextConfig, $container);
|
$this->createWebServiceContext($name, $serviceConfig, $container);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function createWebServiceContext(array $config, ContainerBuilder $container)
|
private function createWebServiceContext($name, array $config, ContainerBuilder $container)
|
||||||
{
|
{
|
||||||
$bindingDependentArguments = array(1, 3, 4);
|
$bindingDependentArguments = array(1, 3, 4);
|
||||||
$bindingSuffix = $this->bindingConfigToServiceSuffixMap[$config['binding']];
|
$bindingSuffix = $this->bindingConfigToServiceSuffixMap[$config['binding']];
|
||||||
|
@ -58,7 +58,7 @@ class WebServiceExtension extends Extension
|
||||||
$contextPrototype = $container->getDefinition('webservice.context');
|
$contextPrototype = $container->getDefinition('webservice.context');
|
||||||
$contextPrototypeArguments = $contextPrototype->getArguments();
|
$contextPrototypeArguments = $contextPrototype->getArguments();
|
||||||
|
|
||||||
$contextId = 'webservice.context.'.$config['name'];
|
$contextId = 'webservice.context.'.$name;
|
||||||
$context = $container->setDefinition($contextId, new DefinitionDecorator('webservice.context'));
|
$context = $container->setDefinition($contextId, new DefinitionDecorator('webservice.context'));
|
||||||
|
|
||||||
$arguments = array();
|
$arguments = array();
|
||||||
|
|
|
@ -26,8 +26,7 @@ QuickStart
|
||||||
|
|
||||||
web_service:
|
web_service:
|
||||||
services:
|
services:
|
||||||
demoapi:
|
DemoApi:
|
||||||
name: DemoApi
|
|
||||||
namespace: http://mysymfonyapp.com/ws/DemoApi/1.0/
|
namespace: http://mysymfonyapp.com/ws/DemoApi/1.0/
|
||||||
binding: rpc-literal
|
binding: rpc-literal
|
||||||
resource: "@AcmeDemoBundle/Controller/DemoController.php"
|
resource: "@AcmeDemoBundle/Controller/DemoController.php"
|
||||||
|
|
Loading…
Reference in New Issue