Download the PHP package setono/sylius-image-plugin without Composer
On this page you can find all versions of the php package setono/sylius-image-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download setono/sylius-image-plugin
More information about setono/sylius-image-plugin
Files in setono/sylius-image-plugin
Package sylius-image-plugin
Short Description Plugin that will optimize your images in your Sylius store
License MIT
Informations about the package sylius-image-plugin
Sylius Image Plugin
This library will optimize your images and it works seamlessly with a standard Sylius installation because it has wise fallbacks. Out of the box this plugin uses Cloudflare, so to use it you need a Cloudflare account with the images subscription.
Installation
Step 1: Download the plugin
Open a command console, enter your project directory and execute the following command to download the latest stable version of this plugin:
Step 2: Enable the plugin
Then, enable the plugin by adding it to the list of registered plugins/bundles
in config/bundles.php
file of your project before (!) SyliusGridBundle
:
Step 3: Configure plugin
Step 4: Import routing
Usage
In this plugin we have a concept named variants. These are image variants, i.e. different sizes of images. In a default Sylius installation you use the Liip Imagine Bundle which has a concept of filter sets. In the context of this plugin, these two concepts are more or less similar.
To use the plugin, you have to tell the plugin which variants (filter sets) should be available for optimization and which image resources should be optimized. Here is an example:
Configuration
Effectively this means that for each product image you will have five image variants being optimized. Other variants
like sylius_admin_product_thumbnail
or sylius_large
won't be optimized.
Implement code changes
For the plugin to work the image resources needs to implement an interface. Here is an example of product image resource:
Final
Update your database schema
All versions of sylius-image-plugin with dependencies
doctrine/orm Version ^2.6
doctrine/persistence Version ^2.0 || ^3.0
knplabs/gaufrette Version ^0.8 || ^0.9 || ^0.10 || ^0.11
liip/imagine-bundle Version ^2.6
psr/event-dispatcher Version ^1.0
setono/doctrine-object-manager-trait Version ^1.1
spatie/data-transfer-object Version ^2.8
sylius/resource-bundle Version ^1.8
symfony/config Version ^5.4 || ^6.0
symfony/console Version ^5.4 || ^6.0
symfony/dependency-injection Version ^5.4 || ^6.0
symfony/event-dispatcher Version ^5.4 || ^6.0
symfony/event-dispatcher-contracts Version ^1.1 || ^2.5 || ^3.1
symfony/filesystem Version ^5.4 || ^6.0
symfony/http-client Version ^5.4 || ^6.0
symfony/http-client-contracts Version ^1.1 || ^2.5 || ^3.1
symfony/http-foundation Version ^5.4 || ^6.0
symfony/lock Version ^5.4 || ^6.0
symfony/messenger Version ^5.4 || ^6.0
symfony/mime Version ^5.4 || ^6.0
symfony/workflow Version ^5.4 || ^6.0
twig/twig Version ^2.14 || ^3.4
webmozart/assert Version ^1.11