Commit Graph

53507 Commits

Author SHA1 Message Date
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
Jérémy Derussé
02cbb3a92c
Merge branch '5.2' into 5.x
* 5.2:
  Use createMock() instead of a getter
  [ErrorHandler] Fix strpos error when trying to call a method without a name
  use proper keys to not override appended files
  take into account all label related options
  Fix console logger according to PSR-3
2021-01-28 23:08:00 +01:00
Jérémy Derussé
a07638b14a
Merge branch '4.4' into 5.2
* 4.4:
  Use createMock() instead of a getter
  [ErrorHandler] Fix strpos error when trying to call a method without a name
  use proper keys to not override appended files
  Fix console logger according to PSR-3
2021-01-28 23:06:19 +01:00
Jérémy Derussé
945c7c590c
minor #39920 [Console] Fix console logger according to PSR-3 (alex-dev)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Fix console logger according to PSR-3

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #39050, #29138
| License       | MIT

`Symfony\Component\HttpKernel\EventListener\ErrorListener` logs non-HTTP exceptions at `LogLevel::CRITICAL`.
`Symfony\Component\Messenger\Worker` logs unrecoverable exceptions at `LogLevel::CRITICAL`.
`Symfony\Component\Console\EventListener\ErrorListener` logs exceptions at `LogLevel::ERROR`.

As per PSR-3, unexpected and unrecoverable exceptions should be logged at `LogLevel::CRITICAL`.

Commits
-------

69fcd075eb Fix console logger according to PSR-3
2021-01-28 23:01:20 +01:00
Robin Chalas
be788ee119 minor #39997 Use createMock() instead of a getter (OskarStark)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

Use createMock() instead of a getter

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

Before I go on, are you interested in such change @nicolas-grekas ?

Commits
-------

9629dafa66 Use createMock() instead of a getter
2021-01-28 20:07:58 +01:00
Oskar Stark
9629dafa66 Use createMock() instead of a getter 2021-01-28 20:07:50 +01:00
Nicolas Grekas
37166f79e2 bug #40018 [TwigBridge] take into account all label related options (xabbuh)
This PR was merged into the 5.2 branch.

Discussion
----------

[TwigBridge] take into account all label related options

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

Commits
-------

adb0fd1c7d take into account all label related options
2021-01-28 18:00:39 +01:00
Nicolas Grekas
e2428326e3 bug #40023 [Finder]  use proper keys to not override appended files (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Finder]  use proper keys to not override appended files

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

Commits
-------

036c8d71fd use proper keys to not override appended files
2021-01-28 17:58:58 +01:00
Nicolas Grekas
6f6cd50865 feature #40028 [Semaphore] remove "experimental" status (jderusse)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Semaphore] remove "experimental" status

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

/cc @lyrixx

Commits
-------

11f6896b5c [Semaphore] remove "experimental" status
2021-01-28 17:57:45 +01:00
Nicolas Grekas
27fab22fa6 bug #40019 [ErrorHandler] Fix strpos error when trying to call a method without a name (Deuchnord)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] Fix strpos error when trying to call a method without a name

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | None (direct fix)
| License       | MIT
| Doc PR        | None
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

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.
-->

When running the following code:

```php
class Foo
{
    // Some code here
}

$str = ''; // this should not happen, but for some reason, it did.
$foo->{$str}();
```

a fatal error occurs because the method name to execute is empty, but Symfony's error enhancer fails to parse it:

![Error screenshot](https://user-images.githubusercontent.com/7600265/106108704-ec019b80-6148-11eb-82bc-f7801e30fea4.png)

In this PR, I propose a fix with a more clear error to inform the developer about what happened.

Commits
-------

66be87bffc [ErrorHandler] Fix strpos error when trying to call a method without a name
2021-01-28 17:54:55 +01:00
Jérôme Deuchnord
66be87bffc [ErrorHandler] Fix strpos error when trying to call a method without a name 2021-01-28 17:54:48 +01:00
Nicolas Grekas
f0c3bc9f32 feature #38616 [FrameworkBundle][HttpFoundation][Security] Deprecate service "session" (jderusse)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[FrameworkBundle][HttpFoundation][Security] Deprecate service "session"

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | yes
| Tickets       | Fix #10557 and Fix #12839
| License       | MIT
| Doc PR        | TODO

This is a attempt to deprecate service `session` and `SessionInterface`.

This PR replaces the `session` service by a `.session.do-not-use` service (used internally by Symfony) and make `session` a deprecated alias.
In Symfony 6.0 we can remove the `session` service and replace the `SessionListener` by a Factory that build the session (instead of fetching it from container)

This PR also add a short cut `RequestStack::getSession(): ?SessionInterface`

For backward compatibility the `SessionListener` is replaced by `FactorySessionListener` **only when** the user don't override the service `session` (ping @wouterj )

TODO:
- [x] Test many configuration and dependencies (ie. session disabled + csrf)
- [x] ChangeLog and Upgrade
- [x] fix tests

Commits
-------

54acc00769 Deprecat service "session"
2021-01-28 17:45:48 +01:00
Jérémy Derussé
54acc00769
Deprecat service "session" 2021-01-28 16:56:06 +01:00
Nicolas Grekas
bf99d8c9b2 Merge branch '5.2' into 5.x
* 5.2:
  [DoctrineBridge] add missing `@experimental` annotation on Uid generators
2021-01-28 16:02:05 +01:00
Fabien Potencier
b9094f4fd2 bug #40027 [DoctrineBridge] add missing @experimental annotation on Uid generators (nicolas-grekas)
This PR was merged into the 5.2 branch.

Discussion
----------

[DoctrineBridge] add missing `@experimental` annotation on Uid generators

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

Forgotten when we created the classes.

Needed since I plan to remove all the `UuidV*` generators. They're useless and a more flexible approach based on https://github.com/doctrine/DoctrineBundle/pull/1284 is coming.

Commits
-------

e380102590 [DoctrineBridge] add missing `@experimental` annotation on Uid generators
2021-01-28 15:59:42 +01:00
Christian Flothmann
036c8d71fd use proper keys to not override appended files 2021-01-28 15:45:15 +01:00
Jérémy Derussé
11f6896b5c
[Semaphore] remove "experimental" status 2021-01-28 15:38:19 +01:00
Nicolas Grekas
e380102590 [DoctrineBridge] add missing @experimental annotation on Uid generators 2021-01-28 15:21:46 +01:00
Christian Flothmann
adb0fd1c7d take into account all label related options 2021-01-28 09:07:54 +01:00
Fabien Potencier
0c9bf1e12d minor #40016 Remove some leftover @experimental annotations (fabpot)
This PR was merged into the 5.3-dev branch.

Discussion
----------

Remove some leftover @experimental annotations

| 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       | n/a <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | n/a

Commits
-------

315d62e661 Remove some leftover @experimental annotations
2021-01-28 07:18:39 +01:00
Fabien Potencier
315d62e661 Remove some leftover @experimental annotations 2021-01-28 07:13:55 +01:00
Fabien Potencier
d92ad13b56 feature #40010 [Uid] remove "experimental" status (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Uid] remove "experimental" status

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

Commits
-------

2e095561a7 [Uid] remove "experimental" status
2021-01-28 07:11:25 +01:00
Fabien Potencier
8f163702cd feature #40012 [Uid] Add RFC4122 UUID namespaces as constants (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Uid] Add RFC4122 UUID namespaces as constants

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

Discussed with @tgalopin
Will play well with #39507

Commits
-------

4e73aeb169 [Uid] Add RFC4122 UUID namespaces as constants
2021-01-28 06:53:26 +01:00
Nicolas Grekas
4e73aeb169 [Uid] Add RFC4122 UUID namespaces as constants 2021-01-27 23:31:47 +01:00
Nicolas Grekas
1a78e057d5 feature #40008 [Uid] Replace getTime() with getDateTime() (fancyweb)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Uid] Replace getTime() with getDateTime()

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/pull/39507#pullrequestreview-575491827
| License       | MIT
| Doc PR        | -

Getting a `\DateTimeImmutable` has two benefits: easier to use and no float precision problems.

There is however one drawback for UUIDs: we *technically* loose some precision in the output because datetimes do not handle nanoseconds (only microseconds) and uuid timestamps increment every 100 nanoseconds (0.1 microseconds). However, this is theoretical since the increment is only there to generate more entropy. Also, if an end user really want the precision, he can still do the conversion him/herself from the raw data. Finally, because of some rounding problems with floats even on 64b platforms, precision is *actually* won most of the time thanks to the datetime.

The idea is to also accept `\DateTimeInterface` as input in `UuidFactory` and `UlidFactory` (see https://github.com/symfony/symfony/pull/39507) btw.

The breaking change is allowed because the component is experimental.

Commits
-------

360c900acf [Uid] Replace getTime() with getDateTime()
2021-01-27 22:07:25 +01:00
Thomas Calvet
360c900acf [Uid] Replace getTime() with getDateTime() 2021-01-27 22:02:29 +01:00
Nicolas Grekas
2e095561a7 [Uid] remove "experimental" status 2021-01-27 21:55:03 +01:00
Nicolas Grekas
8f9fe02be8 Merge branch '5.2' into 5.x
* 5.2:
  [Uid] improve logic in BinaryUtil::timeToFloat()
2021-01-27 21:51:57 +01:00
Nicolas Grekas
bda55f073a minor #40009 [Uid] improve logic in BinaryUtil::timeToFloat() (nicolas-grekas)
This PR was merged into the 5.2 branch.

Discussion
----------

[Uid] improve logic in BinaryUtil::timeToFloat()

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

Commits
-------

85558248e6 [Uid] improve logic in BinaryUtil::timeToFloat()
2021-01-27 21:51:43 +01:00
Nicolas Grekas
85558248e6 [Uid] improve logic in BinaryUtil::timeToFloat() 2021-01-27 21:50:00 +01:00
Nicolas Grekas
e2e2640d5a Merge branch '5.2' into 5.x
* 5.2:
  [Uid] Fix time to float conversion
  [Serializer] Prevent access to private properties without getters
2021-01-27 19:13:13 +01:00
Nicolas Grekas
bdf3589918 Merge branch '4.4' into 5.2
* 4.4:
  [Serializer] Prevent access to private properties without getters
2021-01-27 19:13:05 +01:00
Nicolas Grekas
8533ea223e bug #40004 [Serializer] Prevent access to private properties without getters (julienfalque)
This PR was merged into the 4.4 branch.

Discussion
----------

[Serializer] Prevent access to private properties without getters

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

When upgrading `symfony/serializer` from `v5.2.1` to `v5.2.2`, the serializer starts throwing exceptions because it cannot access some private properties that don't have a getter. This looks related to #38900.

Commits
-------

f0409b403f [Serializer] Prevent access to private properties without getters
2021-01-27 19:11:59 +01:00
Nicolas Grekas
6a935bb977 bug #40003 [Uid] Fix time to float conversion (fancyweb)
This PR was merged into the 5.2 branch.

Discussion
----------

[Uid] Fix time to float conversion

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

On 32b systems, when the timestamp is before the UNIX epoch, the result is currently shifted by 1. Inverting all the bits is not enough, we need to add 1. I guess https://en.wikipedia.org/wiki/Two%27s_complement is relevant here?

Alternative:
```php
$time = -1 * self::toBase(self::add($time ^ "\xff\xff\xff\xff\xff\xff\xff\xff", "\x00\x00\x00\x00\x00\x00\x00\x01"), self::BASE10);
```

Commits
-------

9680a27246 [Uid] Fix time to float conversion
2021-01-27 19:10:53 +01:00
Nicolas Grekas
296a51a3b0 Merge branch '5.2' into 5.x
* 5.2:
  Fix SES test
2021-01-27 19:08:49 +01:00
Nicolas Grekas
ab48b7bb0b minor #40006 [Mailer] Fix SES test (jderusse)
This PR was merged into the 5.2 branch.

Discussion
----------

[Mailer] Fix SES test

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

When using the native (deprecated) Transport, we used the `SES` AWS endoint, but the new version that rely on async-aws uses `SESV2`. The former uses XML, but the new one use JSON.
Since https://github.com/async-aws/aws/pull/933 `async-aws` is stricter on reponses parsing, and now is not able to parse an XML response when the endpoint expect JSON.

This PR fixes the tests to be compliant with AWS SESV2 protocol

Commits
-------

2176ff6550 Fix SES test
2021-01-27 19:08:37 +01:00
Jérémy Derussé
2176ff6550
Fix SES test 2021-01-27 19:05:29 +01:00
Thomas Calvet
9680a27246 [Uid] Fix time to float conversion 2021-01-27 18:11:54 +01:00
Julien Falque
f0409b403f
[Serializer] Prevent access to private properties without getters 2021-01-27 17:59:11 +01:00
Nicolas Grekas
4cdecb6ccb Merge branch '5.2' into 5.x
* 5.2:
  fix merge
2021-01-27 17:33:26 +01:00
Nicolas Grekas
8449d8a328 fix merge 2021-01-27 17:33:13 +01:00