Skip to content

First class support for PHP7 and HHVM #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,11 @@ php:
- 5.6
- 7
- hhvm
- hhvm-nightly

matrix:
allow_failures:
- php: 7
- php: hhvm
- php: hhvm-nightly
fast_finish: true
sudo: false

before_script:
- composer install --dev --prefer-source
install:
- composer install --prefer-source --no-interaction

script:
- phpunit --coverage-text
5 changes: 5 additions & 0 deletions src/SecureConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use React\EventLoop\LoopInterface;
use React\Stream\Stream;
use React\Promise;

class SecureConnector implements ConnectorInterface
{
Expand All @@ -18,6 +19,10 @@ public function __construct(ConnectorInterface $connector, LoopInterface $loop)

public function create($host, $port)
{
if (!function_exists('stream_socket_enable_crypto')) {
return Promise\reject(new \BadMethodCallException('Encryption not supported on your platform (HHVM < 3.8?)'));
}

return $this->connector->create($host, $port)->then(function (Stream $stream) use ($host) {
// (unencrypted) TCP/IP connection succeeded

Expand Down
4 changes: 4 additions & 0 deletions tests/IntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ public function gettingStuffFromGoogleShouldWork()
/** @test */
public function gettingEncryptedStuffFromGoogleShouldWork()
{
if (defined('HHVM_VERSION')) {
$this->markTestSkipped('Not supported on HHVM');
}

$loop = new StreamSelectLoop();

$factory = new Factory();
Expand Down