From 03d6881fc7d5d29e67881e0b8d397f6d6d9603ce Mon Sep 17 00:00:00 2001 From: nilov Date: Fri, 31 Aug 2018 00:20:06 +0700 Subject: [PATCH] Symfony 4 compatible. --- .../GlavwebUploaderExtension.php | 6 +++--- Provider/ImageProvider.php | 1 - Resources/config/services.xml | 20 +++++++++---------- Util/MediaStructure.php | 10 +++++----- composer.json | 4 ++-- 5 files changed, 20 insertions(+), 21 deletions(-) diff --git a/DependencyInjection/GlavwebUploaderExtension.php b/DependencyInjection/GlavwebUploaderExtension.php index c65fb65..ec12116 100644 --- a/DependencyInjection/GlavwebUploaderExtension.php +++ b/DependencyInjection/GlavwebUploaderExtension.php @@ -11,7 +11,7 @@ namespace Glavweb\UploaderBundle\DependencyInjection; -use Liip\ImagineBundle\Templating\Helper\ImagineHelper; +use Liip\ImagineBundle\Templating\Helper\FilterHelper; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\Reference; @@ -41,9 +41,9 @@ public function load(array $configs, ContainerBuilder $container) $container->setParameter('glavweb_uploader.config', $config); - if (class_exists(ImagineHelper::class)) { + if (class_exists(FilterHelper::class)) { $container->getDefinition('glavweb_uploader.util.media_structure')->addMethodCall('setImagineHelper', [ - new Reference('liip_imagine.templating.helper') + new Reference('liip_imagine.templating.filter_helper') ]); } } diff --git a/Provider/ImageProvider.php b/Provider/ImageProvider.php index 3391546..a4049ad 100644 --- a/Provider/ImageProvider.php +++ b/Provider/ImageProvider.php @@ -12,7 +12,6 @@ namespace Glavweb\UploaderBundle\Provider; use Glavweb\UploaderBundle\File\FileInterface; -use Glavweb\UploaderBundle\Helper\MediaHelper; use Glavweb\UploaderBundle\Model\MediaInterface; /** diff --git a/Resources/config/services.xml b/Resources/config/services.xml index df788df..3e450d5 100644 --- a/Resources/config/services.xml +++ b/Resources/config/services.xml @@ -14,7 +14,7 @@ - + %glavweb_uploader.config% @@ -23,11 +23,11 @@ - + - + %kernel.cache_dir% @@ -36,7 +36,7 @@ - + %glavweb_uploader.config% @@ -49,18 +49,18 @@ - + - + - + - + @@ -75,11 +75,11 @@ - + - + diff --git a/Util/MediaStructure.php b/Util/MediaStructure.php index 68c9e02..03c33f2 100644 --- a/Util/MediaStructure.php +++ b/Util/MediaStructure.php @@ -15,7 +15,7 @@ use Glavweb\UploaderBundle\Exception\Exception; use Glavweb\UploaderBundle\Helper\MediaHelper; use Glavweb\UploaderBundle\Model\MediaInterface; -use Liip\ImagineBundle\Templating\Helper\ImagineHelper; +use Liip\ImagineBundle\Templating\Helper\FilterHelper; /** * Class MediaStructure @@ -31,7 +31,7 @@ class MediaStructure private $mediaHelper; /** - * @var ImagineHelper + * @var FilterHelper */ private $imagineHelper; @@ -46,7 +46,7 @@ public function __construct(MediaHelper $mediaHelper) } /** - * @param ImagineHelper $imagineHelper + * @param FilterHelper $imagineHelper */ public function setImagineHelper($imagineHelper) { @@ -84,8 +84,8 @@ public function getMediaStructure(MediaInterface $media, $thumbnailFilter = null $thumbnailPath = null; if ($media->getThumbnailPath()) { if ($thumbnailFilter) { - if (!$this->imagineHelper instanceof ImagineHelper) { - throw new Exception('ImagineHelper is not defined. You need use Liip\ImagineBundle.'); + if (!$this->imagineHelper instanceof FilterHelper) { + throw new Exception('FilterHelper is not defined. You need use Liip\ImagineBundle.'); } $thumbnailPath = $this->mediaHelper->getThumbnailPath($media, false); diff --git a/composer.json b/composer.json index 9b8bfc6..452fe50 100644 --- a/composer.json +++ b/composer.json @@ -13,8 +13,8 @@ } ], "require": { - "symfony/http-foundation": "~2.3|~3.0", - "symfony/form": "~2.3|~3.0" + "symfony/http-foundation": "^2.7|^3.0|^4.0", + "symfony/form": "^2.7|^3.0|^4.0" }, "autoload": { "psr-4": { "Glavweb\\UploaderBundle\\": "" }