rezozero / intervention-request-bundle
Symfony bundle for using ambroisemaupate/intervention-request library
Installs: 6 360
Dependents: 3
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=8.0
- ambroisemaupate/intervention-request: ^4.0 || dev-develop
- symfony/console: >=4.4.0
- symfony/framework-bundle: >=4.4.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.65
- phpstan/phpstan: ^1.12.12
README
Step 1: Download the Bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require rezozero/intervention-request-bundle
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Step 2: Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles
in the config/bundles.php
file of your project:
// config/bundles.php return [ // ... \RZ\InterventionRequestBundle\RZInterventionRequestBundle::class => ['all' => true], ];
Add the routing:
# app/config/routing.yml # ... rz_intervention_request: resource: "@RZInterventionRequestBundle/Resources/config/routing.yml" prefix: /
Step 3: configuration
# config/packages/rz_intervention_request.yaml parameters: env(IR_DEFAULT_QUALITY): '90' env(IR_MAX_PIXEL_SIZE): '1920' ir_default_quality: '%env(int:IR_DEFAULT_QUALITY)%' ir_max_pixel_size: '%env(int:IR_MAX_PIXEL_SIZE)%' rz_intervention_request: driver: 'gd' default_quality: '%ir_default_quality%' max_pixel_size: '%ir_max_pixel_size%' cache_path: "%kernel.project_dir%/public/assets" files_path: "%kernel.project_dir%/public/files" jpegoptim_path: /usr/bin/jpegoptim pngquant_path: /usr/bin/pngquant subscribers: []
Then add the following variables to your project .env
file:
###> rezozero/intervention-request-bundle ### IR_DEFAULT_QUALITY=90 IR_MAX_PIXEL_SIZE=2500 ###< rezozero/intervention-request-bundle ###
Use Flysystem file resolver
Declare a flysystem storage named intervention_request.storage
and
this bundle will automatically use it instead of the LocalFileResolver
:
# Read the documentation at https://github.com/thephpleague/flysystem-bundle/blob/master/docs/1-getting-started.md flysystem: storages: intervention_request.storage: adapter: 'local' options: directory: '%kernel.project_dir%/public/files'