Skip to content

Commit 36c3358

Browse files
authored
Fix zip file creation on PHP 8 (#320)
Fix zip file creation on PHP 8
1 parent d7622bf commit 36c3358

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ matrix:
2121
dist: trusty
2222
- php: 5.6
2323
dist: trusty
24-
24+
- php: nightly
25+
allow_failures:
26+
- php: nightly
2527
env:
2628
global:
2729
- DISPLAY=:99.0
@@ -33,6 +35,8 @@ cache:
3335
before_install:
3436
# Install symfony/error-handler on compatible PHP versions to avoid a deprecation warning of the old DebugClassLoader and ErrorHandler classes
3537
- if [[ "$TRAVIS_PHP_VERSION" != 5.* && "$TRAVIS_PHP_VERSION" != 7.0 ]]; then composer require --no-update --dev symfony/error-handler "^4.4 || ^5.0"; fi;
38+
# Set composer's platform to php 7.4 if we're on php 8.
39+
- if [[ "$TRAVIS_PHP_VERSION" = "nightly" ]]; then composer config platform.php 7.4.99; fi;
3640

3741
install:
3842
- composer install -n --prefer-dist

src/Selenium2Driver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ private function uploadFile($path)
11921192
$tempFilename = tempnam('', 'WebDriverZip');
11931193

11941194
$archive = new \ZipArchive();
1195-
$result = $archive->open($tempFilename, \ZipArchive::CREATE);
1195+
$result = $archive->open($tempFilename, \ZipArchive::OVERWRITE);
11961196
if (!$result) {
11971197
throw new DriverException('Zip archive could not be created. Error ' . $result);
11981198
}

0 commit comments

Comments
 (0)