@@ -98,18 +98,31 @@ private function registerClientConfiguration(array $config, ContainerBuilder $co
98
98
}
99
99
}
100
100
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
+
101
118
if (isset ($ defOptions ['cache_type ' ])) {
102
119
$ defOptions ['cache_type ' ] = $ this ->getCacheType ($ defOptions ['cache_type ' ]);
103
120
}
104
121
105
122
$ definition ->replaceArgument (1 , $ defOptions );
106
123
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 ));
113
126
114
127
$ this ->createClient ($ client , $ container );
115
128
}
@@ -120,9 +133,11 @@ private function createClientClassmap($client, array $classmap, ContainerBuilder
120
133
$ definition = new DefinitionDecorator ('besimple.soap.classmap ' );
121
134
$ container ->setDefinition (sprintf ('besimple.soap.classmap.%s ' , $ client ), $ definition );
122
135
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
+ }
126
141
127
142
return sprintf ('besimple.soap.classmap.%s ' , $ client );
128
143
}
@@ -132,7 +147,10 @@ private function createClient($client, ContainerBuilder $container)
132
147
$ definition = new DefinitionDecorator ('besimple.soap.client ' );
133
148
$ container ->setDefinition (sprintf ('besimple.soap.client.%s ' , $ client ), $ definition );
134
149
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
+ ));
136
154
}
137
155
138
156
private function createWebServiceContext (array $ config , ContainerBuilder $ container )
0 commit comments