Skip to content

Commit

Permalink
Merge pull request #94 from clue-labs/compat
Browse files Browse the repository at this point in the history
Work around latest PHP 7.0.18 and 7.1.4 no longer accepting full URIs
  • Loading branch information
WyriHaximus authored Apr 23, 2017
2 parents 57e3262 + 375688c commit 6e43a55
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/TcpConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,12 @@ public function connect($uri)
}
}

// HHVM fails to parse URIs with a query but no path, so let's add a dummy path
// See also https://3v4l.org/jEhLF
if (defined('HHVM_VERSION') && isset($parts['query']) && !isset($parts['path'])) {
$uri = str_replace('?', '/?', $uri); // @codeCoverageIgnore
}
// latest versions of PHP no longer accept any other URI components and
// HHVM fails to parse URIs with a query but no path, so let's simplify our URI here
$remote = 'tcp://' . $parts['host'] . ':' . $parts['port'];

$socket = @stream_socket_client(
$uri,
$remote,
$errno,
$errstr,
0,
Expand Down

0 comments on commit 6e43a55

Please sign in to comment.