From 36374223b25c304c3ca34ba33b29545fc3265bc8 Mon Sep 17 00:00:00 2001 From: Kevin Kaniaburka Date: Wed, 14 Sep 2022 11:13:36 +0200 Subject: [PATCH] [Maintenance] Introduce Flysystem Co-authored-by: Jakub Tobiasz --- composer-require-checker.json | 3 ++- composer.json | 1 + config/bundles.php | 1 + config/packages/flysystem.yaml | 6 ++++++ src/Sylius/Bundle/AdminBundle/Tests/TestKernel.php | 2 ++ src/Sylius/Bundle/ApiBundle/test/config/bundles.php | 1 + .../CoreBundle/Resources/config/app/config.yml | 7 +++++++ src/Sylius/Bundle/CoreBundle/Tests/TestKernel.php | 2 ++ src/Sylius/Bundle/CoreBundle/composer.json | 1 + src/Sylius/Component/Core/composer.json | 1 + symfony.lock | 13 +++++++++++++ 11 files changed, 37 insertions(+), 1 deletion(-) create mode 100755 config/packages/flysystem.yaml diff --git a/composer-require-checker.json b/composer-require-checker.json index 483080c1f0..5291a46a85 100644 --- a/composer-require-checker.json +++ b/composer-require-checker.json @@ -20,7 +20,8 @@ "Doctrine\\DBAL\\Platforms\\MySQLPlatform", "HWI\\Bundle\\OAuthBundle\\Connect\\AccountConnectorInterface", "HWI\\Bundle\\OAuthBundle\\OAuth\\Response\\UserResponseInterface", - "HWI\\Bundle\\OAuthBundle\\Security\\Core\\User\\OAuthAwareUserProviderInterface" + "HWI\\Bundle\\OAuthBundle\\Security\\Core\\User\\OAuthAwareUserProviderInterface", + "League\\Flysystem\\FilesystemOperator" ], "php-core-extensions" : [ "Core", diff --git a/composer.json b/composer.json index 285c97b335..0610e55eb2 100644 --- a/composer.json +++ b/composer.json @@ -56,6 +56,7 @@ "knplabs/knp-menu": "^3.1", "knplabs/knp-menu-bundle": "^3.0", "laminas/laminas-stdlib": "^3.3.1", + "league/flysystem-bundle": "^2.4", "lexik/jwt-authentication-bundle": "^2.11", "liip/imagine-bundle": "^2.3", "pagerfanta/pagerfanta": "^3.0", diff --git a/config/bundles.php b/config/bundles.php index 5003cc7a51..a62dcbe6aa 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -37,6 +37,7 @@ return [ FOS\RestBundle\FOSRestBundle::class => ['all' => true], Knp\Bundle\GaufretteBundle\KnpGaufretteBundle::class => ['all' => true], Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true], + League\FlysystemBundle\FlysystemBundle::class => ['all' => true], Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true], Payum\Bundle\PayumBundle\PayumBundle::class => ['all' => true], Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true], diff --git a/config/packages/flysystem.yaml b/config/packages/flysystem.yaml new file mode 100755 index 0000000000..2447c233b4 --- /dev/null +++ b/config/packages/flysystem.yaml @@ -0,0 +1,6 @@ +flysystem: + storages: + sylius.storage: + adapter: 'local' + options: + directory: '%sylius_core.images_dir%' diff --git a/src/Sylius/Bundle/AdminBundle/Tests/TestKernel.php b/src/Sylius/Bundle/AdminBundle/Tests/TestKernel.php index 4d4e9e2023..45564ed262 100644 --- a/src/Sylius/Bundle/AdminBundle/Tests/TestKernel.php +++ b/src/Sylius/Bundle/AdminBundle/Tests/TestKernel.php @@ -21,6 +21,7 @@ use FOS\RestBundle\FOSRestBundle; use JMS\SerializerBundle\JMSSerializerBundle; use Knp\Bundle\GaufretteBundle\KnpGaufretteBundle; use Knp\Bundle\MenuBundle\KnpMenuBundle; +use League\FlysystemBundle\FlysystemBundle; use Liip\ImagineBundle\LiipImagineBundle; use Payum\Bundle\PayumBundle\PayumBundle; use Sonata\BlockBundle\SonataBlockBundle; @@ -105,6 +106,7 @@ final class TestKernel extends BaseKernel new JMSSerializerBundle(), new FOSRestBundle(), new KnpGaufretteBundle(), + new FlysystemBundle(), new LiipImagineBundle(), new PayumBundle(), new StofDoctrineExtensionsBundle(), diff --git a/src/Sylius/Bundle/ApiBundle/test/config/bundles.php b/src/Sylius/Bundle/ApiBundle/test/config/bundles.php index 60c20145e2..03bb2b383a 100644 --- a/src/Sylius/Bundle/ApiBundle/test/config/bundles.php +++ b/src/Sylius/Bundle/ApiBundle/test/config/bundles.php @@ -45,6 +45,7 @@ return [ Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle::class => ['all' => true], JMS\SerializerBundle\JMSSerializerBundle::class => ['all' => true], Knp\Bundle\GaufretteBundle\KnpGaufretteBundle::class => ['all' => true], + League\FlysystemBundle\FlysystemBundle::class => ['all' => true], Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true], Payum\Bundle\PayumBundle\PayumBundle::class => ['all' => true], Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true], diff --git a/src/Sylius/Bundle/CoreBundle/Resources/config/app/config.yml b/src/Sylius/Bundle/CoreBundle/Resources/config/app/config.yml index 84808dfa4b..8990e5ce5a 100644 --- a/src/Sylius/Bundle/CoreBundle/Resources/config/app/config.yml +++ b/src/Sylius/Bundle/CoreBundle/Resources/config/app/config.yml @@ -44,6 +44,13 @@ doctrine: WEEK: Sylius\Bundle\CoreBundle\Doctrine\DQL\Week YEAR: Sylius\Bundle\CoreBundle\Doctrine\DQL\Year +flysystem: + storages: + sylius.storage: + adapter: 'local' + options: + directory: '%sylius_core.images_dir%' + knp_gaufrette: adapters: sylius_image: diff --git a/src/Sylius/Bundle/CoreBundle/Tests/TestKernel.php b/src/Sylius/Bundle/CoreBundle/Tests/TestKernel.php index c8fbcb9f17..1519c6539d 100644 --- a/src/Sylius/Bundle/CoreBundle/Tests/TestKernel.php +++ b/src/Sylius/Bundle/CoreBundle/Tests/TestKernel.php @@ -20,6 +20,7 @@ use Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle; use FOS\RestBundle\FOSRestBundle; use JMS\SerializerBundle\JMSSerializerBundle; use Knp\Bundle\GaufretteBundle\KnpGaufretteBundle; +use League\FlysystemBundle\FlysystemBundle; use Liip\ImagineBundle\LiipImagineBundle; use Payum\Bundle\PayumBundle\PayumBundle; use Sonata\BlockBundle\SonataBlockBundle; @@ -103,6 +104,7 @@ final class TestKernel extends BaseKernel new JMSSerializerBundle(), new FOSRestBundle(), new KnpGaufretteBundle(), + new FlysystemBundle(), new LiipImagineBundle(), new PayumBundle(), new StofDoctrineExtensionsBundle(), diff --git a/src/Sylius/Bundle/CoreBundle/composer.json b/src/Sylius/Bundle/CoreBundle/composer.json index dea007fe24..36783c660b 100644 --- a/src/Sylius/Bundle/CoreBundle/composer.json +++ b/src/Sylius/Bundle/CoreBundle/composer.json @@ -33,6 +33,7 @@ "jms/serializer-bundle": "^3.5", "knplabs/gaufrette": "^0.8", "knplabs/knp-gaufrette-bundle": "^0.7", + "league/flysystem-bundle": "^2.4", "liip/imagine-bundle": "^2.3", "sonata-project/block-bundle": "^4.2", "swiftmailer/swiftmailer": "^6.2", diff --git a/src/Sylius/Component/Core/composer.json b/src/Sylius/Component/Core/composer.json index 1f2a1ae215..c2d68f2dbc 100644 --- a/src/Sylius/Component/Core/composer.json +++ b/src/Sylius/Component/Core/composer.json @@ -29,6 +29,7 @@ "php": "^8.0", "enshrined/svg-sanitize": "^0.15.4", "knplabs/gaufrette": "^0.8", + "league/flysystem": "^2.4", "payum/payum": "^1.6", "php-http/guzzle6-adapter": "^2.0", "sylius/addressing": "^1.6", diff --git a/symfony.lock b/symfony.lock index e7571b8e71..d64fdc59dc 100644 --- a/symfony.lock +++ b/symfony.lock @@ -284,6 +284,19 @@ "lcobucci/jwt": { "version": "3.3.1" }, + "league/flysystem-bundle": { + "version": "2.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "1.0", + "ref": "913dc3d7a5a1af0d2b044c5ac3a16e2f851d7380" + }, + "files": [ + "config/packages/flysystem.yaml", + "var/storage/.gitignore" + ] + }, "league/uri": { "version": "5.3.0" },