@@ -98,18 +98,31 @@ private function registerClientConfiguration(array $config, ContainerBuilder $co
9898 }
9999 }
100100
101+ $ proxy = $ options ['proxy ' ];
102+ if (false !== $ proxy ['host ' ]) {
103+ if (null !== $ proxy ['auth ' ]) {
104+ if ('basic ' === $ proxy ['auth ' ]) {
105+ $ proxy ['auth ' ] = \CURLAUTH_BASIC ;
106+ } elseif ('ntlm ' === $ proxy ['auth ' ]) {
107+ $ proxy ['auth ' ] = \CURLAUTH_NTLM ;
108+ }
109+ }
110+
111+ $ definition ->addMethodCall ('withProxy ' , array (
112+ $ proxy ['host ' ], $ proxy ['port ' ],
113+ $ proxy ['login ' ], $ proxy ['password ' ],
114+ $ proxy ['auth ' ]
115+ ));
116+ }
117+
101118 if (isset ($ defOptions ['cache_type ' ])) {
102119 $ defOptions ['cache_type ' ] = $ this ->getCacheType ($ defOptions ['cache_type ' ]);
103120 }
104121
105122 $ definition ->replaceArgument (1 , $ defOptions );
106123
107- if (!empty ($ options ['classmap ' ])) {
108- $ classmap = $ this ->createClientClassmap ($ client , $ options ['classmap ' ], $ container );
109- $ definition ->replaceArgument (2 , new Reference ($ classmap ));
110- } else {
111- $ definition ->replaceArgument (2 , null );
112- }
124+ $ classmap = $ this ->createClientClassmap ($ client , $ options ['classmap ' ], $ container );
125+ $ definition ->replaceArgument (2 , new Reference ($ classmap ));
113126
114127 $ this ->createClient ($ client , $ container );
115128 }
@@ -120,9 +133,11 @@ private function createClientClassmap($client, array $classmap, ContainerBuilder
120133 $ definition = new DefinitionDecorator ('besimple.soap.classmap ' );
121134 $ container ->setDefinition (sprintf ('besimple.soap.classmap.%s ' , $ client ), $ definition );
122135
123- $ definition ->setMethodCalls (array (
124- array ('set ' , array ($ classmap )),
125- ));
136+ if (!empty ($ classmap )) {
137+ $ definition ->setMethodCalls (array (
138+ array ('set ' , array ($ classmap )),
139+ ));
140+ }
126141
127142 return sprintf ('besimple.soap.classmap.%s ' , $ client );
128143 }
@@ -132,7 +147,10 @@ private function createClient($client, ContainerBuilder $container)
132147 $ definition = new DefinitionDecorator ('besimple.soap.client ' );
133148 $ container ->setDefinition (sprintf ('besimple.soap.client.%s ' , $ client ), $ definition );
134149
135- $ definition ->setFactoryService (sprintf ('besimple.soap.client.builder.%s ' , $ client ));
150+ $ definition ->setFactory (array (
151+ new Reference (sprintf ('besimple.soap.client.builder.%s ' , $ client )),
152+ 'build '
153+ ));
136154 }
137155
138156 private function createWebServiceContext (array $ config , ContainerBuilder $ container )
0 commit comments