summaryrefslogtreecommitdiff
path: root/app/Http/RequestHandlers/ExportGedcomClient.php
diff options
context:
space:
mode:
authorGreg Roach <greg@subaqua.co.uk>2021-03-11 10:52:03 +0000
committerGreg Roach <greg@subaqua.co.uk>2021-03-11 12:25:31 +0000
commitf32d77e63d71326973bfe0496adeec694ca90ecf (patch)
treef952dbf9aec95f51479ffd0940d216f9cd61e49a /app/Http/RequestHandlers/ExportGedcomClient.php
parent090a06287954f43677f06ea778b3f67c029de8fe (diff)
downloadwebtrees-f32d77e63d71326973bfe0496adeec694ca90ecf.tar.gz
webtrees-f32d77e63d71326973bfe0496adeec694ca90ecf.tar.bz2
webtrees-f32d77e63d71326973bfe0496adeec694ca90ecf.zip
Remove vendor dir, add support for PHP 8.0, drop support for PHP 7.1 and 7.2
Diffstat (limited to 'app/Http/RequestHandlers/ExportGedcomClient.php')
-rw-r--r--app/Http/RequestHandlers/ExportGedcomClient.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/Http/RequestHandlers/ExportGedcomClient.php b/app/Http/RequestHandlers/ExportGedcomClient.php
index 7260ced53f..595fcc9fa4 100644
--- a/app/Http/RequestHandlers/ExportGedcomClient.php
+++ b/app/Http/RequestHandlers/ExportGedcomClient.php
@@ -27,6 +27,7 @@ use Fisharebest\Webtrees\Services\GedcomExportService;
use Fisharebest\Webtrees\Tree;
use Illuminate\Database\Capsule\Manager as DB;
use League\Flysystem\Filesystem;
+use League\Flysystem\ZipArchive\FilesystemZipArchiveProvider;
use League\Flysystem\ZipArchive\ZipArchiveAdapter;
use Psr\Http\Message\ResponseFactoryInterface;
use Psr\Http\Message\ResponseInterface;
@@ -121,7 +122,8 @@ class ExportGedcomClient implements RequestHandlerInterface
// Create a new/empty .ZIP file
$temp_zip_file = stream_get_meta_data(tmpfile())['uri'];
- $zip_adapter = new ZipArchiveAdapter($temp_zip_file);
+ $zip_provider = new FilesystemZipArchiveProvider($temp_zip_file, 0755);
+ $zip_adapter = new ZipArchiveAdapter($zip_provider);
$zip_filesystem = new Filesystem($zip_adapter);
$zip_filesystem->writeStream($download_filename, $tmp_stream);
fclose($tmp_stream);
@@ -146,9 +148,6 @@ class ExportGedcomClient implements RequestHandlerInterface
}
}
- // Need to force-close ZipArchive filesystems.
- $zip_adapter->getArchive()->close();
-
// Use a stream, so that we do not have to load the entire file into memory.
$stream_factory = app(StreamFactoryInterface::class);
assert($stream_factory instanceof StreamFactoryInterface);