Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
4be0084
refactor: review default value configuration for s3 cache
deguif Aug 26, 2025
87bf4aa
use ubuntu-latest to build, 20.04 has been discontinued
dbu Aug 27, 2025
4b5d7bc
fix latest cs, pin enqueue version in php 7.4
dbu Aug 27, 2025
937fb48
Merge pull request #1631 from liip/fix-github-build
dbu Aug 27, 2025
c00acc3
Merge pull request #1628 from deguif/cache-config-default-value
dbu Aug 27, 2025
e1cb843
feature: enable autowiring for filter service
deguif Aug 29, 2025
0f7b8d6
Merge pull request #1633 from deguif/autowire-filter-service
dbu Sep 2, 2025
761745b
feature: support psr cache on s3 resolver
deguif Aug 27, 2025
e603ff4
Merge pull request #1630 from deguif/s3-resolver-psr-cache
dbu Sep 2, 2025
8463162
feature: support disabled acls on s3 buckets
deguif Aug 26, 2025
676cfd1
feature: add ability to inject a custom S3 client on aws s3 resolver
deguif Aug 27, 2025
5998a53
Merge pull request #1632 from deguif/s3-client-configuration
dbu Sep 3, 2025
1f33ca3
Merge pull request #1629 from deguif/s3-disabled-acl
dbu Sep 3, 2025
f80dc13
prepare release
dbu Sep 3, 2025
876d233
Refactor `Request::get()` usages
dmaicher Oct 8, 2025
4678f7f
add note for future improvement
dbu Oct 9, 2025
6075d4f
Refactor `Request::get()` usages
dbu Oct 9, 2025
f8c98a5
prepare release
dbu Oct 9, 2025
3fcf2b7
drop support for unmaintained Symfony versions
dmaicher Oct 13, 2025
2da06ab
Merge pull request #1639 from dmaicher/drop_legacy_sf
dbu Oct 14, 2025
079e743
update changelog
dbu Oct 14, 2025
e49bfc9
Start moving Symfony DI config from XML to PHP format
dmaicher Oct 13, 2025
1b43e2e
Merge pull request #1637 from dmaicher/xml_to_php
dbu Oct 21, 2025
b111bda
Migrate `imagine.xml` config to php format
dmaicher Oct 21, 2025
6f1e79f
Merge pull request #1640 from dmaicher/xml_to_php
dbu Oct 22, 2025
ea394ec
Migrate remaining xml config files to php
dmaicher Oct 26, 2025
ed21729
Merge pull request #1641 from dmaicher/xml_to_php
dbu Oct 27, 2025
809ee3d
Allow Symfony 8
dmaicher Oct 29, 2025
d3d2972
Merge pull request #1642 from dmaicher/symfony_8
dbu Oct 30, 2025
3c197bc
test with php 8.5
dbu Nov 24, 2025
335121e
Merge pull request #1644 from liip/php-85
dbu Dec 1, 2025
ddcd347
dummy commit
dbu Jan 5, 2026
dec6314
Merge pull request #1646 from liip/legacy-cleanup
dbu Jan 5, 2026
9fe7089
Add AssetMapper support (#1645)
tito10047 Jan 5, 2026
66cb2e1
prepare release
dbu Jan 5, 2026
7abbd9c
mark asset mapper factory service template abstract like the other se…
dbu Jan 6, 2026
4b410f0
Merge pull request #1649 from liip/service-abstract
dbu Jan 6, 2026
3d2ff99
lint container in ci
dbu Jan 6, 2026
92f98ec
Merge pull request #1650 from liip/check-container-lint
dbu Jan 6, 2026
69d2df3
prepare release
dbu Jan 6, 2026
d3a5052
Merge remote-tracking branch 'origin/2.x' into 2-to-3
dbu Mar 19, 2026
de669ae
cleanup deprecations for new major version
dbu Mar 19, 2026
31c61ac
cs fixer
dbu Mar 19, 2026
e2520f2
fix merge mistake in composer.json
dbu Mar 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ on:

jobs:
php-cs-fixer:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v5

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ on:

jobs:
phpstan:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v5

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -27,5 +27,8 @@ jobs:
- name: Add vips
run: composer require rokka/imagine-vips

- name: Add asset mapper
run: composer require symfony/asset-mapper

- name: Run PHPStan
run: vendor/bin/phpstan analyze
26 changes: 10 additions & 16 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,52 +11,44 @@ on:
jobs:
phpunit:
name: "PHP ${{ matrix.php }} + ${{ matrix.dependencies }} dependencies + Symfony ${{ matrix.symfony }}"
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2', '8.3']
dependencies: [highest]
symfony: ['*']
stability: ['stable']
include:
# Minimum supported dependencies with the oldest supported PHP version
- php: '8.1'
dependencies: lowest
symfony: '*'
stability: 'stable'

# Minimum supported dependencies with the latest supported PHP version
- php: '8.3'
- php: '8.5'
dependencies: lowest
symfony: '*'
stability: 'stable'

# Test each supported Symfony version with the lowest supported PHP version
- php: '8.1'
dependencies: highest
symfony: '6.4.*'
stability: 'stable'

- php: '8.2'
dependencies: highest
symfony: '7.0.*'
stability: 'stable'

- php: '8.3'
dependencies: highest
symfony: '7.0.*'
stability: 'stable'

# Test Symfony 7.1 dev
- php: '8.2'
- php: '8.4'
dependencies: highest
symfony: '7.1.*'
stability: 'dev'
symfony: '8.0.*'

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Configure coverage driver
id: coverage
Expand All @@ -69,8 +61,7 @@ jobs:
coverage: ${{ steps.coverage.outputs.driver }}
extensions: gd, imagick

- name: Require Symfony version
if: matrix.symfony != '*'
- name: Install symfony/flex
run: |
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require --no-interaction --no-progress symfony/flex
Expand All @@ -84,6 +75,9 @@ jobs:
with:
dependency-versions: ${{ matrix.dependencies }}

- name: Lint container
run: ./Tests/Functional/app/bin/console lint:container

- name: Cache PHPUnit
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -114,7 +108,7 @@ jobs:

coveralls-finish:
needs: [phpunit]
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Notify Coveralls when build is finished
uses: coverallsapp/github-action@master
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,35 @@ for a given releases. Unreleased, upcoming changes will be updated here periodic
- Removed deprecated code and BC for old Symfony versions.
- The response when the `filter` parameter in a resolve request is not an array is now 400 bad request, and no longer 404 not found.
- Simplified the `ProxyResolver` to no longer do the undocumented regex replace logic on domain names (reverting [#687](https://github.com/liip/LiipImagineBundle/pull/687)).
- Removed `use_psr_cache`, the cache now always needs to be a PSR cache and Doctrine cache is no longer supported.

# 2.x

## [2.17.1](https://github.com/liip/LiipImagineBundle/tree/2.17.1)

- Fix for AssetMapperLoaderFactory service definition to not fail when not configured ([dbu](https://github.com/liip/LiipImagineBundle/pull/1649))

## [2.17.0](https://github.com/liip/LiipImagineBundle/tree/2.17.0)

- Add AssetMapperLocator to work with the asset mapper in development mode ([tito10047](https://github.com/liip/LiipImagineBundle/pull/1645))
- Drop support for PHP 7 ([dbu](https://github.com/liip/LiipImagineBundle/pull/1646))

## [2.16.0](https://github.com/liip/LiipImagineBundle/tree/2.16.0)

- Compatible with Symfony 8 ([dmaicher](https://github.com/liip/LiipImagineBundle/pull/1642)) (including a bunch of PRs to change all XML configuration to PHP configuration)
- Test with PHP 8.5 and fix deprecations([dbu](https://github.com/liip/LiipImagineBundle/pull/1644))
- Drop support for unmaintained Symfony versions ([dmaicher](https://github.com/liip/LiipImagineBundle/pull/1639))

## [2.15.0](https://github.com/liip/LiipImagineBundle/tree/2.15.0)

- Refactored `Request::get()` to `Request::query::get()` to avoid deprecation with Symfony 7.4 ([dmaicher](https://github.com/liip/LiipImagineBundle/pull/1636))

## [2.14.0](https://github.com/liip/LiipImagineBundle/tree/2.14.0)

- Allow configuring empty ACLs on AWS S3 resolver to skip ACLs ([deguif](https://github.com/liip/LiipImagineBundle/pull/1629))
- Add `use_psr_cache` option to AWS S3 resolver configuration in order to support PSR cache. Configuring a doctrine cache now will trigger a deprecation ([deguif](https://github.com/liip/LiipImagineBundle/pull/1630))
- Add ability to specify a custom s3 client service in aws s3 resolver configuration ([deguif](https://github.com/liip/LiipImagineBundle/pull/1632))

## [2.13.3](https://github.com/liip/LiipImagineBundle/tree/2.13.3)

- Prevent InvalidArgumentException from FileinfoMimeTypeGuesser when chain loading an image that is not a file ([revoltek-daniel](https://github.com/liip/LiipImagineBundle/pull/1614))
Expand Down
22 changes: 22 additions & 0 deletions Tests/Functional/app/bin/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env php
<?php

use Liip\ImagineBundle\Tests\Functional\app\AppKernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;

$vendorDir = dirname(dirname(dirname(dirname(__DIR__)))).'/vendor';
if (!is_dir($vendorDir)) {
throw new LogicException('Dependencies are missing. Try running "composer install".');
}

if (!is_file("$vendorDir/autoload_runtime.php")) {
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
}

require_once "$vendorDir/autoload_runtime.php";

return function (array $context) {
$kernel = new AppKernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);

return new Application($kernel);
};
39 changes: 22 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
"php": "^8.1",
"ext-mbstring": "*",
"imagine/imagine": "^1.3.2",
"symfony/filesystem": "^6.4|^7.0",
"symfony/finder": "^6.4|^7.0",
"symfony/framework-bundle": "^6.4|^7.0",
"symfony/mime": "^6.4|^7.0",
"symfony/options-resolver": "^6.4|^7.0",
"symfony/process": "^6.4|^7.0",
"symfony/dependency-injection": "^6.4|^7.4|^8.0",
"symfony/deprecation-contracts": "^2.5 || ^3",
"symfony/filesystem": "^6.4|^7.3|^8.0",
"symfony/finder": "^6.4|^7.3|^8.0",
"symfony/framework-bundle": "^6.4|^7.3|^8.0",
"symfony/mime": "^6.4|^7.3|^8.0",
"symfony/options-resolver": "^6.4|^7.3|^8.0",
"symfony/process": "^6.4|^7.3|^8.0",
"twig/twig": "^2.9|^3.0"
},
"require-dev": {
Expand All @@ -42,16 +44,16 @@
"phpstan/phpstan-symfony": "^1.0",
"psr/cache": "^3.0",
"psr/log": "^1.0|^2.0|^3.0",
"symfony/asset": "^6.4|^7.0",
"symfony/browser-kit": "^6.4|^7.0",
"symfony/cache": "^6.4|^7.0",
"symfony/console": "^6.4|^7.0",
"symfony/dependency-injection": "^6.4|^7.0",
"symfony/form": "^6.4|^7.0",
"symfony/messenger": "^6.4|^7.0",
"symfony/phpunit-bridge": "^7.0.2",
"symfony/validator": "^6.4|^7.0",
"symfony/yaml": "^6.4|^7.0"
"symfony/asset": "^6.4|^7.3|^8.0",
"symfony/browser-kit": "^6.4|^7.3|^8.0",
"symfony/cache": "^6.4|^7.3|^8.0",
"symfony/console": "^6.4|^7.3|^8.0",
"symfony/form": "^6.4|^7.3|^8.0",
"symfony/messenger": "^6.4|^7.3|^8.0",
"symfony/phpunit-bridge": "^7.3",
"symfony/runtime": "^6.4|^7.3|^8.0",
"symfony/validator": "^6.4|^7.3|^8.0",
"symfony/yaml": "^6.4|^7.3|^8.0"
},
"suggest": {
"ext-exif": "required to read EXIF metadata from images",
Expand All @@ -70,6 +72,9 @@
"symfony/messenger": "If you like to process images in background"
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"symfony/runtime": true
}
}
}
23 changes: 22 additions & 1 deletion doc/cache-resolver/aws_s3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,24 @@ Create Resolver from a Factory
region: "%amazon.s3.region%"
bucket: "%amazon.s3.bucket%"

Create Resolver from a custom S3 client service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code-block:: yaml

# app/config/config.yml

liip_imagine:
resolvers:
aws_s3_resolver:
aws_s3:
client_id: 'custom_aws_s3_client_service'
bucket: "%amazon.s3.bucket%"
get_options:
Scheme: https
put_options:
CacheControl: "max-age=86400"

Create Resolver as a Service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -204,8 +222,11 @@ current. You just need to configure them with defined options.
aws_s3:
#...
proxies: ["https://one.domain.com", "https://two.domain.com"]
cache: true
cache: 'cache_name'

.. note::

The ``cache`` needs to be a PSR cache instance.

If enabled both first one will be :ref:`Cache <cache-resolver-cache>`, then
:ref:`Proxy <cache-resolver-proxy>` and after all process delegates to AwsS3 resolver.
Expand Down
6 changes: 4 additions & 2 deletions doc/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ There are several configuration options available:
* ``cache`` - default cache resolver. Default value: ``web_path`` (which means
the standard web_path resolver is used)
* ``data_loader`` - name of a custom data loader. Default value: ``filesystem``
(which means the standard filesystem loader is used).
(which means the standard filesystem loader is used). Built-in loaders include:
``filesystem``, ``chain``, ``flysystem``, ``stream``, and ``asset_mapper``.
* ``twig.mode`` - Twig filter integration. ``none`` disables the twig filters, ``lazy`` enables
Twig using the Twig runtime for lazy loading. The default value is ``lazy``.
The twig filter automatically picks up the ``framework.assets.version`` configuration. You can
Expand All @@ -97,7 +98,8 @@ There are several configuration options available:
* ``cache`` - default cache resolver. Default value: ``web_path`` (which means
the standard web_path resolver is used)
* ``data_loader`` - name of a custom data loader. Default value: ``filesystem``
(which means the standard filesystem loader is used).
(which means the standard filesystem loader is used). Built-in loaders include:
``filesystem``, ``chain``, ``flysystem``, ``stream``, and ``asset_mapper``.
* ``post_processors`` - sets post-processors to be applied on filtered image
(see Post-Processors section in the :doc:`filters chapter <filters>` for details).
* ``driver`` - one of the drivers: ``gd``, ``imagick``, ``gmagick``, ``vips``.
Expand Down
1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<ini name="intl.default_locale" value="en"/>
<ini name="intl.error_level" value="0"/>
<ini name="memory_limit" value="-1"/>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0" />
</php>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
Expand Down
2 changes: 1 addition & 1 deletion src/Binary/Loader/ChainLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ChainLoader implements LoaderInterface
*/
public function __construct(array $loaders)
{
$this->loaders = array_filter($loaders, function ($loader) {
$this->loaders = array_filter($loaders, static function ($loader) {
return $loader instanceof LoaderInterface;
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/Binary/Loader/FileSystemLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(
public function find($path)
{
$path = $this->locator->locate($path);
if (false === \is_file($path)) {
if (false === is_file($path)) {
throw new NotLoadableException(\sprintf('Source image: "%s" is no file.', $path));
}
$mimeType = $this->mimeTypeGuesser->guessMimeType($path);
Expand Down
2 changes: 1 addition & 1 deletion src/Binary/Locator/FileSystemLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private function sanitizeRootPath(string $path, bool $allowUnresolvable): ?strin
*/
private function sanitizeAbsolutePath(string $path): string
{
$roots = array_filter($this->roots, function (string $root) use ($path): bool {
$roots = array_filter($this->roots, static function (string $root) use ($path): bool {
return 0 === mb_strpos($path, $root);
});

Expand Down
2 changes: 1 addition & 1 deletion src/Command/CacheCommandTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private function outputCommandHeader(): void
private function outputCommandResult(array $images, array $filters, string $singularAction): void
{
if (!$this->outputMachineReadable) {
$wordPluralizer = function (int $count, string $singular) {
$wordPluralizer = static function (int $count, string $singular) {
return 1 === $count ? $singular : \sprintf('%ss', $singular);
};

Expand Down
2 changes: 1 addition & 1 deletion src/Component/Console/Style/ImagineStyle.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,6 @@ private function compileString(string $format, array $replacements = []): string
} catch (\ValueError $error) {
}

throw new InvalidArgumentException(\sprintf('Invalid string format "%s" or replacements "%s".', $format, implode(', ', array_map(function ($replacement) { return var_export($replacement, true); }, $replacements))));
throw new InvalidArgumentException(\sprintf('Invalid string format "%s" or replacements "%s".', $format, implode(', ', array_map(static function ($replacement) { return var_export($replacement, true); }, $replacements))));
}
}
2 changes: 1 addition & 1 deletion src/Config/Stack.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function getFilters(): array
private function setFilters(array $filters): void
{
foreach ($filters as $filter) {
if (!($filter instanceof FilterInterface)) {
if (!$filter instanceof FilterInterface) {
throw new InvalidArgumentException('Unknown filter provided.');
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/ImagineController.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function __construct(
public function filterAction(Request $request, string $path, string $filter): RedirectResponse
{
$path = PathHelper::urlPathToFilePath($path);
$resolver = $request->get('resolver');
$resolver = $request->query->has('resolver') ? $request->query->getString('resolver') : null;

return $this->createRedirectResponse(function () use ($path, $filter, $resolver, $request) {
return $this->filterService->getUrlOfFilteredImage(
Expand All @@ -84,7 +84,7 @@ public function filterAction(Request $request, string $path, string $filter): Re
*/
public function filterRuntimeAction(Request $request, string $hash, string $path, string $filter): RedirectResponse
{
$resolver = $request->get('resolver');
$resolver = $request->query->has('resolver') ? $request->query->getString('resolver') : null;
$path = PathHelper::urlPathToFilePath($path);
$runtimeConfig = $request->query->all('filters');

Expand Down
Loading
Loading