diff --git a/.travis.yml b/.travis.yml index f9fa957..cf1da5c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,10 +5,6 @@ dist: trusty matrix: include: - - php: 5.3 - dist: precise - script: - - vendor/bin/phpunit --coverage-text --verbose || [[ $? = 139 ]] # ignore SEGFAULT on legacy PHP 5.3 only - php: 5.4 - php: 5.5 - php: 5.6 @@ -24,10 +20,8 @@ matrix: - choco install php - choco install composer - export PATH="$(powershell -Command '("Process", "Machine" | % { [Environment]::GetEnvironmentVariable("PATH", $_) -Split ";" -Replace "\\$", "" } | Select -Unique | % { cygpath $_ }) -Join ":"')" - - php: hhvm-3.18 allow_failures: - os: windows - - php: hhvm-3.18 install: - composer install --no-interaction diff --git a/README.md b/README.md index 5544d77..1127cb7 100644 --- a/README.md +++ b/README.md @@ -225,13 +225,10 @@ See also [`Compressor`](#compressor) for more details. ### Inconsistencies The stream compression filters are not exactly the most commonly used features of PHP. -As such, we've spotted several inconsistencies (or *bugs*) between different PHP versions and HHVM. +As such, we've spotted some inconsistencies (or *bugs*) in different PHP versions. These inconsistencies exist in the underlying PHP engines and there's little we can do about this in this library. -* All Zend PHP versions: Decompressing invalid data does not emit any data (and does not raise an error) -* HHVM only: does not currently support the GZIP and ZLIB format at all (and does not raise an error) -* HHVM only: The [`zlib.deflate` filter function](https://github.com/facebook/hhvm/blob/fee8ae39ce395c7b9b8910dfde6f22a7745aea83/hphp/system/php/stream/default-filters.php#L77) buffers the whole string. This means that compressing a stream of 100 MB actually stores the whole string in memory before invoking the underlying compression algorithm. -* PHP 5.3 only: Tends to SEGFAULT occasionally on shutdown? +* All PHP versions: Decompressing invalid data does not emit any data (and does not raise an error) Our test suite contains several test cases that exhibit these issues. If you feel some test case is missing or outdated, we're happy to accept PRs! :) @@ -251,16 +248,18 @@ $ composer require clue/zlib-react:^0.2.2 See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. This project aims to run on any platform and thus does not require any PHP -extensions and supports running on legacy PHP 5.3 through current PHP 7+ and -HHVM. +extensions and supports running on legacy PHP 5.4 through current PHP 7+. It's *highly recommended to use PHP 7+* for this project. -Older PHP versions may suffer from a number of inconsistencies documented above. The `ext-zlib` extension is not required to install this library, however it is required to actually do anything meaningful with this library. Each of the above methods will throw an `Exception` if this extension is missing. +We're committed to providing a smooth upgrade path for legacy setups. +If you need to support legacy PHP 5.3 and legacy HHVM, you may want to check out +the legacy `v0.2.x` release branch. + ## Tests To run the test suite, you first need to clone this repo and then install all diff --git a/composer.json b/composer.json index 627c9c6..0205427 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } ], "require": { - "php": ">=5.3", + "php": ">=5.4", "clue/stream-filter": "~1.3", "react/stream": "^1.0 || ^0.7 || ^0.6" }, diff --git a/examples/91-benchmark-compress.php b/examples/91-benchmark-compress.php index 7a0c31b..9aca737 100644 --- a/examples/91-benchmark-compress.php +++ b/examples/91-benchmark-compress.php @@ -23,7 +23,7 @@ } if (!defined('ZLIB_ENCODING_GZIP')) { - fwrite(STDERR, 'Requires PHP 5.4+ with ext-zlib enabled' . PHP_EOL); + fwrite(STDERR, 'Requires PHP with ext-zlib enabled' . PHP_EOL); exit(1); } diff --git a/examples/92-benchmark-decompress.php b/examples/92-benchmark-decompress.php index a8a06ba..dcf427f 100644 --- a/examples/92-benchmark-decompress.php +++ b/examples/92-benchmark-decompress.php @@ -27,7 +27,7 @@ } if (!defined('ZLIB_ENCODING_GZIP')) { - fwrite(STDERR, 'Requires PHP 5.4+ with ext-zlib enabled' . PHP_EOL); + fwrite(STDERR, 'Requires PHP with ext-zlib enabled' . PHP_EOL); exit(1); } diff --git a/examples/gunzip.php b/examples/gunzip.php index 98b70bf..d5cf995 100644 --- a/examples/gunzip.php +++ b/examples/gunzip.php @@ -8,7 +8,7 @@ } if (!defined('ZLIB_ENCODING_GZIP')) { - fwrite(STDERR, 'Requires PHP 5.4+ with ext-zlib enabled' . PHP_EOL); + fwrite(STDERR, 'Requires PHP with ext-zlib enabled' . PHP_EOL); exit(1); } diff --git a/examples/gzip.php b/examples/gzip.php index f09c464..a761da1 100644 --- a/examples/gzip.php +++ b/examples/gzip.php @@ -8,7 +8,7 @@ } if (!defined('ZLIB_ENCODING_GZIP')) { - fwrite(STDERR, 'Requires PHP 5.4+ with ext-zlib enabled' . PHP_EOL); + fwrite(STDERR, 'Requires PHP with ext-zlib enabled' . PHP_EOL); exit(1); } diff --git a/tests/FunctionalExamplesTest.php b/tests/FunctionalExamplesTest.php index 41eaa08..e0431e7 100644 --- a/tests/FunctionalExamplesTest.php +++ b/tests/FunctionalExamplesTest.php @@ -7,9 +7,6 @@ public function setUp() if (DIRECTORY_SEPARATOR === '\\') { $this->markTestSkipped('Non-blocking console I/O not supported on Windows'); } - if (defined('HHVM_VERSION')) { - $this->markTestSkipped('Not supported on HHVM (ignores window size / encoding format)'); - } } public function testChain() { diff --git a/tests/ZlibFilterDeflateDecompressorTest.php b/tests/ZlibFilterDeflateDecompressorTest.php index 7741a00..84e5d96 100644 --- a/tests/ZlibFilterDeflateDecompressorTest.php +++ b/tests/ZlibFilterDeflateDecompressorTest.php @@ -33,8 +33,6 @@ public function testInflateHelloWorld() public function testInflateBig() { - if (defined('HHVM_VERSION')) $this->markTestSkipped('Not supported on HHVM (final chunk will not be emitted)'); - $this->decompressor->on('data', function ($data) use (&$buffered) { $buffered .= $data; }); @@ -52,7 +50,7 @@ public function testInflateBig() public function testInflateInvalid() { - if (!defined('HHVM_VERSION')) $this->markTestSkipped('Only supported on HHVM (other engines do not reject invalid data)'); + $this->markTestSkipped('Not supported by any PHP version (neither does reject invalid data)'); $this->decompressor->on('data', $this->expectCallableNever()); $this->decompressor->on('error', $this->expectCallableOnce()); diff --git a/tests/ZlibFilterGzipCompressorTest.php b/tests/ZlibFilterGzipCompressorTest.php index e1817f0..5c701a3 100644 --- a/tests/ZlibFilterGzipCompressorTest.php +++ b/tests/ZlibFilterGzipCompressorTest.php @@ -8,8 +8,6 @@ class ZlibFilterGzipCompressorTest extends TestCase public function setUp() { - if (defined('HHVM_VERSION')) $this->markTestSkipped('Not supported on HHVM (ignores window size / encoding format)'); - $this->compressor = ZlibFilterStream::createGzipCompressor(); } diff --git a/tests/ZlibFilterGzipDecompressorTest.php b/tests/ZlibFilterGzipDecompressorTest.php index bb0cb5e..4730299 100644 --- a/tests/ZlibFilterGzipDecompressorTest.php +++ b/tests/ZlibFilterGzipDecompressorTest.php @@ -8,8 +8,6 @@ class ZlibFilterGzipDecompressorTest extends TestCase public function setUp() { - if (defined('HHVM_VERSION')) $this->markTestSkipped('Not supported on HHVM (ignores window size / encoding format)'); - $this->decompressor = ZlibFilterStream::createGzipDecompressor(); } @@ -52,7 +50,7 @@ public function testDecompressBig() public function testDecompressInvalid() { - $this->markTestSkipped('Not supported by any PHP engine (neither does reject invalid data)'); + $this->markTestSkipped('Not supported by any PHP version (neither does reject invalid data)'); $this->decompressor->on('data', $this->expectCallableNever()); $this->decompressor->on('error', $this->expectCallableOnce()); diff --git a/tests/ZlibFilterZlibCompressorTest.php b/tests/ZlibFilterZlibCompressorTest.php index b927f8b..f218bba 100644 --- a/tests/ZlibFilterZlibCompressorTest.php +++ b/tests/ZlibFilterZlibCompressorTest.php @@ -8,8 +8,6 @@ class ZlibFilterZlibCompressorTest extends TestCase public function setUp() { - if (defined('HHVM_VERSION')) $this->markTestSkipped('Not supported on HHVM (ignores window size / encoding format)'); - $this->compressor = ZlibFilterStream::createZlibCompressor(); } diff --git a/tests/ZlibFilterZlibDecompressorTest.php b/tests/ZlibFilterZlibDecompressorTest.php index 4cd427f..a6c1f9a 100644 --- a/tests/ZlibFilterZlibDecompressorTest.php +++ b/tests/ZlibFilterZlibDecompressorTest.php @@ -8,8 +8,6 @@ class ZlibFilterZlibDecompressorTest extends TestCase public function setUp() { - if (defined('HHVM_VERSION')) $this->markTestSkipped('Not supported on HHVM (ignores window size / encoding format)'); - $this->decompressor = ZlibFilterStream::createZlibDecompressor(); } @@ -52,7 +50,7 @@ public function testDecompressBig() public function testDecompressInvalid() { - $this->markTestSkipped('Not supported by any PHP engine (neither does reject invalid data)'); + $this->markTestSkipped('Not supported by any PHP version (neither does reject invalid data)'); $this->decompressor->on('data', $this->expectCallableNever()); $this->decompressor->on('error', $this->expectCallableOnce());