Skip to content

Commit 2ba3dbd

Browse files
authored
Exit with error for unsupported S3 backend (#2856)
The `lychee:generate_thumbs` command does not support the S3 backend. This commit outputs an error message and exits the tool when the command is invoked with such a backend, avoiding incorrect behaviour such as writing images to the filesystem.
1 parent 2b74431 commit 2ba3dbd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

app/Console/Commands/ImageProcessing/GenerateThumbs.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace App\Console\Commands\ImageProcessing;
44

5+
use App\Assets\Features;
56
use App\Contracts\Exceptions\ExternalLycheeException;
67
use App\Contracts\Exceptions\LycheeException;
78
use App\Contracts\Models\SizeVariantFactory;
@@ -60,6 +61,13 @@ public function handle(): int
6061

6162
return 1;
6263
}
64+
65+
if (Features::active('use-s3')) {
66+
$this->error('This tool does not support S3 file storage.');
67+
68+
return 1;
69+
}
70+
6371
$sizeVariantType = self::SIZE_VARIANTS[$sizeVariantName];
6472

6573
$amount = (int) $this->argument('amount');

0 commit comments

Comments
 (0)