8000 php-ffmpeg in main composer file for dev + check php-ffmpeg is instal… · symfonyaml/symfony@6e60361 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6e60361

Browse files
author
symfonyaml
committed
php-ffmpeg in main composer file for dev + check php-ffmpeg is installed in constraint class
1 parent b24e0ec commit 6e60361

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@
159159
"twig/cssinliner-extra": "^2.12|^3",
160160
"twig/inky-extra": "^2.12|^3",
161161
"twig/markdown-extra": "^2.12|^3",
162-
"web-token/jwt-library": "^3.3.2|^4.0"
162+
"web-token/jwt-library": "^3.3.2|^4.0",
163+
"php-ffmpeg/php-ffmpeg": "^1.3"
163164
},
164165
"conflict": {
165166
"ext-psr": "<1.1|>=2",

src/Symfony/Component/Validator/Constraints/Video.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ public function __construct(
185185
$this->allowPortraitMessage = $allowPortraitMessage ?? $this->allowPortraitMessage;
186186
$this->corruptedMessage = $corruptedMessage ?? $this->corruptedMessage;
187187

188+
if (!class_exists(\FFMpeg\FFProbe::class)) {
189+
throw new \LogicException('The "php-ffmpeg/php-ffmpeg" library must be installed to use the Video constraint. Try running "composer require php-ffmpeg/php-ffmpeg".');
190+
}
191+
188192
if (!\in_array('video/*', (array) $this->mimeTypes, true) && !\array_key_exists('mimeTypesMessage', $options ?? []) && null === $mimeTypesMessage) {
189193
$this->mimeTypesMessage = 'The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}.';
190194
}

0 commit comments

Comments
 (0)
0