Skip to content

Commit 856ba6d

Browse files
authored
Merge pull request #91 from clue-labs/php
Documentation for supported PHP versions
2 parents 773417f + 2589d0f commit 856ba6d

2 files changed

Lines changed: 31 additions & 1 deletion

File tree

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,36 @@ $ composer require react/socket-client:^0.6.1
424424

425425
More details about version upgrades can be found in the [CHANGELOG](CHANGELOG.md).
426426

427+
This project supports running on legacy PHP 5.3 through current PHP 7+ and HHVM.
428+
It's *highly recommended to use PHP 7+* for this project, partly due to its vast
429+
performance improvements and partly because legacy PHP versions require several
430+
workarounds as described below.
431+
432+
Secure TLS connections received some major upgrades starting with PHP 5.6, with
433+
the defaults now being more secure, while older versions required explicit
434+
context options.
435+
This library does not take responsibility over these context options, so it's
436+
up to consumers of this library to take care of setting appropriate context
437+
options as described above.
438+
439+
All versions of PHP prior to 5.6.8 suffered from a buffering issue where reading
440+
from a streaming TLS connection could be one `data` event behind.
441+
This library implements a work-around to try to flush the complete incoming
442+
data buffers on these versions, but we have seen reports of people saying this
443+
could still affect some older versions (`5.5.23`, `5.6.7`, and `5.6.8`).
444+
Note that this only affects *some* higher-level streaming protocols, such as
445+
IRC over TLS, but should not affect HTTP over TLS (HTTPS).
446+
Further investigation of this issue is needed.
447+
For more insights, this issue is also covered by our test suite.
448+
449+
This project also supports running on HHVM.
450+
Note that really old HHVM < 3.8 does not support secure TLS connections, as it
451+
lacks the required `stream_socket_enable_crypto()` function.
452+
As such, trying to create a secure TLS connections on affected versions will
453+
return a rejected promise instead.
454+
This issue is also covered by our test suite, which will skip related tests
455+
on affected versions.
456+
427457
## Tests
428458

429459
To run the test suite, you first need to clone this repo and then install all

tests/SecureIntegrationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public function testConnectToServerWhichSendsDataWithoutEndingReceivesAllData()
176176
$peer->write($data);
177177
});
178178

179-
$client = Block\await($this->connector->connect($this->address), $this->loop);
179+
$client = Block\await($this->connector->connect($this->address), $this->loop, self::TIMEOUT);
180180
/* @var $client Stream */
181181

182182
// buffer incoming data for 0.1s (should be plenty of time)

0 commit comments

Comments
 (0)