diff --git a/CHANGELOG.md b/CHANGELOG.md index 387eae3e5..f2e301e77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [4.2.0](https://github.com/sonata-project/SonataMediaBundle/compare/4.1.5...4.2.0) - 2022-06-12 +### Changed +- [[#2310](https://github.com/sonata-project/SonataMediaBundle/pull/2310)] Bump `imagine/imagine` to ^1.3. ([@jordisala1991](https://github.com/jordisala1991)) + +### Removed +- [[#2308](https://github.com/sonata-project/SonataMediaBundle/pull/2308)] Support of Symfony 5.3 ([@franmomu](https://github.com/franmomu)) + ## [4.1.5](https://github.com/sonata-project/SonataMediaBundle/compare/4.1.4...4.1.5) - 2022-04-27 ### Fixed - [[#2299](https://github.com/sonata-project/SonataMediaBundle/pull/2299)] Check for allowed extensions and mimetypes are case insensitive. ([@VincentLanglet](https://github.com/VincentLanglet)) diff --git a/UPGRADE-3.0.md b/UPGRADE-3.0.md deleted file mode 100644 index fdabcc9ae..000000000 --- a/UPGRADE-3.0.md +++ /dev/null @@ -1,6 +0,0 @@ -UPGRADE FROM 2.x to 3.0 -======================= - -### Dependencies - -You will need to follow the dependencies upgrade instructions. diff --git a/UPGRADE-3.x.md b/UPGRADE-3.x.md deleted file mode 100644 index 6bf5a718b..000000000 --- a/UPGRADE-3.x.md +++ /dev/null @@ -1,326 +0,0 @@ -UPGRADE 3.x -=========== - -UPGRADE FROM 3.36 to 3.37 -========================= - -### ReST API - -Conflict against "nelmio/api-doc-bundle" >= 4.0 was removed. -If this package is installed, the deprecated ReST API will not be built. -This behavior allows to accept setups using "nelmio/api-doc-bundle" >= 4.0 dependency without conflicts. - -### Mark final methods on abstract classes - -The following abstract classes have some of their methods marked as final with annotations, on 4.0 they will be final, make sure to not reimplement them: - -- `Sonata\MediaBundle\Admin\BaseMediaAdmin` -- `Sonata\MediaBundle\Listener\BaseMediaEventSubscriber` -- `Sonata\MediaBundle\Model\Gallery` -- `Sonata\MediaBundle\Model\Media` -- `Sonata\MediaBundle\Provider\BaseProvider` -- `Sonata\MediaBundle\Provider\BaseVideoProvider` - -### Deprecate PantherPortal CDN - -PantherPortal CDN no longer exists. - -### Deprecate `null` media value on Twig functions - -Our custom twig functions (`sonata_media`, `sonata_thumbnail` and `sonata_path`) used to accept a null value and produce an empty result. - -This is deprecated and you should make sure you check for null before calling those functions. - -### Deprecated `MigrateToJsonTypeCommand` - -This command was introduced a long time ago to migrate from array to json. Make sure you migrate it before upgrading to SonataMediaBundle 4.0. - -### Deprecated `ServiceProviderDataTransformer` - -This class is deprecated because it is dead code. If you use it, please use `ProviderDataTransformer` instead. - -### Deprecated using `master` and `slave` words in configuration - -Before: - -```yaml -sonata_media: - cdn: - fallback: - master: sonata.media.cdn.cloudfront - filesystem: - replicate: - master: sonata.media.adapter.filesystem.s3 - slave: sonata.media.adapter.filesystem.local -``` - -After: - -```yaml -sonata_media: - cdn: - fallback: - primary: sonata.media.cdn.cloudfront - filesystem: - replicate: - primary: sonata.media.adapter.filesystem.s3 - secondary: sonata.media.adapter.filesystem.local -``` - -UPGRADE FROM 3.33 to 3.34 -========================= - -### Deprecated custom Twig tags in favour of Twig functions - -The following custom twig tags are now deprecated and replaced with functions. - -Before: - -```twig - {% media media, 'large' with {'sizes': '(min-width: 20em) 50vw, 100vw'} %} - {% thumbnail media, 'small' %} - {% path media, 'small' %} -``` - -After: - -```twig - {{ sonata_media(media, 'large', {'sizes': '(min-width: 20em) 50vw, 100vw'}) }} - {{ sonata_thumbnail(media, 'small') }} - {{ sonata_path(media, 'small') }} -``` - -### Deprecate Async processing with SonataNotificationBundle - -Integration with SonataNotificationBundle is deprecated. It was used for async processing of thumbnail generation. - -You can use the new integration with [Symfony Messenger](https://symfony.com/doc/current/messenger.html) instead. - -### Deprecate API - -Integration with FOSRest, JMS Serializer and Nelmio Api Docs is deprecated, the ReST API provided with this bundle will be removed on 4.0. - -If you are relying on this, consider moving to other solution like [API Platform](https://api-platform.com/) instead. - -### Deprecate Pixlr integration - -Integration with Pixlr is deprecated now. There is no replacement since -the bundle is trying to focus on media management and not on the edit part. - -### Media and Gallery Controllers - -`viewAction()` and `indexAction()` from media and gallery controllers are deprecated now. -There is no provided replacement since those actions are suposed to be implemented in app side if you need them. - -### Breadcrumbs classes - -Breadcrumbs are deprecated, if your application uses them on the frontend side, you should use `sonata-project/seo-bundle` to implement them instead. - -UPGRADE FROM 3.32 to 3.33 -========================= - -### Sonata\MediaBundle\Listener\BaseMediaEventSubscriber::getMedia() and its inheritances - -Method `getMedia()` returns `null` if the related medium does not implement `Sonata\MediaBundle\Model\MediaInterface`. -Before this change, under the same situation this method was returning the invalid object. - -### Sonata\MediaBundle\Filesystem\Replicate - -Added implementation for `Gaufrette\Adapter\FileFactory` and `Gaufrette\Adapter\StreamFactory`. -Method `createFileStream()` is deprecated in favor of `createStream()`. -Argument 3 (`?array $metadata = null`) in method `write()` is deprecated. - -### Sonata\MediaBundle\Thumbnail\ResizableThumbnailInterface - -This interface is added to provide a clearer API for `FormatThumbnail`. It allows to know if a `Thumbnail` object can be generated with custom `Resizer` instances, not the ones provided by -the file provider. - -If you have custom `Thumbnail` generator, please implement this interface if you need -custom resizers. - -### Deprecate OpenStack / Rackspace integration - -This integration is deprecated because the php packages are not up to date. On master -this integration will be removed. There is no replacement for it. - -### Deprecate direct session injection - -`$session` property in `Security/SessionDownloadStrategy` is deprecated. Use `RequestStack` `$requestStack` instead. - -Before: - -```php - $downloadStrategy = new SessionDownloadStrategy($translator, $session, $times); -``` - -After: - -```php - $downloadStrategy = new SessionDownloadStrategy($translator, $requestStack, $times); -``` - -UPGRADE FROM 3.31 to 3.32 -========================= - -### Support for NelmioApiDocBundle > 3.6 is added - -Controllers for NelmioApiDocBundle v2 were moved under `Sonata\MediaBundle\Controller\Api\Legacy\` namespace and controllers for NelmioApiDocBundle v3 were added as replacement. If you extend them, you must ensure they are using the corresponding inheritance. - -### Deprecations - -Usages of `Symfony\Component\Translation\TranslatorInterface` are deprecated in favor of `Symfony\Contracts\Translation\TranslatorInterface`. You MUST replace all references to them in your code and inject correct object into: -- `Sonata\MediaBundle\Security\ForbiddenDownloadStrategy` -- `Sonata\MediaBundle\Security\PublicDownloadStrategy` -- `Sonata\MediaBundle\Security\RolesDownloadStrategy` -- `Sonata\MediaBundle\Security\SessionDownloadStrategy` - -### Sonata\MediaBundle\CDN\CloudFront - -The previous signature of `CloudFront::__construct()` is deprecated. - -Before: - -```php -public function __construct(string $path, string $key, string $secret, string $distributionId, ?string $region = null, ?string $version = null) -``` - -After: - -```php -public function __construct(Aws\CloudFront\CloudFrontClient $client, string $distributionId, string $path) -``` - -Returning `false` or any value not present in the `CDNInterface::STATUS_*` constants from `CloudFront::getFlushStatus()` is deprecated. - -The methods `CloudFront::setClient()` and `CloudFront::getStatusList()` are deprecated. - -### MogileFS filesystem adapter is deprecated - -The services `sonata.media.adapter.filesystem.mogilefs`, `sonata.media.filesystem.mogilefs` -and the configuration node "sonata_media.filesystem.mogilefs" are deprecated. - -### Configuration node "sonata_media.filesystem.s3.sdk_version" - -The configuration node "sonata_media.filesystem.s3.sdk_version" is deprecated. The -version of aws/aws-sdk-php is automatically inferred from the installed package. - -### Configuration node "sonata_media.cdn.cloudfront" - -The configuration nodes "sonata_media.cdn.cloudfront.region" and "sonata_media.cdn.cloudfront.version" -are required when aws/aws-sdk-php 3.x is installed. - -## BaseVideoProvider uses `psr/http-client` - -The `Guzzle` and `Buzz` dependencies are deprecated and will be replaced with the abstract `http-client` interface, so you can choose your preferred client implementation. You should adapt to the new `BaseVideoProvider::__construct()` signature. - -UPGRADE FROM 3.25 to 3.26 -========================= - -### Commands - -Command classes were updated to inherit from `Command` instead of deprecated `ContainerAwareCommand`. Direct access to container will -no longer be possible. Services that were retrieved from the DIC MUST be injected instead. - -### SonataEasyExtends is deprecated - -Registering `SonataEasyExtendsBundle` bundle is deprecated, it SHOULD NOT be registered. -Register `SonataDoctrineBundle` bundle instead. - -UPGRADE FROM 3.23 to 3.24 -========================= - -### Generators rename - -Some classes have been renamed, the old types are just aliases for the new ones. -You should replace all references to them in your code. - -- `Sonata\MediaBundle\Command\DefaultGenerator` is deprecated in favor of `Sonata\MediaBundle\Generator\IdGenerator` -- `Sonata\MediaBundle\Command\ODMGenerator` is deprecated in favor of `Sonata\MediaBundle\Generator\UuidGenerator` -- `Sonata\MediaBundle\Command\PHPCRGenerator` is deprecated in favor of `Sonata\MediaBundle\Generator\PathGenerator` - -UPGRADE FROM 3.6 to 3.7 -======================= - -### Doctrine schema update for GalleryHasMedia - -Doctrine ORM join columns from GalleryHasMedia entity towards both Gallery and Media entities has been changed. Now -they include the `onDelete="CASCADE"` option: this allows to delete a media if included in a gallery (and vice-versa). -You should upgrade your database in a safe way after upgrading your vendors. - -UPGRADE FROM 3.4 to 3.5 -======================= - -### Deprecations - -Sonata\MediaBundle\DependencyInjection\Compiler\AddProviderCompilerPass::fixSettings($container) -is deprecated. Please avoid using this method, use ``getExtensionConfig($container)`` instead. - -Sonata\MediaBundle\Controller\Controller\MediaController::liipImagineFilterAction($path, $filter) -is deprecated. Please avoid using this method. -If you define controller_action in liip_imagine configs please remove it. - - -UPGRADE FROM 3.2 to 3.3 -======================= - -### Providing a 2nd parameter for Sonata\MediaBundle\Metadata\ProxyMetadataBuilder::__construct() is deprecated - -Before: - -```php -public function __construct(ContainerInterface $container, array $map = null) -``` - -After: - -```php -public function __construct(ContainerInterface $container) -``` - -### Sonata\MediaBundle\Command\AddMediaCommand::$output is depredated - -Please avoid using this property! - -### Not providing the 4th argument for Sonata\MediaBundle\Thumbnail\ConsumerThumbail::__construct() is deprecated - -Before: - -```php -__construct($id, ThumbnailInterface $thumbnail, BackendInterface $backend, EventDispatcherInterface $dispatcher = null) -``` - -After: - -```php -__construct($id, ThumbnailInterface $thumbnail, BackendInterface $backend, EventDispatcherInterface $dispatcher) -``` - -### Custom video provider - -When creating a custom video provider, you have to implement the ``getReferenceUrl`` method to establish -the media url. - -UPGRADE FROM 3.0 to 3.1 -======================= - -### Tests - -All files under the ``Tests`` directory are now correctly handled as internal test classes. -You can't extend them anymore, because they are only loaded when running internal tests. -More information can be found in the [composer docs](https://getcomposer.org/doc/04-schema.md#autoload-dev). - -### Deprecated - -`$container` property in `Security/SessionDownloadStrategy` is deprecated. Use `SessionInterface` `$session` instead. - -Before: - -```php - $downloadStrategy = new SessionDownloadStrategy($translator, $container, $times); -``` - -After: - -```php - $downloadStrategy = new SessionDownloadStrategy($translator, $session, $times); -```