Deleted "name" element in the configuration of services

This commit is contained in:
Francis Besset 2011-07-14 18:39:47 +02:00
parent 581ebaf865
commit 81118f8d47
3 changed files with 6 additions and 9 deletions

View File

@ -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()

View File

@ -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();

View File

@ -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"