250 Commits

Author SHA1 Message Date
Dariusz Ruminski
3c05360e71 PHP CS Fixer: enable no_useless_else 2026-01-12 14:23:58 +01:00
Gregor Harlan
add24c0213 optimize in_array calls 2025-07-15 11:40:20 +02:00
Nicolas Grekas
d802330d4a Merge branch '7.3' into 7.4
* 7.3:
  Fix-type-error-when-revealing-broken-secret
  fix compatibility with Relay 0.11
  [Security] Handle non-callable implementations of `FirewallListenerInterface`
  [DomCrawler] Allow selecting `button`s by their `value`
  flip excluded properties with keys with Doctrine-style constraint config
  [JsonPath] Test against official compliance test suite
  Silence E_DEPRECATED and E_USER_DEPRECATED
  [HttpCache] Hit the backend only once after waiting for the cache lock
  fix compatibility with Symfony 7.4
  [Form] Keep submitted values when keep_as_list option of collection type is enabled
  [Form] Fix `keep_as_list` when data is not an array
  [JsonPath] Fix subexpression evaluation in filters
  [JsonPath] Fix support for comma separated indices
2025-06-15 12:08:16 +02:00
Nicolas Grekas
38b6666bb0 Merge branch '6.4' into 7.2
* 6.4:
  Silence E_DEPRECATED and E_USER_DEPRECATED
  [HttpCache] Hit the backend only once after waiting for the cache lock
  fix compatibility with Symfony 7.4
2025-06-13 09:47:28 +02:00
Matthias Pigulla
9e9c725272 [HttpCache] Hit the backend only once after waiting for the cache lock 2025-06-13 09:10:59 +02:00
Matthias Pigulla
6bfa92c8de [HttpCache] Add a waiting trace when finding the cache locked 2025-05-30 08:41:04 +02:00
Nicolas Grekas
8672d96bd8 Merge branch '7.1' into 7.2
* 7.1:
  fix: ignore missing directory in isVendor()
  [OptionsResolver] Allow Union/Intersection Types in Resolved Closures
  Issue #58821: [DependencyInjection] Support interfaces in ContainerBuilder::getReflectionClass().
  Dynamically fix compatibility with doctrine/data-fixtures v2
  [HttpKernel] Ensure HttpCache::getTraceKey() does not throw exception
  don't call EntityManager::initializeObject() with scalar values
  make RelayProxyTrait compatible with relay extension 0.9.0
  [Validator] review italian translations
  Update PR template
2024-11-20 12:17:29 +01:00
Nicolas Grekas
c90d12b908 Merge branch '6.4' into 7.1
* 6.4:
  fix: ignore missing directory in isVendor()
  [OptionsResolver] Allow Union/Intersection Types in Resolved Closures
  Issue #58821: [DependencyInjection] Support interfaces in ContainerBuilder::getReflectionClass().
  Dynamically fix compatibility with doctrine/data-fixtures v2
  [HttpKernel] Ensure HttpCache::getTraceKey() does not throw exception
  don't call EntityManager::initializeObject() with scalar values
  [Validator] review italian translations
  Update PR template
2024-11-20 12:08:58 +01:00
Nicolas Grekas
7f0fd8a8f5 Merge branch '5.4' into 6.4
* 5.4:
  Issue #58821: [DependencyInjection] Support interfaces in ContainerBuilder::getReflectionClass().
  Dynamically fix compatibility with doctrine/data-fixtures v2
  [HttpKernel] Ensure HttpCache::getTraceKey() does not throw exception
  don't call EntityManager::initializeObject() with scalar values
  [Validator] review italian translations
  Update PR template
2024-11-20 11:56:23 +01:00
Grégoire Pineau
455dfd36b9 [HttpKernel] Ensure HttpCache::getTraceKey() does not throw exception 2024-11-20 11:47:16 +01:00
Christian Flothmann
9f4fed4dec Merge branch '7.1' into 7.2
* 7.1:
  remove custom CSV escape character from tests
  [HttpKernel] ESI fragment content may be missing in conditional requests
  [SecurityBundle] Revert adding `_stateless` attribute to the request when firewall is stateless and the attribute is not already set
  fix compatibility with Twig 3.12 and 4.0
  Improve and add tests for Last-Modified computation with ESI responses
2024-08-16 14:15:16 +02:00
Christian Flothmann
fb644539e8 Merge branch '6.4' into 7.1
* 6.4:
  remove custom CSV escape character from tests
  [HttpKernel] ESI fragment content may be missing in conditional requests
  [SecurityBundle] Revert adding `_stateless` attribute to the request when firewall is stateless and the attribute is not already set
  fix compatibility with Twig 3.12 and 4.0
  Improve and add tests for Last-Modified computation with ESI responses
2024-08-16 13:43:25 +02:00
Matthias Pigulla
b962a5fdfb [HttpKernel] ESI fragment content may be missing in conditional requests 2024-08-16 11:49:07 +02:00
Dariusz Ruminski
b1398ce750 chore: CS fixes 2024-06-24 18:01:36 +02:00
Alexander M. Turek
c307b0c1b7 Prefix all sprintf() calls 2024-06-20 17:52:34 +02:00
Alexander M. Turek
a88994416a [HttpKernel] Use CPP 2024-02-06 10:15:06 +01:00
Nicolas Grekas
3934259de2 Merge branch '7.0' into 7.1
* 7.0:
  List CS fix in .git-blame-ignore-revs
  Fix implicitly-required parameters
  minor #53524 [Messenger] [AmazonSqs] Allow `async-aws/sqs` version 2 (smoench)
  Fix bad merge
  List CS fix in .git-blame-ignore-revs
  Fix implicitly-required parameters
  List CS fix in .git-blame-ignore-revs
  Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
  [Messenger][AmazonSqs] Allow async-aws/sqs version 2
2024-01-23 16:06:13 +01:00
Nicolas Grekas
24671ba111 Merge branch '6.4' into 7.0
* 6.4:
  Fix implicitly-required parameters
  minor #53524 [Messenger] [AmazonSqs] Allow `async-aws/sqs` version 2 (smoench)
  Fix bad merge
  List CS fix in .git-blame-ignore-revs
  Fix implicitly-required parameters
  List CS fix in .git-blame-ignore-revs
  Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
  [Messenger][AmazonSqs] Allow async-aws/sqs version 2
2024-01-23 16:02:46 +01:00
Nicolas Grekas
ab69bdd211 Merge branch '5.4' into 6.3
* 5.4:
  Fix implicitly-required parameters
  List CS fix in .git-blame-ignore-revs
  Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
  [Messenger][AmazonSqs] Allow async-aws/sqs version 2
2024-01-23 15:35:58 +01:00
Nicolas Grekas
c31bb9215c Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value 2024-01-23 14:51:25 +01:00
Alexandre Daubois
fe159d1971 Set strict parameter of in_array to true where possible 2023-12-14 11:33:29 +01:00
Wouter de Jong
34cbd3eea1 [Components] Convert to native return types 2023-07-05 15:06:06 +02:00
Frank Fiebig
08c0866859 [Lock] 7.0 remove deprecations in Lock Component 2023-07-05 10:10:07 +02:00
Nicolas Grekas
fc9fbac1f1 Merge branch '6.2' into 6.3
* 6.2:
  Do not check errored definitions’ type
  [HttpKernel] Fix restoring surrogate content from cache
  [HttpKernel] Do not reset lazy services if they are not initialized
  [HttpClient] Fix getting through proxies via CONNECT
  Remove legacy filters remnants
2023-05-05 17:55:45 +02:00
Nicolas Grekas
ceebcf9397 Merge branch '5.4' into 6.2
* 5.4:
  Do not check errored definitions’ type
  [HttpKernel] Fix restoring surrogate content from cache
  [HttpClient] Fix getting through proxies via CONNECT
  Remove legacy filters remnants
2023-05-05 17:52:57 +02:00
Nicolas Grekas
d6e45e4ed7 [HttpKernel] Fix restoring surrogate content from cache 2023-05-05 15:22:42 +02:00
Fabien Potencier
047a4ce39a Merge branch '5.4' into 6.2
* 5.4:
  [HttpKernel] Don't use eval() to render ESI/SSI
2023-05-05 13:02:22 +02:00
Nicolas Grekas
568365cfe7 [HttpKernel] Don't use eval() to render ESI/SSI 2023-05-04 14:19:30 +02:00
Nicolas Grekas
f4e575b0f8 [HttpKernel] Don't use eval() to render ESI/SSI 2023-04-17 11:36:41 +02:00
Yanick Witschi
eaf1f26a45 [HttpKernel] Add skip_response_headers to the HttpCache options 2023-02-21 13:49:38 +01:00
Nicolas Grekas
8ec609e2c9 Merge branch '6.2' into 6.3
* 6.2:
  CS fix
  Fix test provider
2023-02-16 11:14:28 +01:00
Wouter de Jong
8efef814fc Add void return types 2023-02-13 14:18:23 +01:00
Christian Flothmann
6954696846 Merge branch '5.4' into 6.2
* 5.4:
  fix test
  [Response] `getMaxAge()` returns non-negative integer
2023-02-04 11:17:16 +01:00
pkruithof
820ae32996 [Response] getMaxAge() returns non-negative integer 2023-02-04 09:34:22 +01:00
Nicolas Grekas
8ada246e3b Use ??= more 2022-11-02 10:08:04 +01:00
matheo
b88571e087 Ban DateTime from the codebase 2022-10-09 10:55:40 +02:00
Grégoire Pineau
3b05051d9e [CS] Remove @inheritdoc PHPDoc 2022-08-25 17:27:04 +02:00
Fabien Potencier
4e86044dfa feature #46763 [HttpCache] Do not call terminate() on cache hit (Toflar)
This PR was merged into the 6.2 branch.

Discussion
----------

[HttpCache] Do not call terminate() on cache hit

| Q             | A
| ------------- | ---
| Branch?       | 6.2
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | yes
| Tickets       | -
| License       | MIT
| Doc PR        | -

Currently, `HttpCache` always calls the `kernel.terminate` events, even if the response is coming from cache.
Why is this a problem?

`kernel.terminate` events are used to do things after the response has been sent to the visitor. At least that happens if you have support for `fastcgi_finish_request()`.
For Contao for example, we use this to dispatch a message to update the search index but you can imagine a lot of stuff being done there, like sending e-mails etc. According [to the docs](https://symfony.com/doc/current/components/http_kernel.html#8-the-kernel-terminate-event), it says "perform some heavy action".

This means that currently, the system is basically always booted even when the response is coming from `HttpCache` because dispatching the `TerminateEvent` causes the container to be booted etc. which makes the system slower than it needs to be.

We don't need to update the search index when the response is coming from the cache because it already is up to date. And there are no e-mails or other "heavy actions" to perform because by definition, nothing could've happened as the system was not booted (or should not have been).

Also, imagine if you used a "real" reverse proxy like Varnish. There's no call to the back end either when there's a cache hit so it's actually an inconsistency. You cannot "perform some heavy action" there either. If you wanted to, it would have to be implemented in the proxy itself. So Varnish would need to trigger that heavy action. HttpCache should behave just the same.
You could e.g. use the `EventDispatchingHttpCache` from https://github.com/FriendsOfSymfony/FOSHttpCache, if you need something like that.

Commits
-------

662eb17cb7 [HttpCache] Do not call terminate() on cache hit
2022-06-27 08:18:36 +02:00
Nicolas Grekas
36fcfd8ccc Merge branch '6.0' into 6.1
* 6.0:
  [HttpKernel] Fix a PHP 8.1 deprecation notice in HttpCache
  Add an invariable word in french
  [Serializer] Fix denormalization union types with constructor
2022-06-26 18:35:04 +02:00
Nicolas Grekas
8b1bce2319 Merge branch '5.4' into 6.0
* 5.4:
  [HttpKernel] Fix a PHP 8.1 deprecation notice in HttpCache
  Add an invariable word in french
  [Serializer] Fix denormalization union types with constructor
2022-06-26 18:34:50 +02:00
Nicolas Grekas
4e46b3abc6 Merge branch '4.4' into 5.4
* 4.4:
  [HttpKernel] Fix a PHP 8.1 deprecation notice in HttpCache
  [Serializer] Fix denormalization union types with constructor
2022-06-26 18:30:39 +02:00
Matthias Pigulla
546634a85c [HttpKernel] Fix a PHP 8.1 deprecation notice in HttpCache 2022-06-26 18:26:10 +02:00
Yanick Witschi
f0fd041a26 [HttpCache] Do not call terminate() on cache hit 2022-06-25 22:28:08 +02:00
Nicolas Grekas
da802b6efc Bump minimum version of PHP to 8.1 2022-02-25 12:15:52 +01:00
Nicolas Grekas
5bba3f4ff0 Add more nullsafe operators 2021-12-16 23:15:42 +01:00
Alexander M. Turek
4c996585cb Make use of the nullsafe operator 2021-12-13 21:40:50 +01:00
Fabien Potencier
9c9c39041c Remove FQCN type hints on properties 2021-12-08 16:13:44 +01:00
Alexander M. Turek
180f95177c [HttpKernel] Add types to private properties
Signed-off-by: Alexander M. Turek <me@derrabus.de>
2021-09-07 12:43:05 +02:00
Nicolas Grekas
d5b7138829 Merge branch '5.4' into 6.0
* 5.4:
  Fix skip condition for INTL
  [Messenger] Fix `ErrorDetailsStamp` denormalization
  [Translation] Extract translatable content on twig set
  Simplify code
  [FrameworkBundle] Add BrowserKitAssertionsTrait::assertThatForBrowser
  Fix composer.json versions
  [Ldap] Fixing the behaviour of getting LDAP Attributes
  Fix composer.json versions
  Remove redundant license info
  [HttpFoundation] Fix isNotModified determination logic
  Fix Url Validator false positives
  [Translation] Reverse fallback locales
  [Console] Backport minor refactorings
  [FrameworkBundle] Fall back to default configuration in debug:config and consistently resolve parameter values
  notifier smsapi - fixed checking whether message is sent
  allow null for framework.translator.default_path
  improve failure messages of the CrawlerSelectorTextContains constraint
2021-08-26 10:28:23 +02:00
Nicolas Grekas
ae124bf6f1 Merge branch '5.3' into 5.4
* 5.3:
  Fix skip condition for INTL
  [Messenger] Fix `ErrorDetailsStamp` denormalization
  [Translation] Extract translatable content on twig set
  Simplify code
  Fix composer.json versions
  Fix composer.json versions
  Remove redundant license info
  [HttpFoundation] Fix isNotModified determination logic
  Fix Url Validator false positives
  [Translation] Reverse fallback locales
  [FrameworkBundle] Fall back to default configuration in debug:config and consistently resolve parameter values
  notifier smsapi - fixed checking whether message is sent
  allow null for framework.translator.default_path
  improve failure messages of the CrawlerSelectorTextContains constraint
2021-08-26 10:23:47 +02:00