Skip to content

Commit 3f9bd76

Browse files
committed
Bug fixes due to the new version of fxmlrpc (0.12.x)
1 parent caf9cc6 commit 3f9bd76

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
"require": {
1919
"php": ">=5.4.0",
2020
"lstrojny/fxmlrpc": "~0.10",
21-
"egeloen/http-adapter": "~0.8"
21+
"php-http/message": "^1.2",
22+
"php-http/curl-client": "^1.4",
23+
"zendframework/zend-diactoros": "^1.3"
2224
},
2325
"require-dev": {
2426
"phpunit/phpunit": ">=4.0.0"

lib/GameNet/Jabber/RpcClient.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@
3434
use fXmlRpc\Client;
3535
use fXmlRpc\Serializer\NativeSerializer;
3636
use fXmlRpc\Transport\HttpAdapterTransport;
37-
use Ivory\HttpAdapter\CurlHttpAdapter;
38-
use Ivory\HttpAdapter\Configuration;
37+
use Http\Client\Curl;
38+
use Http\Message\MessageFactory\DiactorosMessageFactory;
39+
use Http\Message\StreamFactory\DiactorosStreamFactory;
3940

4041
/**
4142
* Class RpcClient
@@ -133,11 +134,12 @@ public function getTimeout()
133134

134135
protected function sendRequest($command, array $params)
135136
{
136-
$config = new Configuration();
137-
$config->setTimeout($this->getTimeout());
138-
$config->setUserAgent('GameNet');
139-
140-
$transport = new HttpAdapterTransport(new CurlHttpAdapter($config));
137+
$options = [
138+
CURLOPT_USERAGENT => $this->getTimeout(),
139+
CURLOPT_SSL_VERIFYPEER => 'GameNet',
140+
];
141+
$httpClient = new Curl\Client(new DiactorosMessageFactory(), new DiactorosStreamFactory(), $options);
142+
$transport = new HttpAdapterTransport(new DiactorosMessageFactory(), $httpClient);
141143
$client = new Client($this->server, $transport, null, new NativeSerializer());
142144

143145
if ($this->username && $this->password) {

0 commit comments

Comments
 (0)