Commit Graph

53396 Commits

Author SHA1 Message Date
Nicolas Grekas
00d3a0ffcb Allow psr/cache v2 2021-02-04 18:34:20 +01:00
Nicolas Grekas
60dac0cb4c [DeprecationErrorHandler] Fix tests 2021-02-04 18:21:43 +01:00
Robin Chalas
b3ca21c4ba Always autoload string functions on symfony/symfony 2021-02-04 15:23:18 +01:00
Nicolas Grekas
60118f14aa Merge branch '5.2' into 5.x
* 5.2:
  [SecurityBundle] role_names variable instead of roles
  [PhpUnitBridge] fix reporting deprecations when they come from DebugClassLoader
  Fix Request with DNS issue not retried
  Bump Symfony version to 5.2.4
  Update VERSION for 5.2.3
  Update CHANGELOG for 5.2.3
  [ErrorHandler] fix parsing return types in DebugClassLoader
  [ErrorHandler] fix handling messages with null bytes from anonymous classes
  Restore priority for eventSubscribers
2021-02-04 13:03:58 +01:00
Nicolas Grekas
854eabdfe4 bug #40080 Fix Request with DNS issue not retried (jderusse)
This PR was merged into the 5.2 branch.

Discussion
----------

Fix Request with DNS issue not retried

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

When the client failed to resolve the DNS, the RetryableHttpClient should retry the request. But because `$chunk->isLast()` is used later, the original exception is thrown.

/cc @nikophil

Commits
-------

216abd0307 Fix Request with DNS issue not retried
2021-02-04 13:01:57 +01:00
Nicolas Grekas
c92b61857e Merge branch '4.4' into 5.2
* 4.4:
  [SecurityBundle] role_names variable instead of roles
  [PhpUnitBridge] fix reporting deprecations when they come from DebugClassLoader
  [ErrorHandler] fix parsing return types in DebugClassLoader
  [ErrorHandler] fix handling messages with null bytes from anonymous classes
  Restore priority for eventSubscribers
2021-02-04 13:00:01 +01:00
Nicolas Grekas
42b242c88c bug #40089 [SecurityBundle] role_names variable instead of roles (wickedOne)
This PR was merged into the 4.4 branch.

Discussion
----------

[SecurityBundle] role_names variable instead of roles

replaced the roles variable with role_names in order to fix cache warming

introduced @ d64372df8c

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #40087
| License       | MIT
| Doc PR        | symfony/symfony-docs#14923

Commits
-------

58bb614abd [SecurityBundle] role_names variable instead of roles
2021-02-04 12:13:59 +01:00
wickedOne
58bb614abd [SecurityBundle] role_names variable instead of roles
replaced the roles variable with role_names in order to fix cache warming

fixes #40087
2021-02-04 12:13:36 +01:00
Nicolas Grekas
d56887f7c5 bug #40042 [Doctrine] Restore priority for EventSubscribers (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

[Doctrine] Restore priority for EventSubscribers

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

Since #39990, lazy subscribers are called AFTER listeners (which is the opposite of previous implementation).
This PR restore the previous behavior.

Note: ordered subscribers is implemented in #39978 but is considered as a new feature.

Commits
-------

94eac1b83f Restore priority for eventSubscribers
2021-02-04 12:08:06 +01:00
Nicolas Grekas
a7abf0f481 bug #40066 [ErrorHandler] fix parsing return types in DebugClassLoader (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] fix parsing return types in DebugClassLoader

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

In 5.3, we might want to make `SYMFONY_PATCH_TYPE_DECLARATIONS=deprecations=1` the default, so that ppl know when they're missing some return types when they inherit some classes from vendors. This would fix https://github.com/orgs/symfony/projects/1#card-30856423

On 4.4, we have to disable this mode of reporting until these PRs are merged:
- https://github.com/twigphp/Twig/pull/3481
- https://github.com/doctrine/collections/pull/269
- https://github.com/predis/predis/pull/678

Commits
-------

58e32b3c2a [ErrorHandler] fix parsing return types in DebugClassLoader
2021-02-04 12:00:47 +01:00
Nicolas Grekas
6ce4d38d29 bug #40065 [ErrorHandler] fix handling messages with null bytes from anonymous classes (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] fix handling messages with null bytes from anonymous classes

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

PHP truncates error messages at null bytes before calling userland error handlers (known behavior in PHP, marked as "won't fix".)

This doesn't play well with anonymous classes.

This PR works around the issue by getting the message from the stack trace.

Commits
-------

ac94746dc7 [ErrorHandler] fix handling messages with null bytes from anonymous classes
2021-02-04 11:59:55 +01:00
Nicolas Grekas
75e7fb653e bug #40067 [PhpUnitBridge] fix reporting deprecations when they come from DebugClassLoader (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] fix reporting deprecations when they come from DebugClassLoader

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

Best reviewed [ignoring whitespaces](https://github.com/symfony/symfony/pull/40067/files?w=1).

Commits
-------

6a4312deac [PhpUnitBridge] fix reporting deprecations when they come from DebugClassLoader
2021-02-04 11:59:12 +01:00
Nicolas Grekas
6a4312deac [PhpUnitBridge] fix reporting deprecations when they come from DebugClassLoader 2021-02-04 11:56:31 +01:00
Oskar Stark
3eb8a42036 feature #39948 [Notifier] [SpotHit] Add the bridge (JamesHemery)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Notifier] [SpotHit] Add the bridge

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| License       | MIT
| Doc PR        | symfony/symfony-docs#14869
| Recipe PR        | symfony/recipes#881

@OskarStark Bridge added :)

Commits
-------

afcca88af2 [Notifier] [SpotHit] Add the bridge
2021-02-03 15:45:17 +01:00
James Hemery
afcca88af2 [Notifier] [SpotHit] Add the bridge 2021-02-03 15:45:09 +01:00
Jérémy Derussé
216abd0307
Fix Request with DNS issue not retried 2021-02-03 14:01:01 +01:00
Fabien Potencier
90ace3e11f Bump Symfony version to 5.2.4 2021-02-03 05:56:18 +01:00
Fabien Potencier
e16bbdc1a0
Merge pull request #40074 from fabpot/release-5.2.3
released v5.2.3
2021-02-03 05:52:17 +01:00
Fabien Potencier
f422064540 Update VERSION for 5.2.3 2021-02-03 05:51:58 +01:00
Fabien Potencier
4f48e80649 Update CHANGELOG for 5.2.3 2021-02-03 05:51:42 +01:00
Fabien Potencier
4a2e4e890c Merge branch '5.2' into 5.x
* 5.2:
  Streamline dataproviders
  fix validator when we have a false current element
  [Mailer][Mime] Fix case-sensitive handling of header names
  [Mime] Fix case-sensitive handling in Headers::isUniqueHeader()
  [Messenger] Fix Doctrine setup when using a migration
  [yaml] Delelte unused comparison operation
2021-02-03 05:42:38 +01:00
Fabien Potencier
dab16d041e Merge branch '4.4' into 5.2
* 4.4:
  Streamline dataproviders
  fix validator when we have a false current element
  [Mime] Fix case-sensitive handling in Headers::isUniqueHeader()
  [yaml] Delelte unused comparison operation
2021-02-03 05:42:09 +01:00
Nyholm
8bd81b518f
bug #40060 fix validator when we have false returned by the current element of the iterator (FabienSalles)
This PR was merged into the 4.4 branch.

Discussion
----------

fix validator when we have false returned by the current element of the iterator

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #40057
| License       | MIT

Commits
-------

a9e9359581 fix validator when we have a false current element
2021-02-02 22:10:42 +01:00
Nyholm
90e82546d2
minor #40035 Streamline dataproviders (OskarStark)
This PR was merged into the 4.4 branch.

Discussion
----------

Streamline dataproviders

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

No need to create extra PR's on other branches, no more occurrences 👍

Commits
-------

025079b051 Streamline dataproviders
2021-02-02 21:50:21 +01:00
Oskar Stark
025079b051
Streamline dataproviders 2021-02-02 21:48:46 +01:00
Nyholm
84faecf77a
feature #38973 [Messenger] Allow to limit consumer to specific queues (dbu)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Messenger] Allow to limit consumer to specific queues

| Q             | A
| ------------- | ---
| Branch?       | 5.x for features
| Bug fix?      | no
| New feature?  | yes (TODO: changelog)
| Deprecations? | no
| Tickets       | Fix #38630 (i think)
| License       | MIT
| Doc PR        | symfony/symfony-docs#... TODO

(Note: I am aware that there are other solutions for #38630 that might be more elegant. Our usecase does not use fanout, the reason why we need the functionality is different)

**Description**
We have a large application where one part is creating messages for products that need reindexing. A transport decorator decides before queueing whether this is a large effort or a small effort, based on some metric. Based on that, it adds a routing key which is then used in rabbitmq to put the message into the "small" or "large" queue.

We need two separate consumer processes that consume the small and the large queue, for separate scaling and such.

I looked into how we could achieve that. One option is to offer another option in the consume command. That would need to be forwarded to the receiver somehow, i added an interface for it now. The current PR is an illustration of the idea. If you specify a queue that the receiver does not have, things will fail in an inlegeant. If you specify multiple receivers, you can't specify the queue per receiver (though that starts being an odd usecase imho, you could then run two consumers instead)

Another option could be to allow configuring multiple receivers for the same transport that get the queue name(s) injected into their constructor. Then you can consume them separately. This currently needs a ton of configuration and some custom code to work. I can look at doing a PR to make this approach simpler, if you prefer it over the option to the consume command...

Commits
-------

9af1e20dae Adding changelog
81d6a49750 [Messenger] Allow to limit consumer to specific queues
2021-02-02 21:33:54 +01:00
Nyholm
9af1e20dae
Adding changelog 2021-02-02 21:33:33 +01:00
David Buchmann
81d6a49750
[Messenger] Allow to limit consumer to specific queues 2021-02-02 21:29:14 +01:00
Nicolas Grekas
58e32b3c2a [ErrorHandler] fix parsing return types in DebugClassLoader 2021-02-02 17:49:07 +01:00
Nicolas Grekas
ac94746dc7 [ErrorHandler] fix handling messages with null bytes from anonymous classes 2021-02-02 17:39:26 +01:00
Christophe Coevoet
9197199731 minor #40045 [Yaml] Delete unused comparison operation (LoginovIlya)
This PR was merged into the 4.4 branch.

Discussion
----------

[Yaml] Delete unused comparison operation

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #40041
| License       | MIT
| Doc PR        | NA

Commits
-------

3ef7bfd972 [yaml] Delelte unused comparison operation
2021-02-02 10:51:46 +01:00
FabienSalles
a9e9359581 fix validator when we have a false current element
fix coding styles

add type in return
2021-02-02 10:30:20 +01:00
Fabien Potencier
cedcb55097 bug #39954 [Mailer][Mime] Fix case-sensitive handling of header names (piku235)
This PR was squashed before being merged into the 5.2 branch.

Discussion
----------

[Mailer][Mime] Fix case-sensitive handling of header names

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #39953
| License       | MIT
| Doc PR        | -

Fixes case-sensitive handling of header names in "Mime" and "Mailer" component, more in the [ticket](https://github.com/symfony/symfony/issues/39953).

Commits
-------

d563c846f6 [Mailer][Mime] Fix case-sensitive handling of header names
2021-02-02 07:10:15 +01:00
Piotr Kugla
d563c846f6 [Mailer][Mime] Fix case-sensitive handling of header names 2021-02-02 07:10:09 +01:00
Fabien Potencier
ccdcac2a3e bug #40062 [Mime] Fix case-sensitive handling of header names (piku235)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mime] Fix case-sensitive handling of header names

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #39953
| License       | MIT
| Doc PR        | -

Fixes case-sensitive handling of header names in "Mailer" component, more in the [ticket](https://github.com/symfony/symfony/issues/39953) and the [root PR](https://github.com/symfony/symfony/pull/39954).

Commits
-------

b2d7454042 [Mime] Fix case-sensitive handling in Headers::isUniqueHeader()
2021-02-02 07:09:05 +01:00
Piotr Kugla
b2d7454042 [Mime] Fix case-sensitive handling in Headers::isUniqueHeader() 2021-02-01 19:58:28 +01:00
Albert Casademont
94e1d877eb Add SYMFONY_PHPUNIT_REQUIRE env variable
Fixes #39387
2021-02-01 17:10:12 +01:00
Fabien Potencier
8f325f577d bug #40055 [Messenger] Fix Doctrine setup when using a migration (fabpot)
This PR was merged into the 5.2 branch.

Discussion
----------

[Messenger] Fix Doctrine setup when using a migration

| Q             | A
| ------------- | ---
| Branch?       | 5.2 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #39928 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | n/a

#38136 fixed running `messenger:setup-transports` (issue reported in #37179), but it breaks usage with `make:migration` (reported in #39928) as code is already executed in a transaction.

This PR fixes both use cases.

Commits
-------

42eeb44f83 [Messenger] Fix Doctrine setup when using a migration
2021-02-01 16:14:50 +01:00
Fabien Potencier
d9f490a8b2 minor #40047 [HttpClient] Remove unnecessary "?" in url query (michaljusiega)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[HttpClient] Remove unnecessary "?" in url query

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

When creating the Request with passing nullable values as query parameters `HttpClientTrait::resolveUrl` method keeps at the end of URL "?" (IMO unnecessary) character.

Before:
```
        $client = HttpClient::create();
        $response = $client->request('GET', 'http://example.com/', ['query' => ['a' => null]]);

        $url = $response->getInfo('url'); // http://example.com/?
```

After:

```
        $client = HttpClient::create();
        $response = $client->request('GET', 'http://example.com/', ['query' => ['a' => null]]);

        $url = $response->getInfo('url'); // http://example.com/
```

Commits
-------

55831a85db Fix Query URL
2021-02-01 16:03:21 +01:00
Fabien Potencier
42eeb44f83 [Messenger] Fix Doctrine setup when using a migration 2021-02-01 15:36:03 +01:00
Yonel Ceruto
33e6af5850 Fixed updating catalogue metadata from intl domain 2021-01-31 21:39:35 -05:00
Michał Jusięga
55831a85db Fix Query URL 2021-01-31 21:54:11 +01:00
LoginovIlya
3ef7bfd972 [yaml] Delelte unused comparison operation 2021-01-31 18:20:26 +03:00
Carlos Tasada
c52c1e0b9b [HttpFoundation] Setting REQUEST_TIME_FLOAT when constructing a Request object 2021-01-31 14:27:34 +01:00
Jérémy Derussé
94eac1b83f
Restore priority for eventSubscribers 2021-01-31 12:02:49 +01:00
Nicolas Grekas
4537f85963 feature #40029 [DoctineBridge] Remove UuidV*Generator classes (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[DoctineBridge] Remove UuidV*Generator classes

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

There is no benefit in using these classes over creating the UUIDs inline.
Let's keep things simple.

For `UlidGenerator`, I'm keeping it as it will provide something useful once #39507 and https://github.com/doctrine/DoctrineBundle/pull/1284 are finished.

Commits
-------

3c296bd2f5 [DoctineBridge] Remove UuidV*Generator
2021-01-29 16:33:03 +01:00
Nicolas Grekas
3c296bd2f5 [DoctineBridge] Remove UuidV*Generator 2021-01-29 16:31:18 +01:00
Ruud Kamphuis
6f5c9ab80b
Show full URI when route not found
When accessing a route that does not exist, Symfony throws a `NotFoundHttpException` that says `No route found for "POST /path"`.

On some projects this might be good enough to find the root cause, but on projects that have lots of routes on different hosts, it becomes hard to understand how the request was initiated. Was it done over HTTP or HTTPS? What was the hostname? Did the user specify a port?

To make this easier, we now show the full URI of the path, like this: `No route found for "POST https://www.symfony.com/path"`.
2021-01-29 12:00:10 +01:00
Jérémy Derussé
0f4c905b8c
feature #39976 [Console] Add bright colors to console. (CupOfTea696)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Console] Add bright colors to console.

| Q             | A
| ------------- | ---
| Branch?       | 5.x <!-- see below -->
| Bug fix?      |no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? |no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #39869 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#14884 <!-- required for new features -->

Add the "bright" ANSI colours to symfony/console. This adds ANSI escape codes 90-97 and 100-107.
<!--
Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch 5.x.
-->

Commits
-------

dbb94524ba [Console] Add bright colors to console.
2021-01-28 23:09:26 +01:00
Frankie Wittevrongel
dbb94524ba
[Console] Add bright colors to console. 2021-01-28 23:09:11 +01:00