Fixed DIC

This commit is contained in:
Francis Besset 2011-07-14 18:13:34 +02:00
parent 51d1d28830
commit 581ebaf865
2 changed files with 12 additions and 6 deletions

View File

@ -58,13 +58,16 @@ 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.'.$config['name'];
$context = $container->setDefinition($contextId, new DefinitionDecorator('webservice.context')); $context = $container->setDefinition($contextId, new DefinitionDecorator('webservice.context'));
$arguments = array();
foreach($bindingDependentArguments as $idx) { foreach($bindingDependentArguments as $idx) {
$context->setArgument($idx, new Reference($contextPrototypeArguments[$idx] . $bindingSuffix)); $arguments[] = new Reference($contextPrototypeArguments[$idx].$bindingSuffix);
} }
$context->setArgument(5, array_merge($contextPrototypeArguments[5], $config)); $arguments[5] = array_merge($contextPrototypeArguments[5], $config);
$context->setArguments($arguments);
} }
public function getNamespace() public function getNamespace()

View File

@ -54,11 +54,14 @@
<service id="webservice.definition.loader.annot_class" class="Bundle\WebServiceBundle\ServiceDefinition\Loader\AnnotationClassLoader"> <service id="webservice.definition.loader.annot_class" class="Bundle\WebServiceBundle\ServiceDefinition\Loader\AnnotationClassLoader">
<tag name="webservice.definition.loader" /> <tag name="webservice.definition.loader" />
<argument type="service" id="webservice.annotations.reader" /> <argument type="service" id="webservice.annotations.reader" />
<argument type="service" id="annotations.configuration_reader" /> <argument type="service" id="annotations.configuration_reader" on-invalid="null" />
</service> </service>
<service id="webservice.definition.dumper.wsdl.rpcliteral" class="Bundle\WebServiceBundle\ServiceDefinition\Dumper\WsdlDumper"> <service id="webservice.definition.dumper.wsdl.rpcliteral" class="Bundle\WebServiceBundle\ServiceDefinition\Dumper\WsdlDumper" />
</service> <service id="webservice.definition.dumper.wsdl" alias="webservice.definition.dumper.wsdl.rpcliteral" />
<service id="webservice.binder.request" alias="webservice.binder.request.rpcliteral" />
<service id="webservice.binder.response" alias="webservice.binder.response.rpcliteral" />
</services> </services>
</container> </container>