Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make Predis v0.8 compatible with HHVM 2.4.0.

Since we cannot rely on the PHP version to detect the availability of
socket_import_stream(), we switched to function_exists(). As an added
bonus, using function_exists() is twice faster.
  • Loading branch information...
commit 60733eb5c900192cff775429aff669badb5fffc0 1 parent a13dd4e
@nrk authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/Predis/Connection/StreamConnection.php
View
2  lib/Predis/Connection/StreamConnection.php
@@ -104,7 +104,7 @@ private function tcpStreamInitializer(ConnectionParametersInterface $parameters)
stream_set_timeout($resource, $timeoutSeconds, $timeoutUSeconds);
}
- if (isset($parameters->tcp_nodelay) && version_compare(PHP_VERSION, '5.4.0') >= 0) {
+ if (isset($parameters->tcp_nodelay) && function_exists('socket_import_stream')) {
$socket = socket_import_stream($resource);
socket_set_option($socket, SOL_TCP, TCP_NODELAY, (int) $parameters->tcp_nodelay);
}
Please sign in to comment.
Something went wrong with that request. Please try again.