Commit Graph

47746 Commits

Author SHA1 Message Date
Fabien Potencier
98da88f479 bug #36141 Prevent warning in proc_open() (BenMorel)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

Prevent warning in proc_open()

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

In addition to returning `false`, `proc_open()` triggers a warning when it fails. For example:

>  Warning: proc_open(): fork failed - Cannot allocate memory

When using the `ErrorHandler`, the warning gets promoted to an exception, and the next line, `if (! is_resource(...`, is not executed. This mutes the warning and ensures that the next line is always executed and the proper exception is thrown.

Commits
-------

d43833a821 Prevent warning in proc_open()
2020-03-20 07:07:57 +01:00
Benjamin Morel
d43833a821 Prevent warning in proc_open() 2020-03-20 07:07:50 +01:00
Nicolas Grekas
7866144768 bug #36143 [FrameworkBundle] Fix Router Cache (guillbdx)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Fix Router Cache

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

RouteCollection config cache didn't have the container file in the tracked resources. If container was recompiled, routes cache was not regenerated. This PR adds the container file to the route collection resources.

Commits
-------

c6ace13e34 [FrameworkBundle] Fix Router Cache
2020-03-19 21:46:09 +01:00
Guillaume Pédelagrabe
c6ace13e34 [FrameworkBundle] Fix Router Cache 2020-03-19 21:46:03 +01:00
Fabien Potencier
efb4a7f0bc minor #36105 [FrameworkBundle] Fix deprecation message for booting a kernel twice (jschaedl)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Fix deprecation message for booting a kernel twice

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | - <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | - <!-- required for new features -->
<!--
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 master.
-->

Commits
-------

a0a6243a21 Fix deprecation messages
2020-03-18 09:09:03 +01:00
Nicolas Grekas
ea0eb11bcf Merge branch '4.4' into 5.0
* 4.4:
  [DI] Fix CheckTypeDeclarationPass
  [Security/Http] don't require the session to be started when tracking its id
  [DI] fix preloading script generation
2020-03-18 09:00:37 +01:00
Fabien Potencier
e457b24ea7 bug #36103 [DI] fix preloading script generation (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] fix preloading script generation

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

(fabbot failure is a false positive)

On master, we should work on being able to preload more classes (esp. all cache-warmup artifacts).

But for 4.4, this is good enough. Submitted as a bug fix because 1. the current code that deals with preloading kinda-works, but only on "dev" mode... and 2. fixing it provides a nice boost!

Small bench on a hello world:
- before: 380 req/s
- after: 580 req/s

That's +50%!

Pro-tip: adding a few `class_exists()` as done in this PR for the classes that are always used in the implementations (e.g. `new Foo()` in the constructor) will help the preload-script generator to work optimally. Without them, it will discover the symbols to preload only if they're found on methods.

Some of those `class_exists()` are mandatory, in relation to anonymous classes and https://bugs.php.net/79349

Commits
-------

a10fc4da5d [DI] fix preloading script generation
2020-03-18 08:51:32 +01:00
Fabien Potencier
abefccfbe9 bug #36118 [Security/Http] don't require the session to be started when tracking its id (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security/Http] don't require the session to be started when tracking its id

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

`$session->getId()` returns the empty string when the session is not yet started.
When this happens, the session tracking logic wrongly detects that a new session was created and thus disables HTTP caching.

This fixes the issue by looking at the value of the session cookie instead.
(the case for `true` is when using `MockArraySessionStorage` as done in tests)

Commits
-------

c39188a7cc [Security/Http] don't require the session to be started when tracking its id
2020-03-18 08:28:07 +01:00
Fabien Potencier
7baec325fc bug #36108 [DI] Fix CheckTypeDeclarationPass (guillbdx)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[DI] Fix CheckTypeDeclarationPass

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

Bug 1: The lint container threw an error if a class buit with a factory was declared as callable while this factory method returne a callabe (#35863)

Bug 2: Sodium Exception was not caught in the CheckTypeDeclarationsPass. We have extended the exception caught to \Exception, instead of EnvNotFoundException and RuntimeException only.

Commits
-------

cbf4dfd10f [DI] Fix CheckTypeDeclarationPass
2020-03-18 08:18:50 +01:00
Guillaume Pédelagrabe
cbf4dfd10f [DI] Fix CheckTypeDeclarationPass 2020-03-18 08:18:44 +01:00
Fabien Potencier
079d85da45 Merge branch '4.4' into 5.0
* 4.4:
  [VarDumper] fix side-effect by not using mt_rand()
2020-03-18 08:16:55 +01:00
Fabien Potencier
104387ab92 Merge branch '3.4' into 4.4
* 3.4:
  [VarDumper] fix side-effect by not using mt_rand()
2020-03-18 08:15:43 +01:00
Fabien Potencier
5f364af6a0 bug #36121 [VarDumper] fix side-effect by not using mt_rand() (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[VarDumper] fix side-effect by not using mt_rand()

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

Reported by @bobthecow on Twitter: using `mt_rand()` breaks inspecting seeded calls to `mt_rand()`.

Should be replaced by a call to `md5(random_bytes(6))` on 4.4.

Commits
-------

8c85f91b9c [VarDumper] fix side-effect by not using mt_rand()
2020-03-18 08:13:59 +01:00
Nicolas Grekas
8c85f91b9c [VarDumper] fix side-effect by not using mt_rand() 2020-03-17 23:27:36 +01:00
Nicolas Grekas
c39188a7cc [Security/Http] don't require the session to be started when tracking its id 2020-03-17 22:55:56 +01:00
Nicolas Grekas
a10fc4da5d [DI] fix preloading script generation 2020-03-17 20:51:46 +01:00
Jan Schädlich
a0a6243a21 Fix deprecation messages 2020-03-17 20:48:51 +01:00
Nicolas Grekas
000ffb29e1 Merge branch '4.4' into 5.0
* 4.4:
  fix merge
2020-03-17 10:54:50 +01:00
Nicolas Grekas
3ae3244b8c fix merge 2020-03-17 10:54:35 +01:00
Fabien Potencier
955752b74c Fix more quotes in exception messages 2020-03-16 17:47:01 +01:00
Fabien Potencier
e7e5f334e7 Merge branch '4.4' into 5.0
* 4.4:
  Fix more quotes in exception messages
  Fix more quotes in exception messages
  [3.4] Minor fixes
  [PropertyAccess] Improved errors when reading uninitialized properties
2020-03-16 17:38:48 +01:00
Fabien Potencier
46e441ff8d minor #36101 Fix more quotes in exception messages (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

Fix more quotes in exception messages

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| 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

Commits
-------

c79fe029e7 Fix more quotes in exception messages
2020-03-16 17:28:20 +01:00
Fabien Potencier
c79fe029e7 Fix more quotes in exception messages 2020-03-16 17:13:17 +01:00
Fabien Potencier
cbe50a79a8 Merge branch '3.4' into 4.4
* 3.4:
  Fix more quotes in exception messages
  [3.4] Minor fixes
  [PropertyAccess] Improved errors when reading uninitialized properties
2020-03-16 17:04:53 +01:00
Fabien Potencier
2baa8128ad minor #36099 Fix more quotes in exception messages (fabpot)
This PR was merged into the 3.4 branch.

Discussion
----------

Fix more quotes in exception messages

| 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 -->
| Tickets       | n/a <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | n/a

Commits
-------

4ab6156c5a Fix more quotes in exception messages
2020-03-16 16:59:59 +01:00
Fabien Potencier
4ab6156c5a Fix more quotes in exception messages 2020-03-16 16:51:59 +01:00
Fabien Potencier
2c4c19ce8b bug #36073 [PropertyAccess][DX] Improved errors when reading uninitialized properties (HeahDude)
This PR was merged into the 3.4 branch.

Discussion
----------

[PropertyAccess][DX] Improved errors when reading uninitialized properties

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

An attempt to fix #36051 by providing better error messages when trying to read uninitialized properties either via calling a return-type-hinted method from PHP 7.0 or by accessing public-typed properties from PHP 7.4.

It would be nice to have a proper exception class in master.

Commits
-------

a71023ba65 [PropertyAccess] Improved errors when reading uninitialized properties
2020-03-16 16:16:37 +01:00
Fabien Potencier
16ed2b9f7d minor #35847 [Notifier] Add unit tests (jschaedl)
This PR was merged into the 5.0 branch.

Discussion
----------

[Notifier] Add unit tests

| Q             | A
| ------------- | ---
| Branch?       | 5.0
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | - <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | - <!-- required for new features -->

- [x] `AbstractChannel`
- [x] `ChannelPolicy`
- [x] `RecipientTest` (done in PR #35773)
- [x] `EmailRecipientTest` (done in PR #35773)
- [x] `SmsRecipientTest` (done in PR #35773)
- [x] `Transports` (see PR #35834)

Commits
-------

022c1707e2 [Notifier] Add tests for AbstractChannel and ChannelPolicy
2020-03-16 14:29:03 +01:00
Fabien Potencier
4efa287574 minor #36095 Quotes in exceptions messages (fabpot)
This PR was squashed before being merged into the 5.0 branch.

Discussion
----------

Quotes in exceptions messages

| Q             | A
| ------------- | ---
| Branch?       | 5.0 <!-- see below -->
| Bug fix?      | no
| 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

Commits
-------

bc60b9c5e4 Fix quotes in exception messages
42df4f434b Fix quotes in exception messages
2020-03-16 14:11:08 +01:00
Fabien Potencier
bc60b9c5e4 Fix quotes in exception messages 2020-03-16 14:02:39 +01:00
Fabien Potencier
42df4f434b Fix quotes in exception messages 2020-03-16 13:36:05 +01:00
Fabien Potencier
e903750b9c Merge branch '4.4' into 5.0
* 4.4:
  Fix quotes in exception messages
  Fix quotes in exception messages
  Fix quotes in exception messages
2020-03-16 13:10:54 +01:00
Fabien Potencier
4a7fcda332 minor #36091 Fix quotes in exception messages (fabpot)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

Fix quotes in exception messages

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- see below -->
| Bug fix?      | no
| 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

Commits
-------

aab0e40cd2 Fix quotes in exception messages
1ae2da01ff Fix quotes in exception messages
2020-03-16 13:04:38 +01:00
Fabien Potencier
aab0e40cd2 Fix quotes in exception messages 2020-03-16 12:24:17 +01:00
Fabien Potencier
4b15b1009e minor #36092 [3.4] Minor fixes (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[3.4] Minor fixes

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

Commits
-------

019350022c [3.4] Minor fixes
2020-03-16 12:06:03 +01:00
Thomas Calvet
019350022c [3.4] Minor fixes 2020-03-16 11:48:37 +01:00
Fabien Potencier
1ae2da01ff Fix quotes in exception messages 2020-03-16 10:45:04 +01:00
Fabien Potencier
09ee51aa4d Merge branch '3.4' into 4.4
* 3.4:
  Fix quotes in exception messages
2020-03-16 09:56:54 +01:00
Fabien Potencier
e29cdb7076 minor #36090 Fix quotes in exception messages (fabpot)
This PR was merged into the 3.4 branch.

Discussion
----------

Fix quotes in exception messages

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

Commits
-------

48102d96f3 Fix quotes in exception messages
2020-03-16 09:43:14 +01:00
Fabien Potencier
48102d96f3 Fix quotes in exception messages 2020-03-16 09:31:04 +01:00
Fabien Potencier
af72aa1d08 Merge branch '4.4' into 5.0
* 4.4:
  [FrameworkBundle] start session on flashbag injection
  [Validator] Remove commas in translations
  [Console] Fallback to default answers when unable to read input
2020-03-16 07:35:48 +01:00
Fabien Potencier
74011262dd Merge branch '3.4' into 4.4
* 3.4:
  [FrameworkBundle] start session on flashbag injection
  [Validator] Remove commas in translations
2020-03-16 07:35:38 +01:00
Fabien Potencier
78b11a591d bug #36063 [FrameworkBundle] start session on flashbag injection (William Arslett)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] start session on flashbag injection

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix [#33084](https://github.com/symfony/symfony/issues/33084)
| License       | MIT

This PR addresses an issue whereby if the FlashBag is injected into the application using the default service configuration, we cannot rely that the session has been started. This behaviour is in contradiction to [the docs](https://symfony.com/doc/current/session.html#avoid-starting-sessions-for-anonymous-users):

> Sessions are automatically started whenever you read, write or even check for the existence of data in the session.

This is because symfony ensures the session has been started on calls to getFlashBag() which is normally how the flashbag will be accessed but this is not called if you inject the FlashBag directly into the container.

I have addressed this issue by changing the way the Flashbag service is built so that it uses Session as a factory service and getFlashBag as a factory method. This means that anywhere in symfony where FlashBag is injected can now rely on the fact the session is started.

I have also added a new functional test to verify this behaviour.

Commits
-------

e8b4d35616 [FrameworkBundle] start session on flashbag injection
2020-03-16 07:35:10 +01:00
William Arslett
e8b4d35616 [FrameworkBundle] start session on flashbag injection 2020-03-16 07:35:04 +01:00
Fabien Potencier
bd1aaf1f98 bug #36031 [Console] Fallback to default answers when unable to read input (ostrolucky)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Fallback to default answers when unable to read input

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

Alternative to https://github.com/symfony/symfony/pull/36027.

This fixes linked issues without having to revert fix for #30726. Successfully tested with composer script, `docker run` and `docker run -it`.

Commits
-------

8ddaa20b29 [Console] Fallback to default answers when unable to read input
2020-03-16 07:07:59 +01:00
Fabien Potencier
7a4be744fd minor #36021 [Validator] Remove commas in translations (przemyslaw-bogusz)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Validator] Remove commas in translations

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| License       | MIT

These translations were originally modified in #21335.

Commits
-------

5688f97bad [Validator] Remove commas in translations
2020-03-16 06:59:27 +01:00
Przemysław Bogusz
5688f97bad [Validator] Remove commas in translations 2020-03-16 06:59:20 +01:00
Fabien Potencier
040bf90355 minor #36085 Add missing dots at the end of exception messages (fabpot)
This PR was merged into the 5.0 branch.

Discussion
----------

Add missing dots at the end of exception messages

| Q             | A
| ------------- | ---
| Branch?       | 5.0
| Bug fix?      | no
| 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

Commits
-------

81cf96749b Add missing dots at the end of exception messages
2020-03-15 15:46:24 +01:00
Fabien Potencier
81cf96749b Add missing dots at the end of exception messages 2020-03-15 15:37:05 +01:00
Fabien Potencier
20a19884ac Merge branch '4.4' into 5.0
* 4.4:
  Add missing dots at the end of exception messages
  [DI][Form] Fixed test suite (TimeType changes & unresolved merge conflict)
  Fix bad merge
  Add missing dots at the end of exception messages
2020-03-15 15:33:06 +01:00