Commit Graph

54653 Commits

Author SHA1 Message Date
Nicolas Grekas
094b507a05 bug #41177 [DependencyInjection] fix empty instanceof-conditionals created by AttributeAutoconfigurationPass (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[DependencyInjection] fix empty instanceof-conditionals created by AttributeAutoconfigurationPass

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

Commits
-------

5c3ee39cfd [DependencyInjection] fix empty instanceof-conditionals created by AttributeAutoconfigurationPass
2021-05-11 19:00:41 +02:00
Nicolas Grekas
5c3ee39cfd [DependencyInjection] fix empty instanceof-conditionals created by AttributeAutoconfigurationPass 2021-05-11 18:40:34 +02:00
Nicolas Grekas
444b40c0b0 Merge branch '5.2' into 5.x
* 5.2:
  [DependencyInjection] fix dumping service-closure-arguments
  [Console] Fix Windows code page support
2021-05-11 18:08:00 +02:00
Nicolas Grekas
ee75b0c54e Merge branch '4.4' into 5.2
* 4.4:
  [DependencyInjection] fix dumping service-closure-arguments
2021-05-11 18:07:35 +02:00
Nicolas Grekas
9a53e6acc1 bug #41176 [DependencyInjection] fix dumping service-closure-arguments (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] fix dumping service-closure-arguments

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

5.3 uses service closures a bit more, so that this is required to make the `lint:container` command work.

Commits
-------

1aa9a249fc [DependencyInjection] fix dumping service-closure-arguments
2021-05-11 17:59:00 +02:00
Nicolas Grekas
1aa9a249fc [DependencyInjection] fix dumping service-closure-arguments 2021-05-11 17:55:42 +02:00
Nicolas Grekas
2289c32bb4 bug #41174 [Console] Fix Windows code page support (orkan)
This PR was submitted for the 5.x branch but it was merged into the 5.2 branch instead.

Discussion
----------

[Console] Fix Windows code page support

My previous PR #41113 was corrected by `@nicolas`-grekas on 3bac7fe. He introduced logical changes in the code which resulted in incorrect behaviour.
The basic idea was to restore the I/O codepage as soon as you get console input. And you have to do this even if `fgets()` returns **false**, because otherwise you'll leave the changed codepage for the rest of the script execution - and that's bad!

Commits
-------

044b585f69 [Console] Fix Windows code page support
2021-05-11 17:45:39 +02:00
Marek Zajac
044b585f69 [Console] Fix Windows code page support 2021-05-11 17:45:21 +02:00
Alexander M. Turek
69b2063bba Merge branch '5.2' into 5.x
* 5.2:
  [Security] Make Login Rate Limiter also case insensitive for non-ascii user identifiers
  only load Sfjs if it is not present
2021-05-11 16:37:54 +02:00
Alexander M. Turek
f3f8027688 Merge branch '4.4' into 5.2
* 4.4:
  only load Sfjs if it is not present
2021-05-11 16:36:09 +02:00
Alexander M. Turek
3348c63eeb bug #41173 [Security] Make Login Rate Limiter also case insensitive for non-ascii user identifiers (Seldaek)
This PR was merged into the 5.2 branch.

Discussion
----------

[Security] Make Login Rate Limiter also case insensitive for non-ascii user identifiers

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

As per discussion in https://github.com/symfony/symfony/pull/41156

Commits
-------

3b7e7fbc7f [Security] Make Login Rate Limiter also case insensitive for non-ascii user identifiers
2021-05-11 16:34:49 +02:00
Jordi Boggiano
3b7e7fbc7f
[Security] Make Login Rate Limiter also case insensitive for non-ascii user identifiers 2021-05-11 15:46:52 +02:00
Alexander M. Turek
1bf384a31c bug #41170 [DependencyInjection] Don't try to load YamlFileLoader if it's not actually needed (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[DependencyInjection] Don't try to load YamlFileLoader if it's not actually needed

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

This PR enables using DI without Config when autoconfiguration is not used.
(When autoconfiguration is used, the dependency on Config is still there.)

Commits
-------

7eb46bd779 [DI] Don't try to load YamlFileLoader if it's not actually needed
2021-05-11 14:40:06 +02:00
Nicolas Grekas
7eb46bd779 [DI] Don't try to load YamlFileLoader if it's not actually needed 2021-05-11 14:23:24 +02:00
Fabien Potencier
89c1be89f0 bug #41168 WDT: Only load "Sfjs" if it is not present already (weaverryan)
This PR was merged into the 4.4 branch.

Discussion
----------

WDT: Only load "Sfjs" if it is not present already

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

Hi!

Playing with Turbo, I noticed two small issues with the WDT:

1) When you click a link (which Turbo loads via AJAX), the new toolbar would correctly load, but its "AJAX tab" would be missing/empty. At first, that seems.. at least... "correct enough". After all, we *did* just load a new web debug toolbar. However, this can be avoided by simply *not* redefining the `Sfjs` variable: if it already exists, just use it. And this is the intention of that object, I believe: for it to be loaded *once*, and then reused over and over again via its `loadToolbar()` method.

2) Additionally, I was experimenting with some crazy prefetch + Turbo functionality. It works, but caused one minor issue with the web debug toolbar. The flow is this:

A) A prefetch request is made to pre-cache a URL in Turbo.
B) When that links is actually clicked, the cached version from (A) is used as the "Preview". It's HTML calls `Sfjs.loadToolbar()`.
C) At the same moment as (B), another AJAX request is made to the same URL from (A) to get the full, fresh page (in case it's out of date).
D) When (C) finishes, it will have its own `Sfjs.loadToolbar()` call.

The problem is that the AJAX request for the first web debug toolbar (from B) sometimes finishes *after* the AJAX call made by Turbo for (C). The result is that the first web debug toolbar tries to activate itself... but it's already gone from the page.

I realize this is a... kind of crazy scenario, but I think the fix is legit: if, for any reason, the web debug toolbar element is not on the page, we should not try to initialize it. It results in:

<img width="431" alt="Screen Shot 2021-05-10 at 3 49 06 PM" src="https://user-images.githubusercontent.com/121003/117716165-429a5f00-b1a7-11eb-9b99-bf08591d2ff4.png">

## To Test

JUST to be on the safe side, I prepared a symfony-demo app with Turbo installed, and using these changes. You can try it here - https://github.com/weaverryan/symfony-demo/tree/turbo - the README is updated to quickly get it running (no need to even run yarn, the JavaScript files are committed).

Thanks!

Commits
-------

47ef65f336 only load Sfjs if it is not present
2021-05-11 08:55:30 +02:00
Nyholm
649d115f0a
feature #36864 [Messenger] Ability to distinguish retry and delay actions (theravel)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Messenger] Ability to distinguish retry and delay actions

Added ability to distinguish retry and delay actions so that different "x-dead-letter-exchange" exchange name will be used in different scenarios.

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

This is a bug which existed since v4.4. The following scenario is possible:

- There are two queues: `A` and `B`, both are bound to the same routing key via "topic" exchange (two different applications for example).
- A message is published to this routing key to "topic" exchange.
- Consumer of queue `A` handles it correctly and acknowledges the message.
- Consumer of queue `B` throws and exception and message goes to retry (for example to queue `delay_delays_key_5`).
- Once message expired in `delay_delays_key_5`, it is delivered again to both `A` and `B` (**again** consumed by consumer `A`).

Expected: behavior of consumer `B` should not cause message duplication to queue `A`.

It is required to make a change of name of temporary delay queue (otherwise "delay" and "retry" queues have incompatible declaration arguments). I left `queue_name_pattern` as is to keep settings of connection backward compatible, but changed internals of queue name construction.

Commits
-------

417aaab6ee [Messenger] Ability to distinguish retry and delay actions
2021-05-10 22:46:16 +02:00
theravel
417aaab6ee
[Messenger] Ability to distinguish retry and delay actions 2021-05-10 22:46:04 +02:00
Ryan Weaver
47ef65f336 only load Sfjs if it is not present
Plus, avoid loading the toolbar if it is no longer on the page
2021-05-10 15:50:57 -04:00
Nicolas Grekas
33bfb3d278 minor #40963 [Mailer][Notifier][Translation] Add tests for UnsupportedSchemeException (OskarStark)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Mailer][Notifier][Translation] Add tests for UnsupportedSchemeException

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #... <!-- 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#... <!-- required for new features -->

This way we make sure a third party which is not known by `symfony/translation` can reuse this exception without being part of the `SCHEME_TO_PACKAGE_MAP`.

`@Nyholm` I agree that the exception should not know about the bridges, any ideas? The DX ist great to tell the user a package is missing and can be installed via composer 🤔

### Todos
* [x] add this test for `symfony/notifier`
* [x] add this test for `symfony/mailer`

cc `@welcoMattic`

Commits
-------

48553dac5d Add tests for UnsupportedSchemeException
2021-05-10 18:46:16 +02:00
Oskar Stark
48553dac5d Add tests for UnsupportedSchemeException 2021-05-10 18:43:01 +02:00
Nicolas Grekas
18997ab8d0 bug #41164 [FrameworkBundle] fix debug:event-dispatcher and debug:firewall (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[FrameworkBundle] fix debug:event-dispatcher and debug:firewall

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

Commits
-------

83cd55269c [FrameworkBundle] fix debug:event-dispatcher and debug:firewall
2021-05-10 18:17:16 +02:00
Nicolas Grekas
83cd55269c [FrameworkBundle] fix debug:event-dispatcher and debug:firewall 2021-05-10 18:15:24 +02:00
Nicolas Grekas
8a794d1896 Invalidate phpunit cache on appveyor 2021-05-10 17:19:50 +02:00
Nicolas Grekas
c2ce15d424 minor #41159 [Translation] remove credentials from PoEditorProvider (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Translation] remove credentials from PoEditorProvider

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

Commits
-------

4373d7b945 [Translation] remove credentials from PoEditorProvider
2021-05-10 17:08:55 +02:00
Nicolas Grekas
af10fd9ba2 Merge branch '5.2' into 5.x
* 5.2:
  fix merge
2021-05-10 16:56:30 +02:00
Nicolas Grekas
ddb2d0158d fix merge 2021-05-10 16:56:10 +02:00
Nicolas Grekas
4373d7b945 [Translation] remove credentials from PoEditorProvider 2021-05-10 16:49:13 +02:00
Nicolas Grekas
8ef49cf3b3 feature #41161 [HttpClient] Add DecoratorTrait to ease writing simple decorators (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[HttpClient] Add `DecoratorTrait` to ease writing simple decorators

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

Commits
-------

46821708b0 [HttpClient] Add `DecoratorTrait` to ease writing simple decorators
2021-05-10 16:44:53 +02:00
Nicolas Grekas
46821708b0 [HttpClient] Add DecoratorTrait to ease writing simple decorators 2021-05-10 16:44:17 +02:00
Nicolas Grekas
252ee3975e Merge branch '5.2' into 5.x
* 5.2:
  [Inflector][String] wrong plural form of words ending by "pectus"
  [HttpClient] Don't prepare the request in ScopingHttpClient
  [Console] Fixes for PHP 8.1 deprecations
  Make LoginRateLimiter case insentive
  Fix/Rewrite .gitignore regex builder
  Reset limiters on successful login
  Provide count argument for TooManyLoginAttemptsAuthenticationException to be able to translate in plural way
  [security] NullToken signature
2021-05-10 16:42:11 +02:00
Nicolas Grekas
4f70f61cf8 Merge branch '4.4' into 5.2
* 4.4:
  [Inflector][String] wrong plural form of words ending by "pectus"
  [HttpClient] Don't prepare the request in ScopingHttpClient
  [Console] Fixes for PHP 8.1 deprecations
  Fix/Rewrite .gitignore regex builder
2021-05-10 16:39:23 +02:00
Nicolas Grekas
9c9e645e87 bug #41147 [Inflector][String] wrong plural form of words ending by "pectus" (makraz)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Inflector][String] wrong plural form of words ending by "pectus"

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

Commits
-------

0dc8893caa [Inflector][String] wrong plural form of words ending by "pectus"
2021-05-10 16:36:02 +02:00
Hamza Makraz
0dc8893caa [Inflector][String] wrong plural form of words ending by "pectus" 2021-05-10 16:35:56 +02:00
Nicolas Grekas
21bf85f802 minor #41157 [Console] Fixes for PHP 8.1 deprecations (jrmajor)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Fixes for PHP 8.1 deprecations

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

Fixes passing `null` to non-nullable arguments.

Commits
-------

545f058367 [Console] Fixes for PHP 8.1 deprecations
2021-05-10 16:34:29 +02:00
Nicolas Grekas
132e09fb00 bug #41160 [HttpClient] Don't prepare the request in ScopingHttpClient (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] Don't prepare the request in ScopingHttpClient

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

Spotted while working on #41159 (needed by it.)

Commits
-------

a53db83823 [HttpClient] Don't prepare the request in ScopingHttpClient
2021-05-10 16:33:49 +02:00
Nicolas Grekas
a53db83823 [HttpClient] Don't prepare the request in ScopingHttpClient 2021-05-10 16:26:32 +02:00
Wouter de Jong
1ba1305ef1 bug #41156 [Security] Make Login Rate Limiter case insensitive (jderusse)
This PR was merged into the 5.2 branch.

Discussion
----------

[Security] Make Login Rate Limiter case insensitive

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

Login RateLimiter is case sensitive, while most login forms aren't case sensitive.
This PR makes `DefaultLoginRateLimiter` case insensitive.

Commits
-------

c333f3d547 Make LoginRateLimiter case insentive
2021-05-10 15:18:33 +02:00
Jeremiasz Major
545f058367
[Console] Fixes for PHP 8.1 deprecations 2021-05-10 14:53:15 +02:00
Fabien Potencier
90ab9edd47 bug #41155 [Translation] Improved Translation Providers (welcoMattic)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Translation] Improved Translation Providers

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

Some small improvements on Translation Providers:
- move symfony/config from dev dependency to hard dependency for all Bridges as all providers use XliffFileLoader to load pulled translations (cf. https://github.com/symfony/symfony/pull/40927#issuecomment-836569888)
- replace all instances of
```
'headers' => [
    'Authorization' => 'Bearer API_TOKEN',
]
```
with `'auth_bearer' => 'API_TOKEN',` even in tests files.
- Fix Lokalise base_uri concatenation

Commits
-------

84fd13ce95 Improved Translation Providers
2021-05-10 14:50:12 +02:00
Jérémy Derussé
c333f3d547
Make LoginRateLimiter case insentive 2021-05-10 14:44:29 +02:00
Mathieu Santostefano
84fd13ce95
Improved Translation Providers 2021-05-10 14:27:24 +02:00
Fabien Potencier
0b66008af2 feature #40927 [Translation] Added Lokalise Provider (welcoMattic)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Translation] Added Lokalise Provider

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/15310

To follow up on https://github.com/symfony/symfony/pull/38475, this PR adds [Lokalise](https://lokalise.com/) Provider.

The todo list to make it ready is:

- [x] Apply recent changes that have been made on `ProviderInterface` and `TranslatorBagInterface` (we removed the `all()` and `getDomains()` method from TranslatorBagInterface)
- [x] Add LokaliseProvider to `src/Symfony/Bundle/FrameworkBundle/Resources/config/translation_providers.php` file
- [x] Add Lokalise case to `Symfony\Component\Translation\Exception\UnsupportedSchemeException`
- [x] Move `LokaliseProvider` and `LokaliseProviderFactory` from `Symfony\Component\Translation\Bridge\Lokalise\Provider` to `Symfony\Component\Translation\Bridge\Lokalise` namespace
- [x] Write integration tests by mocking HTTP Responses

The major part of the remaining work concerns tests, I will make it done before the beginning of May.

Commits
-------

022d8285f3 Added Lokalise Provider
2021-05-10 12:48:12 +02:00
Mathieu Santostefano
022d8285f3
Added Lokalise Provider 2021-05-10 12:15:27 +02:00
Fabien Potencier
af19b6bec2 feature #40926 [Translation] Added PoEditor Provider (welcoMattic)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Translation] Added PoEditor Provider

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/15310

To follow up on https://github.com/symfony/symfony/pull/38475, this PR adds [PoEditor](https://poeditor.com/) Provider.

The todo list to make it ready is:

- [x] Apply recent changes that have been made on `ProviderInterface` and `TranslatorBagInterface` (we removed the `all()` and `getDomains()` method from TranslatorBagInterface)
- [x] Add PoEditorProvider to `src/Symfony/Bundle/FrameworkBundle/Resources/config/translation_providers.php` file
- [x] Add PoEditor case to `Symfony\Component\Translation\Exception\UnsupportedSchemeException`
- [x] Write integration tests by mocking HTTP Responses

The major part of the remaining work concerns tests, I will make it done before the beginning of May.

Commits
-------

240ac22f70 Added PoEditor Provider
2021-05-10 12:12:59 +02:00
Mathieu Santostefano
240ac22f70
Added PoEditor Provider 2021-05-10 11:59:26 +02:00
Nicolas Grekas
7c43648d93 bug #41137 [Security] Reset limiters on successful login (MatTheCat)
This PR was merged into the 5.2 branch.

Discussion
----------

[Security] Reset limiters on successful login

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

Commits
-------

aa295a48b0 Reset limiters on successful login
2021-05-10 11:00:08 +02:00
Nicolas Grekas
c151f76b02 bug #41148 [Runtime] fix defining $_SERVER[APP_ENV] (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Runtime] fix defining $_SERVER[APP_ENV]

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

Commits
-------

e271accc12 [Runtime] fix defining $_SERVER[APP_ENV]
2021-05-10 10:53:17 +02:00
Nicolas Grekas
2a87821d21 minor #41146 [Translation] improve CrowdinProvider (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Translation] improve CrowdinProvider

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

Commits
-------

9c3c186da8 [Translation] improve CrowdinProvider
2021-05-10 10:51:38 +02:00
Nicolas Grekas
9c3c186da8 [Translation] improve CrowdinProvider 2021-05-10 10:39:41 +02:00
Fabien Potencier
a04dedd6c3 minor #41145 Fix style of changelogs/readmes (nicolas-grekas)
This PR was merged into the 5.3-dev branch.

Discussion
----------

Fix style of changelogs/readmes

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

Commits
-------

a964554538 Fix style of changelogs/readmes
2021-05-10 09:03:15 +02:00