mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-20 17:02:16 +00:00
zip unit testing
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace Domain\Zip\Actions;
|
||||
|
||||
use STS\ZipStream\ZipStream;
|
||||
use Domain\Sharing\Models\Share;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\File;
|
||||
@@ -27,14 +28,14 @@ class ZipFilesAction
|
||||
if (Storage::exists($filePath)) {
|
||||
// local disk
|
||||
if (is_storage_driver('local')) {
|
||||
$zip->add(storage_path("app/files/$file->user_id/$file->basename"), $file->name);
|
||||
$zip->add(Storage::path($filePath), $file->name);
|
||||
}
|
||||
|
||||
// s3 client
|
||||
if (is_storage_driver('s3')) {
|
||||
$bucketName = config('filesystems.disks.s3.bucket');
|
||||
|
||||
$zip->add("s3://$bucketName/files/$file->user_id/$file->basename", $file->name);
|
||||
$zip->add("s3://$bucketName/$filePath", $file->name);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -41,14 +41,14 @@ class ZipFolderAction
|
||||
|
||||
// local disk
|
||||
if (is_storage_driver('local')) {
|
||||
$zip->add(storage_path("app/files/$user_id/{$file['basename']}"), $zipDestination);
|
||||
$zip->add(Storage::path($filePath), $zipDestination);
|
||||
}
|
||||
|
||||
// s3 client
|
||||
if (is_storage_driver('s3')) {
|
||||
$bucketName = config('filesystems.disks.s3.bucket');
|
||||
|
||||
$zip->add("s3://$bucketName/files/$user_id/{$file['basename']}", $zipDestination);
|
||||
$zip->add("s3://$bucketName/$filePath", $zipDestination);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user