Skip to content
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
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,16 @@ matrix:
- php: 7.2
- php: 7.3
- php: 7.4
- name: "Windows"
os: windows
language: shell # no built-in php support
before_install:
- 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:
Expand Down
5 changes: 5 additions & 0 deletions examples/gunzip.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

require __DIR__ . '/../vendor/autoload.php';

if (DIRECTORY_SEPARATOR === '\\') {
fwrite(STDERR, 'Non-blocking console I/O not supported on Windows' . PHP_EOL);
exit(1);
}

if (!defined('ZLIB_ENCODING_GZIP')) {
fwrite(STDERR, 'Requires PHP 5.4+ with ext-zlib enabled' . PHP_EOL);
exit(1);
Expand Down
5 changes: 5 additions & 0 deletions examples/gzip.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

require __DIR__ . '/../vendor/autoload.php';

if (DIRECTORY_SEPARATOR === '\\') {
fwrite(STDERR, 'Non-blocking console I/O not supported on Windows' . PHP_EOL);
exit(1);
}

if (!defined('ZLIB_ENCODING_GZIP')) {
fwrite(STDERR, 'Requires PHP 5.4+ with ext-zlib enabled' . PHP_EOL);
exit(1);
Expand Down
7 changes: 6 additions & 1 deletion tests/FunctionalExamplesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ class FunctionalExamplesTest extends TestCase
{
public function setUp()
{
if (defined('HHVM_VERSION')) $this->markTestSkipped('Not supported on HHVM (ignores window size / encoding format)');
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()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/ZlibFilterGzipCompressorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function setUp()

public function testCompressEmpty()
{
$os = "\x03"; // UNIX (0x03) or UNKNOWN (0xFF)
$os = DIRECTORY_SEPARATOR === '\\' ? "\x0a" : "\x03"; // NTFS(0x0a) or UNIX (0x03)
$this->compressor->on('data', $this->expectCallableOnceWith("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00" . $os . "\x03\x00" . "\x00\x00\x00\x00\x00\x00\x00\x00"));
$this->compressor->on('end', $this->expectCallableOnce());

Expand Down