Commit Graph

45091 Commits

Author SHA1 Message Date
Fabien Potencier
4f9d449885 feature #34028 [ExpressionLanguage][Lexer] Exponential format for number (tigr1991)
This PR was merged into the 4.4 branch.

Discussion
----------

[ExpressionLanguage][Lexer] Exponential format for number

Exponential format has been added for numbers.
Ex: 1.99E+3 === 1990,
Ex: expression (1 + 1.99E+3) = 1991

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

Exponential format has been added for numbers.
Ex: 1.99E+3 === 1990,
Expressions:
0.1e+2 = 10
1e-2 = 0.01
(1 + 1.99E+3) = 1991
and etc...

Commits
-------

430ec32992 [ExpressionLanguage][Lexer] Exponential format for number
2019-10-22 17:29:53 +02:00
Fabien Potencier
2931227cad bug #34034 [Mailer][MailchimpBridge] Don't send address names if empty string (ogizanagi)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer][MailchimpBridge] Don't send address names if empty string

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- 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       | https://github.com/symfony/symfony/pull/34029#issuecomment-543804450 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | N/A

Commits
-------

197d1236ee [Mailer][MailchimpBridge] Don't send address names if empty string
2019-10-22 17:26:22 +02:00
Fabien Potencier
effae8a643 bug #34067 Use port 465 for SES SMTP transport (rimas-kudelis)
This PR was merged into the 4.4 branch.

Discussion
----------

Use port 465 for SES SMTP transport

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

Commits
-------

8492e260cb Use port 465 for SES SMTP transport
2019-10-22 17:23:40 +02:00
Fabien Potencier
591c71bb7e bug #34066 [Messenger] Fix worker-only Doctrine middleware from running always (weaverryan)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] Fix worker-only Doctrine middleware from running always

| Q             | A
| ------------- | ---
| Branch?       | 4.4 (or 4.3?, this is a bug fix)
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #32436 Depends on #34069
| License       | MIT
| Doc PR        | not needed

Several Doctrine middleware are only meant to be run in a "worker" context: we want to "ping" the connection, "close" the connection and "clear" the entity manager ONLY when we are receiving messages. Before this PR, it was done always, which causes bad behavior for sync messages (imagine your Doctrine connection being closed in the middle of a controller or see https://github.com/symfony/symfony/pull/31334#issuecomment-544288437).

This fixes that in a pragmatic way: no new system for "worker-only" middleware or anything like that: just make the middleware smart enough to only do their work when a message is being received async.

Commits
-------

290a72917b Fixing issue where worker-only middleware were run in all contexts
2019-10-22 17:22:21 +02:00
Fabien Potencier
eaaabb6011 bug #34070 [ErrorRenderer] FlattenException cannot be final (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorRenderer] FlattenException cannot be final

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

Making it final forces tight coupling with the implementation as soon as one type-hints for the class.

That's a blocker on making e.g. `EasyAdminBundle` compatible with Symfony 5.

Commits
-------

b125835056 [ErrorRenderer] FlattenException cannot be final
2019-10-22 17:21:28 +02:00
Nicolas Grekas
b125835056 [ErrorRenderer] FlattenException cannot be final 2019-10-22 17:18:31 +02:00
Fabien Potencier
90906c5062 feature #34069 [Messenger] Removing "sync" transport and replacing it with config trick (weaverryan)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] Removing "sync" transport and replacing it with config trick

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no (but removes some hackiness)
| New feature?  | no
| Deprecations? | yes (BC break yes)
| Tickets       | Helps #34066
| License       | MIT
| Doc PR        | not needed

I introduced `SyncTransport` in 4.3 as a way to allow people to, for example, route a message to an `async` transport and then override that to a `sync` transport in the dev environment. The implementation was always a bit of a hack, and makes this one transport behave different than others *and* makes messages routed to this transport behave a *bit* different than sync messages that are simply not routed at all.

Thanks for an idea from Nicolas, this fixes that. Gone are `SyncTransport`. Instead, the `sync://` transport string is still supported, but it's just a "config" trick: messages routed to transports that are "sync" are simply filtered out of the "senders" in the DI extension. Nice & clean.

Commits
-------

3d4e59a10b [Messenger] Removing "sync" transport and replacing it with much nicer config trick
2019-10-22 17:18:03 +02:00
Ryan Weaver
290a72917b Fixing issue where worker-only middleware were run in all contexts 2019-10-22 10:54:25 -04:00
Ryan Weaver
3d4e59a10b [Messenger] Removing "sync" transport and replacing it with much nicer config trick 2019-10-22 10:49:37 -04:00
Rimas Kudelis
8492e260cb Use port 465 for SES SMTP transport
Fixes #34064
2019-10-22 16:29:52 +03:00
Nicolas Grekas
e3261f4f7f [SecurityBundle] test with doctrine-bundle 2 2019-10-22 11:22:01 +02:00
Nicolas Grekas
5da67f9126 minor #34052 [HttpClient] skip tests implemented in 4.4 (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] skip tests implemented in 4.4

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

Needed after #34051 and #34044

Commits
-------

ae86ab18fa [HttpClient] skip tests implemented in 4.4
2019-10-22 08:53:15 +02:00
Nicolas Grekas
ec8e34f05e minor #34050 [VarDumper] improve displaying cut closures (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[VarDumper] improve displaying cut closures

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

Minor but still an improvement so 4.4: this change makes closures replaced by `CutStub` be displayed with their signature instead of just the `Closure` label.

Commits
-------

2b0a11de02 [VarDumper] improve displaying cut closures
2019-10-22 08:52:31 +02:00
Nicolas Grekas
ebca10e252 minor #34036 [Lock] Set ReturnType of LockFactory to LockInterface (alexander-schranz)
This PR was merged into the 4.4 branch.

Discussion
----------

[Lock] Set ReturnType of LockFactory to LockInterface

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

LockFactory I think should return a LockInterface and not the Lock class.

/cc @chalasr

Commits
-------

ff1fa57ef2 Set ReturnType of LockFactory to LockInterface
2019-10-22 08:44:12 +02:00
Nicolas Grekas
c86271e750 minor #34027 [EventDispatcher] handle lazy-callable invokable (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[EventDispatcher] handle lazy-callable invokable

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

Extracted from #34013, for consistency mostly.

Commits
-------

9df4c7d32b [EventDispatcher] handle lazy-callable invokable
2019-10-22 08:42:51 +02:00
Nicolas Grekas
5d097d2eb5 bug #34021 [TwigBridge] do not render errors for checkboxes twice (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[TwigBridge] do not render errors for checkboxes twice

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

Commits
-------

9eddea97d8 do not render errors for checkboxes twice
2019-10-22 08:41:35 +02:00
Nicolas Grekas
a721a50aa0 feature #34014 [DI] made the %env(base64:...)% processor able to decode base64url (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] made the `%env(base64:...)%` processor able to decode base64url

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

Commits
-------

3d12e46692 [DI] made the `%env(base64:...)%` processor able to decode base64url
2019-10-22 08:40:20 +02:00
Nicolas Grekas
3d12e46692 [DI] made the %env(base64:...)% processor able to decode base64url 2019-10-22 08:40:11 +02:00
Nicolas Grekas
13e15e2112 bug #34017 [Messenger] Fix ignored options in redis transport (chalasr)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] Fix ignored options in redis transport

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

Also fixes redis authentication failure handling (inline with invalid db index handling, borrowed from symfony/cache).
/cc @alexander-schranz

Commits
-------

c83ff94c37 [Messenger] Fix ignored options in redis transport
2019-10-22 08:39:15 +02:00
Nicolas Grekas
f5cef028f8 Merge branch '4.3' into 4.4
* 4.3:
  Fix small typo in Exception message
2019-10-22 08:26:21 +02:00
Nicolas Grekas
afbbea3d1b Merge branch '3.4' into 4.3
* 3.4:
  Fix small typo in Exception message
2019-10-22 08:25:19 +02:00
Nicolas Grekas
bbafd76c6c bug #34055 [Console] Revert wrong change (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Revert wrong change

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| 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 #34012 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | n/a

This partially reverts #34012 as it breaks uses cases like this:

```
echo "foo\nbar\n" | SHELL_INTERACTIVE=1 symfony console something
```

Commits
-------

f592322251 [Console] Revert wrong change
2019-10-22 08:21:53 +02:00
Fabien Potencier
f592322251 [Console] Revert wrong change 2019-10-22 08:15:10 +02:00
Nicolas Grekas
ae86ab18fa [HttpClient] skip tests implemented in 4.4 2019-10-21 18:09:12 +02:00
Nicolas Grekas
e87301603e [HttpClient] allow option "buffer" to be a stream resource 2019-10-21 18:05:25 +02:00
Nicolas Grekas
2b0a11de02 [VarDumper] improve displaying cut closures 2019-10-21 17:47:54 +02:00
Nicolas Grekas
3f759d7cf4 feature #34044 [HttpClient] Add a canceled state to the ResponseInterface (Toflar)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[HttpClient] Add a canceled state to the ResponseInterface

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

As discussed in https://github.com/terminal42/escargot/pull/7 with @nicolas-grekas.
However, I'm not quite sure about the tests here because it looks like the `MockResponse` always throws a `TransportException` when I cancel a response, even if I call `$response->getContent(false)`. Is that a desired behaviour? :) Need some guidance here to finish that PR maybe.

Note: I've also sorted the info keys alphabetically and added their types because it feld incomplete and a bit random otherwise. Hope that's okay :)

Commits
-------

bbb8ed11ff [HttpClient] Add a canceled state to the ResponseInterface
2019-10-21 17:46:29 +02:00
Yanick Witschi
bbb8ed11ff [HttpClient] Add a canceled state to the ResponseInterface 2019-10-21 17:46:23 +02:00
Nicolas Grekas
3644a18012 minor #34049 [Workflow] Fix small typo in Exception message (holtkamp)
This PR was merged into the 3.4 branch.

Discussion
----------

[Workflow] Fix small typo in Exception message

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      |no
| New feature?  |no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| License       | MIT

Commits
-------

7c2b974e26 Fix small typo in Exception message
2019-10-21 17:45:06 +02:00
Menno Holtkamp
7c2b974e26 Fix small typo in Exception message 2019-10-21 17:42:36 +02:00
Fabien Potencier
16d528504c feature #33997 [FrameworkBundle] Add secrets:* commands and %env(secret:...)% processor to deal with secrets seamlessly (Tobion, jderusse, nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Add `secrets:*` commands and `%env(secret:...)%` processor to deal with secrets seamlessly

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

This PR continues #31101, please see there for previous discussions. The attached patch has been fine-tuned on https://github.com/nicolas-grekas/symfony/pull/33 with @jderusse.

This PR is more opinionated and thus a lot simpler than #31101: only Sodium is supported to encrypt/decrypt (polyfill possible), and only local filesystem is available as a storage, with little to no extension point. That's on purpose: the goal here is to provide an experience, not software building blocks. In 5.1, this might be extended and might lead to a new component, but we'd first need reports from real-world needs. Having this straight-to-the-point in 4.4 will allow gathering these needs (if they exist) and will immediately provide a nice workflow for the need we do want to solve now: forwarding secrets from dev to prod using git in a secure way.

The workflow this will allow is the following:
- public/private key pairs are generated in the `config/secrets/%kernel.environment%/` folder using `bin/console secrets:generate-keys`
- for the prod env, the corresponding private key should be deployed to the server using whatever means the hosting provider allows - this key MUST NOT be committed
- the public key is used to encrypt secrets and thus *may* be committed in the git repository to allow anyone *that can commit* to add secrets - this is done using `bin/console secrets:set`

DI configuration can reference secrets using `%env(secret:...)%` in e.g `services.yaml`.
There is also `bin/console secrets:remove` and `bin/console debug:secrets` to complete the toolbox.

In terms of design, vs #31101, this groups the dual "encoder" + "storage" concepts in a single "vault" one. That's part of what makes this PR simpler.

That's all folks :)

Commits
-------

c4653e1f65 Restrict secrets management to sodium+filesystem
02b5d740e5 Add secrets management
8c8f62390a Proof of concept for encrypted secrets
2019-10-20 21:11:11 +02:00
Fabien Potencier
c50d0b6d1c Merge branch '4.3' into 4.4
* 4.3:
  [HttpKernel] fix wrong removal of the just generated container dir
  bug #34024 [Routing] fix route loading with wildcard, but dir or file is empty (gseidel)
  [Routing] fix route loading with wildcard, but dir or file is empty
2019-10-20 14:38:12 +02:00
Fabien Potencier
5ce78ccbe1 Merge branch '3.4' into 4.3
* 3.4:
  [HttpKernel] fix wrong removal of the just generated container dir
2019-10-20 14:37:59 +02:00
Fabien Potencier
b38bde9cb1 bug #34041 [HttpKernel] fix wrong removal of the just generated container dir (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] fix wrong removal of the just generated container dir

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

The patch applies to 3.4 but the fix really affects to 4.4 with the introduction of the new `.preload.php` file.

/cc @fabpot since you encountered this error quite often recently during `composer up/req` :)

Commits
-------

4ad09ebafb [HttpKernel] fix wrong removal of the just generated container dir
2019-10-20 14:36:59 +02:00
Nicolas Grekas
4ad09ebafb [HttpKernel] fix wrong removal of the just generated container dir 2019-10-20 12:02:53 +02:00
Nicolas Grekas
c4653e1f65 Restrict secrets management to sodium+filesystem 2019-10-19 20:26:39 +02:00
Nicolas Grekas
568f4b4094 Merge branch '3.4' into 4.3
* 3.4:
  bug #34024 [Routing] fix route loading with wildcard, but dir or file is empty (gseidel)
2019-10-19 15:08:51 +02:00
Nicolas Grekas
a54ecb0fae bug #34024 [Routing] fix route loading with wildcard, but dir or file is empty (gseidel)
This PR was merged into the 4.3 branch.

Discussion
----------

[Routing] fix route loading with wildcard, but dir or file is empty

| Q             | A
| ------------- | ---
| Branch?       |  4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | no ticket i see so far
| License       | MIT

In my route config i have something like:

```yaml
empty_wildcard:
    resource: ../controller/empty_wildcard/*
    prefix: /empty_wildcard
```

But ``empty_wildcard`` is empty or has no route configured.

So i had this error:

``Call to a member function addPrefix() on null``

This PR take care if no route is configured, there will be no error.

Commits
-------

217058b475 [Routing] fix route loading with wildcard, but dir or file is empty
2019-10-19 15:07:56 +02:00
Nicolas Grekas
4bd16d884a bug #34024 [Routing] fix route loading with wildcard, but dir or file is empty (gseidel)
This PR was merged into the 4.3 branch.

Discussion
----------

[Routing] fix route loading with wildcard, but dir or file is empty

| Q             | A
| ------------- | ---
| Branch?       |  4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | no ticket i see so far
| License       | MIT

In my route config i have something like:

```yaml
empty_wildcard:
    resource: ../controller/empty_wildcard/*
    prefix: /empty_wildcard
```

But ``empty_wildcard`` is empty or has no route configured.

So i had this error:

``Call to a member function addPrefix() on null``

This PR take care if no route is configured, there will be no error.

Commits
-------

217058b475 [Routing] fix route loading with wildcard, but dir or file is empty
2019-10-19 15:04:41 +02:00
Gerhard Seidel
217058b475 [Routing] fix route loading with wildcard, but dir or file is empty 2019-10-19 15:03:42 +02:00
Christian Flothmann
d91b87f483 bump Form component compatibility versions 2019-10-19 10:26:53 +02:00
Christian Flothmann
ff904f3ac0 Merge branch '4.3' into 4.4
* 4.3:
  execute all compatible tests across versions
2019-10-19 10:25:26 +02:00
Christian Flothmann
9526a2d6eb minor #34039 execute all compatible tests across versions (xabbuh)
This PR was merged into the 4.3 branch.

Discussion
----------

execute all compatible tests across versions

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

Commits
-------

18cc561754 execute all compatible tests across versions
2019-10-19 10:24:54 +02:00
Christian Flothmann
18cc561754 execute all compatible tests across versions 2019-10-19 10:14:32 +02:00
Alexander Schranz
ff1fa57ef2
Set ReturnType of LockFactory to LockInterface 2019-10-18 21:16:41 +02:00
Maxime Steinhausser
197d1236ee [Mailer][MailchimpBridge] Don't send address names if empty string 2019-10-18 18:16:47 +02:00
Fabien Potencier
d6b567d8ad bug #34029 [Mailer][MailchimpBridge] Fix NamedAddress obsolete paths (ogizanagi)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer][MailchimpBridge] Fix NamedAddress obsolete paths

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- 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       | N/A <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | N/A

As NamedAddress was removed in #33270 (4.4) and this bridge does require `symfony/mailer >= 4.4`.

Commits
-------

f14d082fad [Mailer][MailchimpBridge] Fix NamedAddress obsolete paths
2019-10-18 17:33:35 +02:00
Maxime Steinhausser
f14d082fad [Mailer][MailchimpBridge] Fix NamedAddress obsolete paths 2019-10-18 16:57:15 +02:00
Ivan
430ec32992 [ExpressionLanguage][Lexer] Exponential format for number
Exponential format has been added for numbers.
Ex: 1.99E+3 === 1990,
Ex: expression (1 + 1.99E+3) = 1991
2019-10-18 16:56:45 +03:00
Jérémy Derussé
02b5d740e5 Add secrets management 2019-10-18 14:46:38 +02:00