Skip to content

Commit ccec995

Browse files
authored
Merge pull request #25 from clue-labs/php
Drop legacy PHP 5.3 and legacy HHVM support
2 parents e6a77ee + 5e2bae7 commit ccec995

13 files changed

+15
-35
lines changed

.travis.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ dist: trusty
55

66
matrix:
77
include:
8-
- php: 5.3
9-
dist: precise
10-
script:
11-
- vendor/bin/phpunit --coverage-text --verbose || [[ $? = 139 ]] # ignore SEGFAULT on legacy PHP 5.3 only
128
- php: 5.4
139
- php: 5.5
1410
- php: 5.6
@@ -24,10 +20,8 @@ matrix:
2420
- choco install php
2521
- choco install composer
2622
- export PATH="$(powershell -Command '("Process", "Machine" | % { [Environment]::GetEnvironmentVariable("PATH", $_) -Split ";" -Replace "\\$", "" } | Select -Unique | % { cygpath $_ }) -Join ":"')"
27-
- php: hhvm-3.18
2823
allow_failures:
2924
- os: windows
30-
- php: hhvm-3.18
3125

3226
install:
3327
- composer install --no-interaction

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,10 @@ See also [`Compressor`](#compressor) for more details.
225225
### Inconsistencies
226226

227227
The stream compression filters are not exactly the most commonly used features of PHP.
228-
As such, we've spotted several inconsistencies (or *bugs*) between different PHP versions and HHVM.
228+
As such, we've spotted some inconsistencies (or *bugs*) in different PHP versions.
229229
These inconsistencies exist in the underlying PHP engines and there's little we can do about this in this library.
230230

231-
* All Zend PHP versions: Decompressing invalid data does not emit any data (and does not raise an error)
232-
* HHVM only: does not currently support the GZIP and ZLIB format at all (and does not raise an error)
233-
* 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.
234-
* PHP 5.3 only: Tends to SEGFAULT occasionally on shutdown?
231+
* All PHP versions: Decompressing invalid data does not emit any data (and does not raise an error)
235232

236233
Our test suite contains several test cases that exhibit these issues.
237234
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
251248
See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.
252249

253250
This project aims to run on any platform and thus does not require any PHP
254-
extensions and supports running on legacy PHP 5.3 through current PHP 7+ and
255-
HHVM.
251+
extensions and supports running on legacy PHP 5.4 through current PHP 7+.
256252
It's *highly recommended to use PHP 7+* for this project.
257-
Older PHP versions may suffer from a number of inconsistencies documented above.
258253

259254
The `ext-zlib` extension is not required to install this library, however it
260255
is required to actually do anything meaningful with this library.
261256
Each of the above methods will throw an `Exception` if this extension is
262257
missing.
263258

259+
We're committed to providing a smooth upgrade path for legacy setups.
260+
If you need to support legacy PHP 5.3 and legacy HHVM, you may want to check out
261+
the legacy `v0.2.x` release branch.
262+
264263
## Tests
265264

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

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
}
1212
],
1313
"require": {
14-
"php": ">=5.3",
14+
"php": ">=5.4",
1515
"clue/stream-filter": "~1.3",
1616
"react/stream": "^1.0 || ^0.7 || ^0.6"
1717
},

examples/91-benchmark-compress.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
}
2424

2525
if (!defined('ZLIB_ENCODING_GZIP')) {
26-
fwrite(STDERR, 'Requires PHP 5.4+ with ext-zlib enabled' . PHP_EOL);
26+
fwrite(STDERR, 'Requires PHP with ext-zlib enabled' . PHP_EOL);
2727
exit(1);
2828
}
2929

examples/92-benchmark-decompress.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
}
2828

2929
if (!defined('ZLIB_ENCODING_GZIP')) {
30-
fwrite(STDERR, 'Requires PHP 5.4+ with ext-zlib enabled' . PHP_EOL);
30+
fwrite(STDERR, 'Requires PHP with ext-zlib enabled' . PHP_EOL);
3131
exit(1);
3232
}
3333

examples/gunzip.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
}
99

1010
if (!defined('ZLIB_ENCODING_GZIP')) {
11-
fwrite(STDERR, 'Requires PHP 5.4+ with ext-zlib enabled' . PHP_EOL);
11+
fwrite(STDERR, 'Requires PHP with ext-zlib enabled' . PHP_EOL);
1212
exit(1);
1313
}
1414

examples/gzip.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
}
99

1010
if (!defined('ZLIB_ENCODING_GZIP')) {
11-
fwrite(STDERR, 'Requires PHP 5.4+ with ext-zlib enabled' . PHP_EOL);
11+
fwrite(STDERR, 'Requires PHP with ext-zlib enabled' . PHP_EOL);
1212
exit(1);
1313
}
1414

tests/FunctionalExamplesTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ public function setUp()
77
if (DIRECTORY_SEPARATOR === '\\') {
88
$this->markTestSkipped('Non-blocking console I/O not supported on Windows');
99
}
10-
if (defined('HHVM_VERSION')) {
11-
$this->markTestSkipped('Not supported on HHVM (ignores window size / encoding format)');
12-
}
1310
}
1411
public function testChain()
1512
{

tests/ZlibFilterDeflateDecompressorTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ public function testInflateHelloWorld()
3333

3434
public function testInflateBig()
3535
{
36-
if (defined('HHVM_VERSION')) $this->markTestSkipped('Not supported on HHVM (final chunk will not be emitted)');
37-
3836
$this->decompressor->on('data', function ($data) use (&$buffered) {
3937
$buffered .= $data;
4038
});
@@ -52,7 +50,7 @@ public function testInflateBig()
5250

5351
public function testInflateInvalid()
5452
{
55-
if (!defined('HHVM_VERSION')) $this->markTestSkipped('Only supported on HHVM (other engines do not reject invalid data)');
53+
$this->markTestSkipped('Not supported by any PHP version (neither does reject invalid data)');
5654

5755
$this->decompressor->on('data', $this->expectCallableNever());
5856
$this->decompressor->on('error', $this->expectCallableOnce());

tests/ZlibFilterGzipCompressorTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ class ZlibFilterGzipCompressorTest extends TestCase
88

99
public function setUp()
1010
{
11-
if (defined('HHVM_VERSION')) $this->markTestSkipped('Not supported on HHVM (ignores window size / encoding format)');
12-
1311
$this->compressor = ZlibFilterStream::createGzipCompressor();
1412
}
1513

0 commit comments

Comments
 (0)