summaryrefslogtreecommitdiff
path: root/app/Http/RequestHandlers/ExportGedcomClient.php
diff options
context:
space:
mode:
authorGreg Roach <greg@subaqua.co.uk>2020-06-01 14:48:38 +0100
committerGreg Roach <greg@subaqua.co.uk>2020-06-01 14:48:38 +0100
commitfa6955069ce0f4a34d51f0784b616c2f3a707391 (patch)
tree88ec1f65cef2a072ed616b7bf9556dce7976dfbf /app/Http/RequestHandlers/ExportGedcomClient.php
parent8e8a900847faa50288b83d84c63946b67ff35def (diff)
downloadwebtrees-fa6955069ce0f4a34d51f0784b616c2f3a707391.tar.gz
webtrees-fa6955069ce0f4a34d51f0784b616c2f3a707391.tar.bz2
webtrees-fa6955069ce0f4a34d51f0784b616c2f3a707391.zip
Fix: #3316 - don't use deprecated MountManager
Diffstat (limited to 'app/Http/RequestHandlers/ExportGedcomClient.php')
-rw-r--r--app/Http/RequestHandlers/ExportGedcomClient.php14
1 files changed, 5 insertions, 9 deletions
diff --git a/app/Http/RequestHandlers/ExportGedcomClient.php b/app/Http/RequestHandlers/ExportGedcomClient.php
index 6c7d1bc4cb..c14525292d 100644
--- a/app/Http/RequestHandlers/ExportGedcomClient.php
+++ b/app/Http/RequestHandlers/ExportGedcomClient.php
@@ -28,7 +28,6 @@ use Fisharebest\Webtrees\Tree;
use Illuminate\Database\Capsule\Manager as DB;
use League\Flysystem\Filesystem;
use League\Flysystem\FilesystemInterface;
-use League\Flysystem\MountManager;
use League\Flysystem\ZipArchive\ZipArchiveAdapter;
use Psr\Http\Message\ResponseFactoryInterface;
use Psr\Http\Message\ResponseInterface;
@@ -130,10 +129,7 @@ class ExportGedcomClient implements RequestHandlerInterface
fclose($tmp_stream);
if ($media) {
- $manager = new MountManager([
- 'media' => $tree->mediaFilesystem($data_filesystem),
- 'zip' => $zip_filesystem,
- ]);
+ $media_filesystem = $tree->mediaFilesystem($data_filesystem);
$records = DB::table('media')
->where('m_file', '=', $tree->id())
@@ -143,10 +139,10 @@ class ExportGedcomClient implements RequestHandlerInterface
foreach ($records as $record) {
foreach ($record->mediaFiles() as $media_file) {
- $from = 'media://' . $media_file->filename();
- $to = 'zip://' . $path . $media_file->filename();
- if (!$media_file->isExternal() && $manager->has($from)) {
- $manager->copy($from, $to);
+ $from = $media_file->filename();
+ $to = $path . $media_file->filename();
+ if (!$media_file->isExternal() && $media_filesystem->has($from) && !$zip_filesystem->has($to)) {
+ $zip_filesystem->writeStream($to, $media_filesystem->readStream($from));
}
}
}