-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- зависимые классы перенесены в нэймспейс `AJUR\FSNews\Media\` - к generageNewFile() добавлен параметр suffix - добавлены stub'ы загрузчиков - добавлен воркер Youtube - `uploadImage`, `uploadAudio`, `uploadVideo` теперь корректно отдают Result - `unlinkStoredTitleImages` теперь отдает Result - обновлены правила `prepareMediaProperties` с учетом deprecated-размеров 440x248 и 590x440 - теперь в зависимостях curl `^2.5`
- Loading branch information
Karel Wintersky
committed
Nov 22, 2024
1 parent
a0cacb4
commit 8dc13af
Showing
17 changed files
with
422 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# 0.13.0 | ||
|
||
## `unlinkStoredTitleImages()` | ||
|
||
Возвращает не `int`, а `Result` с полями: | ||
|
||
- `KEY->deleted_count` - количество удаленных файлов | ||
|
||
DATA содержит массив `[ file => путь, success => статус удаления]` | ||
|
||
## `getYoutubeVideoTitle()` | ||
|
||
Возвращает не строку, а Result с полем `title` | ||
|
||
В случае ошибки поля `video_info` и `player_response` содержат ответы сервера | ||
|
||
## `prepareMediaProperties()` | ||
|
||
Сигнатура метода в библиотеке: | ||
```php | ||
prepareMediaProperties( | ||
array $row = [], | ||
bool $is_report = false, | ||
bool $prepend_domain = false, | ||
bool $target_is_mobile = false, | ||
string $domain_prefix = ''):array | ||
``` | ||
|
||
В админке сигнатура метода: | ||
```php | ||
prepareMediaProperties( | ||
$row, | ||
$is_report = false, | ||
$prepend_domain = false, | ||
$domain_prefix = '' | ||
) | ||
``` | ||
Таким образом, библиотечный метод нужно вызывать, передавая ему в `target_is_mobile` строго false. | ||
|
||
## uploadImage() | ||
|
||
Возвращает не строчку имени файла, а структуру Result, в которой нас интересует DATA: | ||
```php | ||
[ | ||
'thumbnails' => [[ $fn_target, $method, $max_width, $max_height, $quality ]] /* массив сгенерированных превью */ | ||
'fn_resource' => "{$radix}.{$source_extension}", | ||
'radix' => $radix, | ||
'extension' => $source_extension, | ||
'fn_origin' => $fn_origin, | ||
'status' => 'pending', | ||
'type' => self::MEDIA_TYPE_PHOTOS | ||
] | ||
``` | ||
Прежней строчке эквивалентно поле `fn_resource` (сумма `radix` + `extension`) | ||
|
||
## uploadAudio() | ||
|
||
Возвращает не строчку имени загруженного файла (`{$radix}.mp3`), а Result-структуру: | ||
```php | ||
[ | ||
'filename' => $fn_origin, /* оригинальный файл с внутренним именем, сохраненный на диск */ | ||
'radix' => $radix, /* корень имени */ | ||
'extension' => $source_extension, /* расширение файла (на основе MIME-типа) */ | ||
'status' => 'pending', | ||
'type' => self::MEDIA_TYPE_AUDIO | ||
] | ||
``` | ||
|
||
## uploadVideo() | ||
|
||
Уже используется Result. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
# FSNews Media | ||
|
||
```bash | ||
composer require ajur-media/fsnews.media | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.