Skip to content

Commit e33b55f

Browse files
authored
Merge pull request #22 from homiedopie/hotfix/PHP-1
PHP-1 - Fix guzzle and other dependencies to support lower version
2 parents 4cb92ee + 3f61f12 commit e33b55f

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@
88
"require": {
99
"php": ">=5.3.0",
1010
"psr/log": "~1.0",
11-
"guzzlehttp/guzzle": "^6.3",
1211
"guzzlehttp/psr7": "^1.6",
13-
"php-http/socket-client": "^2.0",
14-
"php-http/message": "^1.8"
12+
"php-http/socket-client": "^1.4 | ^2.0",
13+
"php-http/message": "^1.7"
1514
},
1615
"autoload": {
1716
"psr-4": {

src/Stackify/Log/Transport/AgentSocketTransport.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,14 @@ protected function send($data)
5050
try {
5151
if (!empty($data)) {
5252
$messageFactory = new GuzzleMessageFactory();
53-
$client = new Client($messageFactory, null, array('remote_socket' => 'unix://' . $this->getDomainSocketPath()));
53+
$client = null;
54+
$config = array('remote_socket' => 'unix://' . $this->getDomainSocketPath());
55+
56+
if (version_compare(phpversion(), '7.1', '>=')) {
57+
$client = new Client($config);
58+
} else {
59+
$client = new Client($messageFactory, $config);
60+
}
5461

5562
$request = $messageFactory->createRequest(
5663
'POST',

0 commit comments

Comments
 (0)