Compare commits

...

3 Commits

Author SHA1 Message Date
Daniele Alessandri 84060b9034 Update CHANGELOG and bump VERSION.
Hotfix release targeting a severe regression on HHVM, see commit d4a7bd5.
2015-07-30 20:34:15 +02:00
Daniele Alessandri d4a7bd52be Fix severe regression on HHVM.
Apparently HHVM is more strict than PHP in stream_socket_client() and does not
like at all IPv4 addresses and hostnames eclosed in square brackets. Note that
it is not that weird as square brackets are mandatory only when IPv6 addresses
are embedded in URI strings, so it is more like a weird incompatiblity of HHVM
with the behaviour of the standard PHP interpreter. The connect() attempt fails
but not due to the server being unavailable or some connectivity issue.

The important lesson is: never rely on undocumented behaviours especially when
targeting different runtimes, and do not forget to run the test suite on every
platform right before release like I unfortunately did.

This commit fixes #269.
2015-07-30 20:23:45 +02:00
Daniele Alessandri 16a9d4e041 Back to development.
[ci skip]
2015-07-30 19:41:27 +02:00
5 changed files with 17 additions and 4 deletions
+8
View File
@@ -1,3 +1,11 @@
v1.0.3 (2015-07-30)
================================================================================
- __FIX__: the previous release introduced a severe regression on HHVM that made
the library unable to connect to Redis when using IPv4 addresses. Code running
on the standard PHP interpreter is not affected.
v1.0.2 (2015-07-30)
================================================================================
+1 -1
View File
@@ -1 +1 @@
1.0.2
1.0.3
+1 -1
View File
@@ -10,7 +10,7 @@ name = "Predis"
desc = "Flexible and feature-complete PHP client library for Redis"
homepage = "http://github.com/nrk/predis"
license = "MIT"
version = "1.0.2"
version = "1.0.3"
stability = "stable"
channel = "pear.nrk.io"
+1 -1
View File
@@ -40,7 +40,7 @@ use Predis\Transaction\MultiExec as MultiExecTransaction;
*/
class Client implements ClientInterface
{
const VERSION = '1.0.2';
const VERSION = '1.0.3';
protected $connection;
protected $options;
+6 -1
View File
@@ -74,7 +74,12 @@ class StreamConnection extends AbstractConnection
*/
protected function tcpStreamInitializer(ParametersInterface $parameters)
{
$uri = "tcp://[$parameters->host]:$parameters->port";
if (!filter_var($parameters->host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
$uri = "tcp://$parameters->host:$parameters->port";
} else {
$uri = "tcp://[$parameters->host]:$parameters->port";
}
$flags = STREAM_CLIENT_CONNECT;
if (isset($parameters->async_connect) && (bool) $parameters->async_connect) {