Commit Graph

45802 Commits

Author SHA1 Message Date
Nicolas Grekas
866de0fb8b Merge branch '4.3' into 4.4
* 4.3:
  Require doctrine/persistence ^1.3
2019-12-12 16:02:38 +01:00
Nicolas Grekas
72a2aff829 bug #34955 Require doctrine/persistence ^1.3 (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

Require doctrine/persistence ^1.3

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

This is the only way to remove direct deprecations triggered by doctrine/persistence ^1.3.
Requires v1.3.0 to be tagged before the next bug fix release.
/cc @alcaeus

The only deprecations that remain are triggered by the ORM now.

Commits
-------

ce5dcb96c1 Require doctrine/persistence ^1.3
2019-12-12 15:55:06 +01:00
Nicolas Grekas
ce5dcb96c1 Require doctrine/persistence ^1.3 2019-12-12 15:53:41 +01:00
Morten Wulff
ef0aa4dc87 [Mailer] fixed undefined index when sending mail
When a Mandrill API request is succesful, it returns an array of
results, one for each recipient. To get rid of the undefined index
error, we grab the message ID from the first recipient in the array.
2019-12-12 15:08:08 +01:00
Nicolas Grekas
a656a57736 [Messenger] Fix deprecation 2019-12-12 14:54:44 +01:00
Nicolas Grekas
12f46ba538 Merge branch '4.3' into 4.4
* 4.3:
  Add missing annotation
2019-12-12 14:35:29 +01:00
Nicolas Grekas
80d15cdcf9 Merge branch '3.4' into 4.3
* 3.4:
  Add missing annotation
2019-12-12 14:34:31 +01:00
Nicolas Grekas
4ec093abc8 Add missing annotation 2019-12-12 14:33:51 +01:00
Nicolas Grekas
93b2f9ef6f Merge branch '4.3' into 4.4
* 4.3:
  Fix merge
2019-12-12 14:26:43 +01:00
Nicolas Grekas
7d88be8978 Fix merge 2019-12-12 14:16:57 +01:00
Nicolas Grekas
a31119b89c Merge branch '4.3' into 4.4
* 4.3:
  Fix merge
  [DoctrineBridge] try to fix deprecations from doctrine/persistence
  [DI] Add support for immutable setters in CallTrait
  [Cache] Propagate expiry when syncing items in ChainAdapter
  [Routing] fix memoryleak when loading compiled routes
  [Translation] fix memoryleak in PhpFileLoader
2019-12-12 13:53:52 +01:00
Nicolas Grekas
ad4b5fd653 Fix merge 2019-12-12 13:43:22 +01:00
Nicolas Grekas
72936e457f Merge branch '3.4' into 4.3
* 3.4:
  [DoctrineBridge] try to fix deprecations from doctrine/persistence
  [Translation] fix memoryleak in PhpFileLoader
2019-12-12 13:39:14 +01:00
Nicolas Grekas
cff8b25a5a minor #34949 [DoctrineBridge] try to fix deprecations from doctrine/persistence (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DoctrineBridge] try to fix deprecations from doctrine/persistence

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

Follows https://github.com/doctrine/persistence/pull/71
But the BC layer is not working yet, as highlighted by the `XXX` in the attached patch.
At least for the corresponding interfaces, doctrine/persistence should always alias the legacy name to the new one.

/cc @greg0ire @alcaeus FYI

Commits
-------

53a4711520 [DoctrineBridge] try to fix deprecations from doctrine/persistence
2019-12-12 13:20:08 +01:00
Nicolas Grekas
53a4711520 [DoctrineBridge] try to fix deprecations from doctrine/persistence 2019-12-12 13:13:32 +01:00
Nicolas Grekas
d294085689 bug #34923 [DI] Fix support for immutable setters in CallTrait (Lctrs)
This PR was merged into the 4.3 branch.

Discussion
----------

[DI] Fix support for immutable setters in CallTrait

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

Commits
-------

90ace51328 [DI] Add support for immutable setters in CallTrait
2019-12-11 13:26:30 +01:00
Lctrs
90ace51328 [DI] Add support for immutable setters in CallTrait 2019-12-11 13:18:17 +01:00
Fabien Potencier
25494fa519 bug #34878 [TwigBundle] fix broken FilesystemLoader::exists() with Twig 3 (dpesch)
This PR was merged into the 4.4 branch.

Discussion
----------

[TwigBundle] fix broken FilesystemLoader::exists() with Twig 3

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

This fix adapts the declaration of Twig 3 `\Twig\Loader\FilesystemLoader::findTemplate()` which expects to return `string|null` and returns `null` instead of `false`.

Returning `false` breaks `\Twig\Loader\FilesystemLoader::exists()` which returns `true` if `findTemplate()` does not return `null`.

Twig 2 should not be affected by this patch. The `exists()` method expects `null` or `false` for not found templates: <fdb691a424/src/Loader/FilesystemLoader.php (L169)>

Commits
-------

ff1d77e155 bug #34877 [TwigBundle] fix findTemplate() to return `null`
2019-12-11 01:24:49 +01:00
Fabien Potencier
d91efd31f6 bug #34921 [HttpFoundation] Removed "Content-Type" from the preferred format guessing mechanism (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] Removed "Content-Type" from the preferred format guessing mechanism

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

Confirmed, inferring the `Content-Type` of the response using the `Content-Type` provided for the request body is NOT a good idea. The HTTP RFC explicitly states that `Accept` must be used to hint a preferred response format (`Content-Type` on the request indicates the type of associated its the body).

Use `Accept` if provided (a best practice anyway), and fallback to the default value (HTML by default) otherwise.

Commits
-------

776523e56a Removed request header "Content-Type" from the preferred format guessing mechanism
2019-12-11 01:19:19 +01:00
Fabien Potencier
6bf764a4ed bug #34886 [HttpKernel] fix triggering deprecation in file locator (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] fix triggering deprecation in file locator

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

Commits
-------

142b1793e0 fix triggering deprecation in file locator
2019-12-11 01:18:36 +01:00
Fabien Potencier
349ea047e6 bug #34918 [Translation] fix memoryleak in PhpFileLoader (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Translation] fix memoryleak in PhpFileLoader

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

This happens when running the test suite with opcache disabled (as it is the case by default since `opcache.enable_cli=0`).
Doing this "require" in a loop (for each test case) compiles the file at each iteration and doesn't reclaim memory (there is no garbage collector for opcodes).

Commits
-------

5c9e3bac96 [Translation] fix memoryleak in PhpFileLoader
2019-12-11 01:14:09 +01:00
Fabien Potencier
ebadf51543 bug #34920 [Routing] fix memoryleak when loading compiled routes (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Routing] fix memoryleak when loading compiled routes

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

Same as #34918 for Routing. That's the last significant memory hog I've identified.

Commits
-------

85371a174e [Routing] fix memoryleak when loading compiled routes
2019-12-11 01:13:19 +01:00
Nicolas Grekas
3df1d1efe0 bug #34787 [Cache] Propagate expiry when syncing items in ChainAdapter (trvrnrth)
This PR was merged into the 4.3 branch.

Discussion
----------

[Cache] Propagate expiry when syncing items in ChainAdapter

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

If a lower adapter provides item metadata, propagate the expiry time when syncing the item to upper ones.

Commits
-------

77138acea6 [Cache] Propagate expiry when syncing items in ChainAdapter
2019-12-10 17:56:02 +01:00
Trevor North
77138acea6 [Cache] Propagate expiry when syncing items in ChainAdapter
If a lower adapter provides item metadata, propagate the expiry time when
syncing the item to upper ones.
2019-12-10 17:45:08 +01:00
Nicolas Grekas
648544f432 Merge branch '4.3' into 4.4
* 4.3:
  Fix CS
2019-12-10 16:11:53 +01:00
Nicolas Grekas
5da657bcf3 Merge branch '3.4' into 4.3
* 3.4:
  Fix CS
2019-12-10 16:11:12 +01:00
Nicolas Grekas
c90cf3301a Fix CS 2019-12-10 16:06:53 +01:00
Yonel Ceruto
776523e56a Removed request header "Content-Type" from the preferred format guessing mechanism 2019-12-10 09:58:16 -05:00
Nicolas Grekas
85371a174e [Routing] fix memoryleak when loading compiled routes 2019-12-10 15:07:26 +01:00
Nicolas Grekas
4c50968dd8 [Validator] fix low deps 2019-12-10 14:43:13 +01:00
Nicolas Grekas
894c96bd32 minor #34917 Don't patch BadFileName.php fixture file (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

Don't patch BadFileName.php fixture file

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

Commits
-------

ba9d432d48 Don't patch BadFileName.php fixture file
2019-12-10 14:41:05 +01:00
Michael Voříšek
130df8ca8c Fix invalid Windows path normalization 2019-12-10 14:02:44 +01:00
Thomas Calvet
ba9d432d48 Don't patch BadFileName.php fixture file 2019-12-10 13:56:22 +01:00
Nicolas Grekas
5c9e3bac96 [Translation] fix memoryleak in PhpFileLoader 2019-12-10 13:51:10 +01:00
Christian Flothmann
142b1793e0 fix triggering deprecation in file locator 2019-12-10 13:26:43 +01:00
Dominik Pesch
ff1d77e155 bug #34877 [TwigBundle] fix findTemplate() to return null
Twig3 FilesystemLoader::findTemplate() should return `string|null`
instead of Twig2 `string|null|false`: see
<https://github.com/twigphp/Twig/blob/3.x/src/Loader/FilesystemLoader.php#L167>

Returning `null` fixes `exists()` of Twig 3 FilesystemLoader without
breaking Twig 2 (which expected `null` or `false` for not found
templates).

Change the test to assert `null` instead of `false`.
2019-12-10 12:13:11 +01:00
Nicolas Grekas
ea5ad5c40b minor #34912 [Debug] Updated the README to deprecate the component (javiereguiluz)
This PR was merged into the 4.4 branch.

Discussion
----------

[Debug] Updated the README to deprecate the component

| 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       | https://github.com/symfony/symfony-docs/issues/12775
| License       | MIT
| Doc PR        | -

Commits
-------

ab9e0eb2f5 [Debug] Updated the README to deprecate the component
2019-12-10 12:00:13 +01:00
Nicolas Grekas
7049b94aed bug #34694 [Validator] Fix auto-mapping constraints should not be validated (ogizanagi)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Validator] Fix auto-mapping constraints should not be validated

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

As for `Traverse`, I don't think we should add these "constraints" to the list.

I'm also wondering if it really makes sense to have these annotations as constraints. I think it should rather behave like the `GroupSequence` annotation to add the info the generic metadata at loading time, but we don't need to rely on the constraints behavior at all.

Commits
-------

bc53e4bca0 [Validator] Fix auto-mapping constraints should not be validated
2019-12-10 11:58:52 +01:00
Maxime Steinhausser
bc53e4bca0 [Validator] Fix auto-mapping constraints should not be validated 2019-12-10 11:58:45 +01:00
Nicolas Grekas
2e7032420f bug #34848 [Process] change the syntax of portable command lines (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Process] change the syntax of portable command lines

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34838
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/12772

An alternative to #34845

Right now, portable command lines use `"$FOO"` for placeholders.
But because we validate that a corresponding variable exists before running the command, this fails with `Command line is missing a value for key "$FOO"` when `FOO` is not defined.

This PR proposes to use `"${:FOO}"` instead. The difference with the previous syntax is that this cannot collide with existing shell scripts as it is invalid for them.

When this is merged, we'll have to update https://symfony.com/blog/new-in-symfony-4-1-prepared-commands too.

Commits
-------

3c7b775b3e [Process] change the syntax of portable prepared command lines
2019-12-10 11:51:39 +01:00
Nicolas Grekas
b81f4280df bug #34862 [FrameworkBundle][ContainerLintCommand] Reinitialize bundles when the container is reprepared (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle][ContainerLintCommand] Reinitialize bundles when the container is reprepared

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

Some bundles extensions are "instances dependents", eg they cache service registrations (eg: 70dec3c8a3/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php (L743)).

Launching the lint command loads all bundles a first time, just to be able to run the command.

Then, when we build the container again for the lint command, it loads all bundles a second time. But since it's the same bundles instances, some services are not registered, leading to missing services in `CheckExceptionOnInvalidReferenceBehaviorPass`.

Commits
-------

31975e4981 [FrameworkBundle][ContainerLintCommand] Reinitialize bundles when the container is reprepared
2019-12-10 11:48:48 +01:00
Javier Eguiluz
ab9e0eb2f5 [Debug] Updated the README to deprecate the component 2019-12-10 11:48:09 +01:00
Nicolas Grekas
e77059825c Merge branch '4.3' into 4.4
* 4.3:
  [Cache] fix memory leak when using PhpFilesAdapter
  [Yaml] Implement multiline string as scalar block for tagged values
  [HttpFoundation] Use `Cache-Control: must-revalidate` only if explicit lifetime has been given
  [FrameworkBundle] Use UserInterface to @return in getUser method
  [CI] Replace php7.4snapshot with php7.4 in Travis configuration
  [ExpressionLanguage][Node][BinaryNode] Process division by zero
  forward caught exception
  [Validator][ConstraintValidator] Stop passing unnecessary timezone argument to \DateTime
  add tags before processing them
  [MonologBridge] Fix debug processor datetime type
2019-12-10 11:33:21 +01:00
Nicolas Grekas
7f2d9c2b1e Merge branch '3.4' into 4.3
* 3.4:
  [Yaml] Implement multiline string as scalar block for tagged values
  [HttpFoundation] Use `Cache-Control: must-revalidate` only if explicit lifetime has been given
  [FrameworkBundle] Use UserInterface to @return in getUser method
  [CI] Replace php7.4snapshot with php7.4 in Travis configuration
  [ExpressionLanguage][Node][BinaryNode] Process division by zero
  forward caught exception
  [Validator][ConstraintValidator] Stop passing unnecessary timezone argument to \DateTime
  add tags before processing them
  [MonologBridge] Fix debug processor datetime type
2019-12-10 11:30:59 +01:00
Nicolas Grekas
5aff4a66f1 bug #34896 [Cache] fix memory leak when using PhpFilesAdapter (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Cache] fix memory leak when using PhpFilesAdapter

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

Similar to #34839 but for `PhpFilesAdapter`, as the "appendOnly" mode is a v4-only feature.

Commits
-------

0b46226648 [Cache] fix memory leak when using PhpFilesAdapter
2019-12-10 11:24:37 +01:00
Nicolas Grekas
0b46226648 [Cache] fix memory leak when using PhpFilesAdapter 2019-12-10 11:09:22 +01:00
Nicolas Grekas
42712ee006 bug #34438 [HttpFoundation] Use Cache-Control: must-revalidate only if explicit lifetime has been given (mpdude)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpFoundation] Use `Cache-Control: must-revalidate` only if explicit lifetime has been given

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

This is really nit-picking: The conservative, safe default for `Cache-Control` is `private, no-cache` which means the response must not be served from cache unless it has been validated.

If `Last-Modified` or `Expires` are present, we can relax `no-cache` to be `must-revalidate`, which means that _once the response has become stale_, it must be revalidated.

An `ETag` alone does not give the response a lifetime, so IMO sticking with `no-cache` in this case would be more consistent.

Commits
-------

1b1002b426 [HttpFoundation] Use `Cache-Control: must-revalidate` only if explicit lifetime has been given
2019-12-10 10:07:44 +01:00
Nicolas Grekas
035d8a3925 bug #34449 [Yaml] Implement multiline string as scalar block for tagged values (natepage)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Yaml] Implement multiline string as scalar block for tagged values

| Q             | A
| ------------- | ---
| Branch?       | 3.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 #... <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT

At the moment you can parse a tagged value defined as a scalar block. But you can't actually dump a multiline string as scalar block when using a tagged value.

This PR implements the multiline string as scalar block for tagged values as well.

Commits
-------

84241d4e62 [Yaml] Implement multiline string as scalar block for tagged values
2019-12-10 09:51:28 +01:00
natepage
84241d4e62 [Yaml] Implement multiline string as scalar block for tagged values 2019-12-10 09:51:22 +01:00
Matthias Pigulla
1b1002b426 [HttpFoundation] Use Cache-Control: must-revalidate only if explicit lifetime has been given 2019-12-10 09:49:31 +01:00