Commit Graph

30691 Commits

Author SHA1 Message Date
Nicolas Grekas
cbfb7a7495 Merge branch '3.4' into 4.0
* 3.4:
  Bump ext-mongodb to 1.5 on Travis
  Redesign the Debug error page in prod
  [DI] fix dumping deprecated service in yaml
  bumped Symfony version to 3.4.13
  updated VERSION for 3.4.12
  updated CHANGELOG for 3.4.12
  bumped Symfony version to 2.8.43
  updated VERSION for 2.8.42
  update CONTRIBUTORS for 2.8.42
  updated CHANGELOG for 2.8.42
2018-06-27 23:04:32 +02:00
David Maicher
89ed756462 failing test to reproduce session problem 2018-06-27 13:46:59 +02:00
Nicolas Grekas
26fc4e683f [HttpFoundation] fix session tracking counter 2018-06-27 13:36:49 +02:00
Fabien Potencier
0252a00311 feature #27499 Improved an error message related to controllers (javiereguiluz)
This PR was squashed before being merged into the 4.2-dev branch (closes #27499).

Discussion
----------

Improved an error message related to controllers

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

This proposal is irrelevant for experienced users but it may be useful for newcomers. After having delivered several introductory Symfony training, I can say that when someone adds `return "some string...";` in their controller, the error message is confusing:

![before](https://user-images.githubusercontent.com/73419/40959468-0faf790a-689d-11e8-9ce1-f6e0caf4b113.png)

Maybe we can reword it a bit? (I'm open for suggestions to improve the error message)

![after](https://user-images.githubusercontent.com/73419/40959505-29747070-689d-11e8-834e-92bf18760469.png)

Commits
-------

7510c3a335 Improved an error message related to controllers
2018-06-27 11:26:40 +02:00
Javier Eguiluz
7510c3a335 Improved an error message related to controllers 2018-06-27 11:25:38 +02:00
Fabien Potencier
1a3d445ec5 feature #26300 [PropertyInfo] Implement "Collection" types in PhpDocExtractor (popy-dev)
This PR was squashed before being merged into the 4.2-dev branch (closes #26300).

Discussion
----------

[PropertyInfo] Implement "Collection" types in PhpDocExtractor

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #26299
| License       | MIT
| Doc PR        | todo

Here's a proposition of implementation of my feature request #26299 :
I added few tests covering the requested feature, and I had to change a few things in the ```Symfony\Component\PropertyInfo\Util\PhpDocTypeHelper``` class (createType no longer gets a string, but a ```phpDocumentor\Reflection\Type``` instance) to be able to detect properly Collections and their subtypes.

Of course a simpler implementation is possible, without changing the PhpDocTypeHelper internal behaviour, by matching the input string against ```/^([^>]+)</``` and extracting the classname alone.

Commits
-------

12bafe46d0 [PropertyInfo] Implement \"Collection\" types in PhpDocExtractor
2018-06-26 18:34:19 +02:00
Pierre Dudoret
12bafe46d0 [PropertyInfo] Implement \"Collection\" types in PhpDocExtractor 2018-06-26 18:34:11 +02:00
Javier Eguiluz
7b9b1b9022 Redesign the Debug error page in prod 2018-06-26 10:45:54 +02:00
Nicolas Grekas
3d8490e59c Merge branch '2.8' into 3.4
* 2.8:
  [DI] fix dumping deprecated service in yaml
  bumped Symfony version to 2.8.43
  updated VERSION for 2.8.42
  update CONTRIBUTORS for 2.8.42
  updated CHANGELOG for 2.8.42
2018-06-26 10:26:17 +02:00
Nicolas Grekas
411be25aba [DI] fix dumping deprecated service in yaml 2018-06-26 10:00:00 +02:00
Christian Flothmann
05d4bcb987 fix handling of empty DI extension configs 2018-06-26 09:48:43 +02:00
Christian Flothmann
251e684fe6 add conflict for non-compatible TwigBridge version 2018-06-26 09:38:32 +02:00
Fabien Potencier
2b9c142f07 feature #26946 [WebProfilerBundle] Display uploaded files in the profiler (javiereguiluz)
This PR was squashed before being merged into the 4.2-dev branch (closes #26946).

Discussion
----------

[WebProfilerBundle] Display uploaded files in the profiler

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #26926
| License       | MIT
| Doc PR        | -

![profiler_files](https://user-images.githubusercontent.com/73419/38807087-ac1e9bac-417b-11e8-99e0-317b437c986e.png)

Note: I wanted to use the VarDumper to display the table information (as we do in the rest of tables) but I had lots of problems and I just wanted to create a proof of concept for the feature to see if we like it.

Commits
-------

3f6f75bc12 [WebProfilerBundle] Display uploaded files in the profiler
2018-06-25 19:10:15 +02:00
Javier Eguiluz
3f6f75bc12 [WebProfilerBundle] Display uploaded files in the profiler 2018-06-25 19:10:04 +02:00
Fabien Potencier
21a3439a29 feature #27476 [Config] deprecate tree builders without root nodes (xabbuh)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Config] deprecate tree builders without root nodes

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

While reviewing #27472 I wondered if we really need support config trees without a root node. If we did not support it, users wouldn't create pseudo configuration classes when they were actually not needed.

Commits
-------

c2ce15301c deprecate tree builders without root nodes
2018-06-25 19:06:32 +02:00
Fabien Potencier
d871473ef2 feature #27586 [PropertyAccess] Add Property Path to Exception Message (rodnaph)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[PropertyAccess] Add Property Path to Exception Message

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | None
| License       | MIT
| Doc PR        | None

When an exception is thrown writing a property it is not currently obvious which path is at fault (eg. `Expected argument of type "%s", "%s" given` - but where?). This patch appends the current property path to the exception so it is clear which path caused the error (eg. `Expected argument of type "%s", "%s" given at property path "foo.bar"`)

Commits
-------

473a025643 add property path to exception message when error writing property
2018-06-25 18:57:23 +02:00
Maxime Steinhausser
660a456d6f [Serializer] CsvEncoder::AS_COLLECTION_KEY constant 2018-06-25 18:22:54 +02:00
Fabien Potencier
e32b9650cb bumped Symfony version to 4.1.2 2018-06-25 15:32:41 +02:00
Fabien Potencier
c02e5001ba updated VERSION for 4.1.1 2018-06-25 15:06:45 +02:00
Fabien Potencier
54bca19bae bumped Symfony version to 4.0.13 2018-06-25 15:04:35 +02:00
Fabien Potencier
8984efc1ac updated VERSION for 4.0.12 2018-06-25 15:02:08 +02:00
Fabien Potencier
2a2a9d89c8 bumped Symfony version to 3.4.13 2018-06-25 15:00:40 +02:00
Fabien Potencier
88bb4c2e98 updated VERSION for 3.4.12 2018-06-25 14:29:19 +02:00
Fabien Potencier
d59f210d43 bumped Symfony version to 2.8.43 2018-06-25 14:28:20 +02:00
Fabien Potencier
c821f1ae50 updated VERSION for 2.8.42 2018-06-25 14:01:56 +02:00
Nicolas Grekas
5fe78a33d8 Revert "minor #27609 Remove direct dependencies on doctrine/common (Majkl578)"
This reverts commit 92c37b9711, reversing
changes made to bc8d4f627e.
2018-06-25 13:45:21 +02:00
Nicolas Grekas
0cfbed1bbb Merge branch '4.0' into 4.1
* 4.0:
  [DoctrineBridge] blacklist doctrine/common@dev
2018-06-25 13:31:22 +02:00
Nicolas Grekas
765b402851 Merge branch '3.4' into 4.0
* 3.4:
  [DoctrineBridge] blacklist doctrine/common@dev
2018-06-25 13:30:59 +02:00
Nicolas Grekas
a22de07c30 [DoctrineBridge] blacklist doctrine/common@dev 2018-06-25 13:26:49 +02:00
Fabien Potencier
7b6ad74fa2 Merge branch '4.1'
* 4.1:
  [TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled
  Add note about changed form processing when using PUT requests
  [TwigBundle] bump lowest deps to fix issue with "double-colon" controller service refs
  [SecurityBundle] Dont throw if "security.http_utils" is not found
  [Di] Fix undefined variable found by Php Inspections (EA Ultimate)
  [DI] Cleanup unused service_subscriber.locator tag
  [DI] Resolve env placeholder in logs
  The debug class loader is always loaded by Debug::enable().
  [Intl] Update ICU data to 62.1
2018-06-25 13:13:38 +02:00
Fabien Potencier
8c687c6401 Merge branch '4.0' into 4.1
* 4.0:
  [TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled
  Add note about changed form processing when using PUT requests
  [SecurityBundle] Dont throw if "security.http_utils" is not found
  [Di] Fix undefined variable found by Php Inspections (EA Ultimate)
  [DI] Cleanup unused service_subscriber.locator tag
  [DI] Resolve env placeholder in logs
  The debug class loader is always loaded by Debug::enable().
  [Intl] Update ICU data to 62.1
2018-06-25 13:12:43 +02:00
Fabien Potencier
b626ee9af5 Merge branch '3.4' into 4.0
* 3.4:
  [TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled
  Add note about changed form processing when using PUT requests
  [SecurityBundle] Dont throw if "security.http_utils" is not found
  [Di] Fix undefined variable found by Php Inspections (EA Ultimate)
  [DI] Cleanup unused service_subscriber.locator tag
  [DI] Resolve env placeholder in logs
  The debug class loader is always loaded by Debug::enable().
  [Intl] Update ICU data to 62.1
2018-06-25 13:12:25 +02:00
Fabien Potencier
1bea76aed9 Merge branch '2.8' into 3.4
* 2.8:
  Add note about changed form processing when using PUT requests
  The debug class loader is always loaded by Debug::enable().
  [Intl] Update ICU data to 62.1
2018-06-25 13:10:40 +02:00
Fabien Potencier
76d81b98f2 feature #27699 Redesigned the default error page in production (javiereguiluz)
This PR was merged into the 4.2-dev branch.

Discussion
----------

Redesigned the default error page in production

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #22964
| License       | MIT
| Doc PR        | -

This continues the work done in #27071.

Before/After comparison:

![before-after-prod-error-pages](https://user-images.githubusercontent.com/73419/41844084-6e132208-786f-11e8-97c9-53602395e231.png)

Commits
-------

1df8b3e741 Redesigned the default error page in production
2018-06-25 13:09:22 +02:00
Fabien Potencier
2d29e2d427 bug #27626 [TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled (thewilkybarkid)
This PR was squashed before being merged into the 3.4 branch (closes #27626).

Discussion
----------

[TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

While adding https://github.com/elifesciences/journal/pull/990 I was a bit confused why the `preload()` Twig function didn't work initially. Turns out the WebLink component is disabled by default if using the full stack, but the Twig extension is always enabled.

This only adds the Twig extension if the component is enabled, and shows a friendly error message if it's not.

Commits
-------

cccb66f4c6 [TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled
2018-06-25 13:07:27 +02:00
Chris Wilkinson
cccb66f4c6 [TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled 2018-06-25 13:07:14 +02:00
Fabien Potencier
0dcf11102b feature #27655 [Translation] Added support for translation files with other filename patterns (javiereguiluz)
This PR was squashed before being merged into the 4.2-dev branch (closes #27655).

Discussion
----------

[Translation] Added support for translation files with other filename patterns

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27644
| License       | MIT
| Doc PR        | -

This implements the #27644 feature request in case we accept it.

My vote is 👍 because the changes required are tiny and the resulting code is even more robust thanks to the new `preg_match()` call.

Commits
-------

0ee912dbd8 [Translation] Added support for translation files with other filename patterns
2018-06-25 12:22:58 +02:00
Javier Eguiluz
0ee912dbd8 [Translation] Added support for translation files with other filename patterns 2018-06-25 12:22:51 +02:00
Fabien Potencier
a1eb6491aa added missing CHANGELOG 2018-06-25 11:52:54 +02:00
Nicolas Grekas
f75723f38a [TwigBundle] bump lowest deps to fix issue with "double-colon" controller service refs 2018-06-25 11:52:53 +02:00
Fabien Potencier
53a39b791e feature #27580 [Form] Add ability to clear form errors (colinodell)
This PR was squashed before being merged into the 4.2-dev branch (closes #27580).

Discussion
----------

[Form] Add ability to clear form errors

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #14060
| License       | MIT
| Doc PR        | symfony/symfony-docs#9916

This PR adds the ability to manually clear form errors, thus improving the DX issue reported in #14060.

Unlike my original approach in #14233 and #27571 which break BC, this adds a new `ClearableErrorInterface` which `Form` implements.  (`Button` does not implement it because buttons can't have errors.)

Commits
-------

9eb755c07f [Form] Add ability to clear form errors
2018-06-25 11:51:57 +02:00
Colin O'Dell
9eb755c07f [Form] Add ability to clear form errors 2018-06-25 11:51:51 +02:00
Nicolas Grekas
db88330448 [SecurityBundle] Dont throw if "security.http_utils" is not found 2018-06-25 11:35:14 +02:00
Vladimir Reznichenko
a3a9e2ec19 [Di] Fix undefined variable found by Php Inspections (EA Ultimate) 2018-06-25 10:36:56 +02:00
Javier Eguiluz
1df8b3e741 Redesigned the default error page in production 2018-06-25 09:13:42 +02:00
Fabien Potencier
abe49ef9f4 minor #27679 [Intl] Update ICU data to 62.1 (jakzal)
This PR was merged into the 2.8 branch.

Discussion
----------

[Intl] Update ICU data to 62.1

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

It's this time of the year again to update ICU data. http://site.icu-project.org/download/62

Not many actual changes this time. Few new scripts added and some metadata for the VEF currency.

Commits
-------

5f2e6c2f12 [Intl] Update ICU data to 62.1
2018-06-25 09:09:10 +02:00
Fabien Potencier
86361e58a6 feature #27247 [Form] Deprecate searchAndRenderBlock returning empty string (ostrolucky)
This PR was squashed before being merged into the 4.2-dev branch (closes #27247).

Discussion
----------

[Form] Deprecate `searchAndRenderBlock` returning empty string

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #26531
| License       | MIT
| Doc PR        | -

I would like to remove this silent behavior, because it's confusing

Commits
-------

02f2f0ed39 [Form] Deprecate `searchAndRenderBlock` returning empty string
2018-06-25 08:48:10 +02:00
Gabriel Ostrolucký
02f2f0ed39 [Form] Deprecate searchAndRenderBlock returning empty string 2018-06-25 08:47:55 +02:00
Nicolas Grekas
c871857a47 Merge branch '4.1'
* 4.1:
  [VarDumper] Fix dumping by splitting Server/Connection out of Dumper/ServerDumper
  [HttpKernel] fix argument's error messages in ServiceValueResolver
  [DI] Avoid leaking unused env placeholders
2018-06-24 10:10:38 +02:00
Nicolas Grekas
fd3571d172 minor #27691 [DI] Cleanup unused service_subscriber.locator tag (ro0NL)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Cleanup unused service_subscriber.locator tag

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes-ish
| New feature?  | no
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Cleanup internal DI tag `container.service_subscriber.locator` so it's _not_ reported as unused tag, i.e.:

```
Tag "container.service_subscriber.locator" was defined on service(s) "App\Controller\MainController", "translation.warmer", "router.cache_warmer", "twig.cache_warmer", "twig.template_cache_warmer",
but was never used. Did you mean "container.service_subscriber", "container.service_locator"?
```

Commits
-------

8e060fa45d [DI] Cleanup unused service_subscriber.locator tag
2018-06-24 09:58:37 +02:00
Nicolas Grekas
ac74c9abdd bug #27687 [HttpKernel] fix argument's error messages in ServiceValueResolver (nicolas-grekas)
This PR was merged into the 4.1 branch.

Discussion
----------

[HttpKernel] fix argument's error messages in ServiceValueResolver

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27625
| License       | MIT
| Doc PR        | -

Forgotten while renamed to hidden services.

Commits
-------

aa50ffcd0e [HttpKernel] fix argument's error messages in ServiceValueResolver
2018-06-24 09:57:17 +02:00
Nicolas Grekas
4660857ffa bug #27614 [VarDumper] Fix dumping by splitting Server/Connection out of Dumper/ServerDumper (nicolas-grekas)
This PR was merged into the 4.1 branch.

Discussion
----------

[VarDumper] Fix dumping by splitting Server/Connection out of Dumper/ServerDumper

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27622
| License       | MIT
| Doc PR        | -

Right now, the `dump()` function is broken on 4.1 as soon as one sets up a `dump_destination` for the dump server (as done by default by our Flex recipe). #27397 describes the issue and proposes a tentative fix. Yet, I think the issue is deeper and exists at the design level. Writting to the server should not happen in a `DumperInterface`, that's not its semantics. Instead, I propose a `Connection` object that will allow `DumpDataCollector` to have all the info it requires to do everything on its own.

My bad for not spotting this at the review stage.

Commits
-------

1435d677be [VarDumper] Fix dumping by splitting Server/Connection out of Dumper/ServerDumper
2018-06-24 09:55:51 +02:00
Roland Franssen
8e060fa45d [DI] Cleanup unused service_subscriber.locator tag 2018-06-23 15:02:32 +02:00
Roland Franssen
b58eb0117f [DI] Resolve env placeholder in logs 2018-06-23 14:49:00 +02:00
Nicolas Grekas
1435d677be [VarDumper] Fix dumping by splitting Server/Connection out of Dumper/ServerDumper 2018-06-23 14:23:56 +02:00
Nicolas Grekas
aa50ffcd0e [HttpKernel] fix argument's error messages in ServiceValueResolver 2018-06-23 09:14:34 +02:00
Nicolas Grekas
6285e68fa6 [DI] fix dumping errored definitions 2018-06-23 09:13:02 +02:00
Alexander M. Turek
d1f41601f4 The debug class loader is always loaded by Debug::enable(). 2018-06-22 17:01:26 +02:00
Roland Franssen
41f8494722 [DI] Avoid leaking unused env placeholders 2018-06-22 13:40:15 +02:00
Nicolas Grekas
72bf72aa6a Merge branch '4.1'
* 4.1:
  [minor] SCA
  [Serializer] Minor tweaks for a67b650f12
  allow_extra_attributes does not throw an exception as documented
  [Cache] fix visibility of RedisTrait::init()
  [Serializer] Updates DocBlock to a mixed param type
2018-06-22 10:59:57 +02:00
Nicolas Grekas
671e412417 Merge branch '4.0' into 4.1
* 4.0:
  [minor] SCA
  [Serializer] Minor tweaks for a67b650f12
  allow_extra_attributes does not throw an exception as documented
  [Cache] fix visibility of RedisTrait::init()
  [Serializer] Updates DocBlock to a mixed param type
2018-06-22 10:59:39 +02:00
Nicolas Grekas
b4a58e29d3 Merge branch '3.4' into 4.0
* 3.4:
  [Serializer] Minor tweaks for a67b650f12
  allow_extra_attributes does not throw an exception as documented
  [Cache] fix visibility of RedisTrait::init()
  [Serializer] Updates DocBlock to a mixed param type
2018-06-22 10:59:07 +02:00
Nicolas Grekas
0e0cf1467a Merge branch '2.8' into 3.4
* 2.8:
  [Serializer] Updates DocBlock to a mixed param type
2018-06-22 10:58:39 +02:00
Jakub Zalas
5f2e6c2f12
[Intl] Update ICU data to 62.1 2018-06-22 07:57:03 +01:00
Fabien Potencier
27909450c1 minor #27676 [minor] SCA (kalessil)
This PR was squashed before being merged into the 4.0 branch (closes #27676).

Discussion
----------

[minor] SCA

| Q             | A
| ------------- | ---
| Branch?       | 4.0>
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Found some leftovers after introducing parameter types in 4.0.

Commits
-------

afeb89fa06 [minor] SCA
2018-06-22 08:03:22 +02:00
Vladimir Reznichenko
afeb89fa06 [minor] SCA 2018-06-22 08:03:15 +02:00
Maxime Steinhausser
bdcd0ba569 [Serializer] Minor tweaks for a67b650f12 2018-06-21 22:04:03 +02:00
Andrew Berry
a67b650f12 allow_extra_attributes does not throw an exception as documented 2018-06-21 21:59:49 +02:00
Fabien Potencier
9f6af974fa minor #27663 [Serializer] Updates DocBlock to a mixed param type (andrewnclark)
This PR was merged into the 2.8 branch.

Discussion
----------

[Serializer] Updates DocBlock to a mixed param type

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      |  Yes
| New feature?  |  No
| BC breaks?    | No
| Deprecations? | Non added.
| Tests pass?   | Yes , no new tests added.
| Fixed tickets | #27457
| License       | MIT

<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
 - Bug fixes must be submitted against the lowest 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 the master branch.
-->

The JSON serializers make use of the JsonSerializable interface and return arrays to the NormalizerInterface. This PR updates the DocBlock to reflect that.

Moving towards PHP 7.2 and the use of object type-hints would require changes to the [JsonSerializableNormalizer@L41](92c37b9711/src/Symfony/Component/Serializer/Normalizer/JsonSerializableNormalizer.php (L41)) at a minimum.

Truly not much of a PR I'm afraid!

Commits
-------

dca9ff529a [Serializer] Updates DocBlock to a mixed param type
2018-06-21 18:45:44 +02:00
Nicolas Grekas
3bd9a6b97e [Cache] fix visibility of RedisTrait::init() 2018-06-21 14:16:06 +02:00
Nicolas Grekas
6064cfe016 bug #27670 [Cache] Fix locking on Solaris (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Cache] Fix locking on Solaris

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

As reported on #27668, the descriptor must be writeable on Solaris to get an exclusive lock.

Commits
-------

43da583267 [Cache] Fix locking on Solaris
2018-06-21 13:19:41 +02:00
Nicolas Grekas
31fc855e22 Merge branch '4.1'
* 4.1:
  [Lock] use 'r+' for fopen (fixes issue on Solaris)
  [HttpKernel] fix test compat with PHP 5.3
  fix handling of nested Error instances
  fix file lock on SunOS
  Ignore keepQueryParams attribute when generating route redirect.
  [Cache] more granular handling of exceptions in AbstractTrait::clear()
  change `evaluate()` docblock return type from string to mixed
  Set serialize_precision explicitly to avoid fancy float rounding
2018-06-21 13:18:49 +02:00
Nicolas Grekas
f83316707f bug #27664 [FrameworkBundle] Ignore keepQueryParams attribute when generating route redirect (vudaltsov)
This PR was merged into the 4.1 branch.

Discussion
----------

[FrameworkBundle] Ignore keepQueryParams attribute when generating route redirect

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Prevents keepQueryParams from appearing in query.

Commits
-------

1e10475d88 Ignore keepQueryParams attribute when generating route redirect.
2018-06-21 13:16:32 +02:00
Nicolas Grekas
e1f2c3c058 Merge branch '4.0' into 4.1
* 4.0:
  [Lock] use 'r+' for fopen (fixes issue on Solaris)
  [HttpKernel] fix test compat with PHP 5.3
  fix handling of nested Error instances
  fix file lock on SunOS
  [Cache] more granular handling of exceptions in AbstractTrait::clear()
  change `evaluate()` docblock return type from string to mixed
  Set serialize_precision explicitly to avoid fancy float rounding
2018-06-21 13:15:46 +02:00
Nicolas Grekas
26535bbe87 Merge branch '3.4' into 4.0
* 3.4:
  [Lock] use 'r+' for fopen (fixes issue on Solaris)
  [HttpKernel] fix test compat with PHP 5.3
  fix handling of nested Error instances
  fix file lock on SunOS
  [Cache] more granular handling of exceptions in AbstractTrait::clear()
  change `evaluate()` docblock return type from string to mixed
  Set serialize_precision explicitly to avoid fancy float rounding
2018-06-21 13:14:29 +02:00
Nicolas Grekas
df0dba6cdf bug #27668 [Lock] use 'r+' for fopen (fixes issue on Solaris) (fritzmg)
This PR was squashed before being merged into the 3.4 branch (closes #27668).

Discussion
----------

[Lock] use 'r+' for fopen (fixes issue on Solaris)

| Q             | A
| ------------- | ---
| Branch?       | 3.4 (also applicable to _LockHandler_ in 2.8 and 3.3)
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes [1]
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

We discovered a curious case on a specific hosting environment: the `FlockStorage` (or `LockHandler` in previous Symfony versions) could never get a file lock on **existing files**. So if you run a script for the first time and the lock file did not exist yet, the `FlockStorage` could get a lock on that file just fine. However on the second and subsequent runs, `FlockStorage` could _never_ get a file lock anymore. You can follow the discussion [here](https://github.com/contao/core-bundle/issues/1551) (if you speak German).

We have been using this little script to confirm the issue on the hosting environment:
```php
$fileName = __DIR__ . '/file.lock';

if (!$handle = @fopen($fileName, 'r')) {
    $handle = fopen($fileName, 'x');
}

if (!$handle) {
    echo "Could not open $fileName\n";
    exit;
}

if (flock($handle, LOCK_EX | LOCK_NB)) {
    echo "Got a lock on $fileName\n";
    flock($handle, LOCK_UN | LOCK_NB);
} else {
    echo "Could not get a lock on $fileName\n";
}
```
Whenever `file.lock` already existed prior to running the script, a lock could not be made.

After contacting the hosting provider's support on this they confirmed the issue and told us they are using **Solaris** instead of a Linux environment. And this is supposedly why it does not work. Instead you have to use `'r+'` instead of `'r'` for `fopen`.

I was able to confirm that changing from `'r'` to `'r+'` fixes the issue. However I am wondering who's actually at fault here. Is it Solaris? PHP? The compiled PHP version under Solaris? The hosting provider's operating system configuration?

### System information
```
uname -a
SunOS vlek 5.11 11.3 i86pc i386 i86pc Solaris
```
```
phpinfo:
SunOS localhost 5.10 Generic_150401-49 i86pc
```
```
php -v
PHP 7.2.5 (cli) (built: May  4 2018 12:57:43) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
```

### Footnotes

[1] Previously one failed test on the first run and two failing tests on the second run with the proposed changes:
```
1) Symfony\Component\Lock\Tests\Store\FlockStoreTest::testSaveSanitizeName
Symfony\Component\Lock\Exception\LockStorageException: fopen(C:\Users\[…]\AppData\Local\Temp/sf.-php-echo-hello-word-.Sz2dDSf.lock)
: failed to open stream: Permission denied
```
```
2) Symfony\Component\Lock\Tests\Store\FlockStoreTest::testSaveWithDifferentKeysOnSameResources
Symfony\Component\Lock\Exception\LockStorageException: fopen(C:\Users\[…]\AppData\Local\Temp/sf.Symfony-Component-Lock-Tests-Store-
AbstractStoreTest-testSaveWithDifferentKeysOnSameResources5b2b5f00872538.64807920.2u9bH+a.lock): failed to open stream: Permission denied
```
The latter failed both on the first run and on the second run.

After the [proposed changes](https://github.com/symfony/symfony/pull/27668#discussion_r197054198) from @nicolas-grekas everything works fine 👍

Commits
-------

9c9ae7d9c9 [Lock] use 'r+' for fopen (fixes issue on Solaris)
2018-06-21 13:12:36 +02:00
Fritz Michael Gschwantner
9c9ae7d9c9 [Lock] use 'r+' for fopen (fixes issue on Solaris) 2018-06-21 13:12:28 +02:00
Nicolas Grekas
7090495250 Merge branch '2.8' into 3.4
* 2.8:
  [HttpKernel] fix test compat with PHP 5.3
  fix file lock on SunOS
  change `evaluate()` docblock return type from string to mixed
  Set serialize_precision explicitly to avoid fancy float rounding
2018-06-21 13:10:19 +02:00
Nicolas Grekas
f63579d360 bug #27669 [Filesystem] fix file lock on SunOS (fritzmg)
This PR was merged into the 2.8 branch.

Discussion
----------

[Filesystem] fix file lock on SunOS

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

See https://github.com/symfony/symfony/pull/27668

Commits
-------

7adb641d7c fix file lock on SunOS
2018-06-21 13:08:28 +02:00
Nicolas Grekas
749410a224 [HttpKernel] fix test compat with PHP 5.3 2018-06-21 13:07:36 +02:00
Andrew Clark
dca9ff529a [Serializer] Updates DocBlock to a mixed param type 2018-06-21 12:57:13 +02:00
Christian Flothmann
a6696d03b1 fix handling of nested Error instances 2018-06-21 12:30:28 +02:00
fritzmg
7adb641d7c fix file lock on SunOS 2018-06-21 11:24:14 +02:00
Nicolas Grekas
43da583267 [Cache] Fix locking on Solaris 2018-06-21 11:23:42 +02:00
Valentin
1e10475d88 Ignore keepQueryParams attribute when generating route redirect. 2018-06-21 00:41:56 +03:00
Nicolas Grekas
ff0de67519 [Cache] more granular handling of exceptions in AbstractTrait::clear() 2018-06-20 22:30:04 +02:00
Fabien Potencier
92c37b9711 minor #27609 Remove direct dependencies on doctrine/common (Majkl578)
This PR was merged into the 4.2-dev branch.

Discussion
----------

Remove direct dependencies on doctrine/common

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | ?

Doctrine has recently separated multiple components from doctrine/common:
* [doctrine/event-manager](https://github.com/doctrine/event-manager) [[release notes](https://github.com/doctrine/event-manager/releases/tag/v1.0.0) | [split PR](https://github.com/doctrine/common/pull/842)]
* [doctrine/persistence](https://github.com/doctrine/persistence) [[release notes](https://github.com/doctrine/persistence/releases/tag/v1.0.0) | [split PR](https://github.com/doctrine/common/pull/845)]
* [doctrine/reflection](https://github.com/doctrine/reflection) [[release notes](https://github.com/doctrine/reflection/releases/tag/v1.0.0) | [split PR](https://github.com/doctrine/common/pull/845)]

All of the packages are 100% backward compatible with their counterparts in Common 2.8.

This is a major step to slowly start with [phasing out doctrine/common package](https://github.com/doctrine/common/issues/826) before ORM 3.0 / DBAL 3.0 / ODM 3.0.
Common 2.9.0 will also be composed from these new packages.

Most of the remaining parts in doctrine/common are likely to be deprecated (or already are), please see & discuss in [the PR over in doctrine/common repository](https://github.com/doctrine/common/pull/845).

This PR therefore aims to remove the direct doctrine/common dependency from Symfony, replacing it by specific Doctrine components.

Commits
-------

b0fa398187 Remove direct dependencies on doctrine/common
2018-06-20 19:56:31 +02:00
Fabien Potencier
bc8d4f627e feature #27646 [Cache] added support for phpredis 4 compression and tcp_keepalive options (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Cache] added support for phpredis 4 `compression` and `tcp_keepalive` options

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

See https://pecl.php.net/package-changelog.php?package=redis

Commits
-------

2ff02cd333 [Cache] added support for phpredis 4 `compression` and `tcp_keepalive` options
2018-06-20 19:52:00 +02:00
Fabien Potencier
1dac82a41a feature #27605 [DX] Log potential redirect loops caused by forced HTTPS (colinodell)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[DX] Log potential redirect loops caused by forced HTTPS

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27603
| License       | MIT
| Doc PR        | n/a

If the developer forgets/fails to set "trusted_proxies" properly, forcing the
https channel can cause infinite redirect loops. This change will hopefully
help them identify the problem faster.

See https://github.com/symfony/symfony/issues/27603

Commits
-------

53048cec6d Log potential redirect loops caused by forced HTTPS
2018-06-20 19:48:57 +02:00
jspee
2d26a556fd change evaluate() docblock return type from string to mixed 2018-06-20 19:39:05 +02:00
Fabien Potencier
1ff80e3b97 feature #27653 [Translation] Improved the performance of the lint:xliff command (javiereguiluz)
This PR was squashed before being merged into the 4.2-dev branch (closes #27653).

Discussion
----------

[Translation] Improved the performance of the lint:xliff command

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27564
| License       | MIT
| Doc PR        | -

As suggested by @stof I extracted the schema validation logic from XliffFileLoader to reuse it in the `lint:xliff` command. The validation is now instantaneous, so the command is blazing fast!

Commits
-------

e53bf5839b [Translation] Improved the performance of the lint:xliff command
2018-06-20 19:36:31 +02:00
Javier Eguiluz
e53bf5839b [Translation] Improved the performance of the lint:xliff command 2018-06-20 19:36:22 +02:00
Nicolas Grekas
e5059a0d7e minor #27637 Set serialize_precision explicitly to avoid fancy float rounding (Majkl578)
This PR was merged into the 2.8 branch.

Discussion
----------

Set serialize_precision explicitly to avoid fancy float rounding

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | -

This is fixing some of the test failures I was seeing locally due to increased `serialize_precision` INI setting:
```
2) Symfony\Component\HttpFoundation\Tests\JsonResponseTest::testConstructorWithSimpleTypes
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'0.1'
+'0.10000000000000001'

/www/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/JsonResponseTest.php:46

3) Symfony\Component\HttpFoundation\Tests\JsonResponseTest::testStaticCreateWithSimpleTypes
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'0.1'
+'0.10000000000000001'
```

The test assertions should not depend on externally configured PHP configuration.

Also default value for this option was changed multiple times: http://php.net/manual/en/ini.core.php#ini.serialize-precision
For compatibility reasons (with PHP <7.x) `-1` can't be used.

https://3v4l.org/HBNsT

HHVM doesn't seem to support this though, how to handle this?

Commits
-------

b5ee7c3ccd Set serialize_precision explicitly to avoid fancy float rounding
2018-06-20 14:43:58 +02:00
Nicolas Grekas
1abfb2ced6 Merge branch '4.1'
* 4.1:
  [Cache] Improve resiliency when calling doFetch() in AbstractTrait
  [Messenger] Fixed MessengerPass::guessHandledClasses return type
  Fixing GlobResource when inside phar archive
2018-06-20 13:16:05 +02:00
Nicolas Grekas
389fa4dc23 bug #27651 [Messenger] Fixed MessengerPass::guessHandledClasses return type (massimilianobraglia)
This PR was merged into the 4.1 branch.

Discussion
----------

[Messenger] Fixed MessengerPass::guessHandledClasses return type

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   |  no
| Fixed tickets | #27633
| License       | MIT
| Doc PR        | ø

#27633 should have been merged to 4.1.

Commits
-------

d6b6e9658c [Messenger] Fixed MessengerPass::guessHandledClasses return type
2018-06-20 13:15:41 +02:00
Nicolas Grekas
20147fce57 Merge branch '4.0' into 4.1
* 4.0:
  [Cache] Improve resiliency when calling doFetch() in AbstractTrait
  Fixing GlobResource when inside phar archive
2018-06-20 13:15:17 +02:00
Nicolas Grekas
641ecbb74b Merge branch '3.4' into 4.0
* 3.4:
  [Cache] Improve resiliency when calling doFetch() in AbstractTrait
  Fixing GlobResource when inside phar archive
2018-06-20 13:15:04 +02:00
Nicolas Grekas
b61c8fcb77 bug #26845 [Config] Fixing GlobResource when inside phar archive (vworldat)
This PR was merged into the 3.4 branch.

Discussion
----------

[Config] Fixing GlobResource when inside phar archive

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | yes if old broken behavior counts as stable
| Deprecations? | no
| Tests pass?   | no tests yet
| Fixed tickets |
| License       | MIT
| Doc PR        | N/A

When packaging an Sf4 application as a PHAR archive using globs at various locations (`Kernel`, `services.yaml`) most glob files are not found because the `glob()` PHP method [does not support PHAR streams](https://stackoverflow.com/questions/8203188/unexpected-problems-with-php-phar).

Using the regex fallback instead when operating inside PHAR archives fixes the behavior for me.

## Examples:

`src/Kernel.php::configureContainer()`:

```php
$loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');
```

Expected behavior: `config/services.yaml` inside PHAR archive is found and parsed
Actual behavior: the file will not be loaded

`config/services.yaml` (hard-coded in Kernel without using glob pattern)

```yaml
    App\:
        resource: '../src/*'
        exclude: '../src/{Entity,Migrations,Tests,Kernel.php}'
```

Expected behavior: service classes in `src/` will be found and auto-wired
Actual behavior: services are not auto-wired because the class files are not found

Commits
-------

e336ebeecf Fixing GlobResource when inside phar archive
2018-06-20 13:09:19 +02:00
Nicolas Grekas
b7ccf10de7 [Cache] Improve resiliency when calling doFetch() in AbstractTrait 2018-06-20 13:05:06 +02:00
Nicolas Grekas
683bbf9eaf Merge branch '4.1'
* 4.1:
  [Cache] Fix exception handling in AbstractTrait::clear()
  Revert "minor #27649 [Cache] fix Memcached tests (nicolas-grekas)"
2018-06-20 11:26:44 +02:00
Nicolas Grekas
a278c79c6e Merge branch '4.0' into 4.1
* 4.0:
  [Cache] Fix exception handling in AbstractTrait::clear()
  Revert "minor #27649 [Cache] fix Memcached tests (nicolas-grekas)"
2018-06-20 11:26:39 +02:00
Nicolas Grekas
6d26d9a5ae Merge branch '3.4' into 4.0
* 3.4:
  [Cache] Fix exception handling in AbstractTrait::clear()
  Revert "minor #27649 [Cache] fix Memcached tests (nicolas-grekas)"
2018-06-20 11:26:33 +02:00
Massimiliano Braglia
d6b6e9658c [Messenger] Fixed MessengerPass::guessHandledClasses return type 2018-06-20 12:25:27 +03:00
Nicolas Grekas
bef15cebca [Cache] Fix exception handling in AbstractTrait::clear() 2018-06-20 11:24:39 +02:00
Nicolas Grekas
bb644c1df8 Revert "minor #27649 [Cache] fix Memcached tests (nicolas-grekas)"
This reverts commit dc323f084c, reversing
changes made to 917b07a5c6.
2018-06-20 10:56:56 +02:00
Nicolas Grekas
2ff02cd333 [Cache] added support for phpredis 4 compression and tcp_keepalive options 2018-06-20 10:12:31 +02:00
Nicolas Grekas
d41385024f Merge branch '4.1'
* 4.1:
  [Cache] fix Memcached tests
2018-06-20 09:27:19 +02:00
Nicolas Grekas
f68e19468d Merge branch '4.0' into 4.1
* 4.0:
  [Cache] fix Memcached tests
2018-06-20 09:27:12 +02:00
Nicolas Grekas
9b64e8bedf Merge branch '3.4' into 4.0
* 3.4:
  [Cache] fix Memcached tests
2018-06-20 09:27:05 +02:00
Nicolas Grekas
dc323f084c minor #27649 [Cache] fix Memcached tests (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] fix Memcached tests

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Clearing a memcached pool works only when versioning is enabled. Dunno why this has not be caught before, but it's making tests fail now.

Commits
-------

09ec9e7cce [Cache] fix Memcached tests
2018-06-20 09:26:50 +02:00
Nicolas Grekas
09ec9e7cce [Cache] fix Memcached tests 2018-06-20 09:02:04 +02:00
Nicolas Grekas
a5a91d318c Merge branch '4.1'
* 4.1:
  [HttpKernel] fix PHP 5.4 compat
  Fix surrogate not using original request
  [Finder] Update RealIteratorTestCase
  [Routing] remove unneeded dev dep on doctrine/common
  [minor] SCA
  [Validator] Remove BOM in some xlf files
  Ensure updateTimestamp returns a boolean
  Fix #27378: Error when rendering a DateIntervalType form with exactly 0 weeks
  [HttpKernel] fix session tracking in surrogate master requests
2018-06-19 23:38:29 +02:00
Nicolas Grekas
34acfe4bfb Merge branch '4.0' into 4.1
* 4.0:
  [HttpKernel] fix PHP 5.4 compat
  Fix surrogate not using original request
  [Finder] Update RealIteratorTestCase
  [Routing] remove unneeded dev dep on doctrine/common
  [minor] SCA
  [Validator] Remove BOM in some xlf files
  Fix #27378: Error when rendering a DateIntervalType form with exactly 0 weeks
  [HttpKernel] fix session tracking in surrogate master requests
2018-06-19 23:38:16 +02:00
Nicolas Grekas
b85f70e3bc Merge branch '3.4' into 4.0
* 3.4:
  [HttpKernel] fix PHP 5.4 compat
  Fix surrogate not using original request
  [Finder] Update RealIteratorTestCase
  [Routing] remove unneeded dev dep on doctrine/common
  [minor] SCA
  [Validator] Remove BOM in some xlf files
  Fix #27378: Error when rendering a DateIntervalType form with exactly 0 weeks
  [HttpKernel] fix session tracking in surrogate master requests
2018-06-19 22:54:48 +02:00
Nicolas Grekas
917b07a5c6 Merge branch '2.8' into 3.4
* 2.8:
  [HttpKernel] fix PHP 5.4 compat
  Fix surrogate not using original request
  [Finder] Update RealIteratorTestCase
  [Routing] remove unneeded dev dep on doctrine/common
  [Validator] Remove BOM in some xlf files
2018-06-19 22:52:10 +02:00
Nicolas Grekas
0f2b752138 [HttpKernel] fix PHP 5.4 compat 2018-06-19 22:37:28 +02:00
Nicolas Grekas
a4f5c6e2b6 minor #27643 [FrameworkBundle] Fixed tests added in #27611 (HeahDude)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[FrameworkBundle] Fixed tests added in #27611

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | ~
| License       | MIT
| Doc PR        | ~

<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
 - Bug fixes must be submitted against the lowest 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 the master branch.
-->

Commits
-------

be97006c57 [FrameworkBundle] Fixed tests added in #27611
2018-06-19 22:33:37 +02:00
Jules Pietri
be97006c57 [FrameworkBundle] Fixed tests added in #27611 2018-06-19 19:13:47 +02:00
Colin O'Dell
53048cec6d Log potential redirect loops caused by forced HTTPS
If the developer forgets/fails to set "trusted_proxies" properly, forcing the
https channel can cause infinite redirect loops. This change will hopefully
help them identify the problem faster.

See https://github.com/symfony/symfony/issues/27603
2018-06-19 10:59:18 -04:00
Michael Moravec
b5ee7c3ccd
Set serialize_precision explicitly to avoid fancy float rounding 2018-06-19 16:38:49 +02:00
David Herrmann
e336ebeecf Fixing GlobResource when inside phar archive
When packaging an Sf4 application as a PHAR archive using globs at various locations (`Kernel`, `services.yaml`) most glob files are not found because the `glob()` PHP method [does not support PHAR streams](https://stackoverflow.com/questions/8203188/unexpected-problems-with-php-phar).

Using the regex fallback instead when operating inside PHAR archives fixes the behavior for me.
2018-06-19 16:02:58 +02:00
Nicolas Grekas
c4d972ac20 bug #27382 [Form] Fix error when rendering a DateIntervalType form with exactly 0 weeks (krixon)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Fix error when rendering a DateIntervalType form with exactly 0 weeks

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27378
| License       | MIT

Fixes the issue described in #27378

Commits
-------

dae704ad2f Fix #27378: Error when rendering a DateIntervalType form with exactly 0 weeks
2018-06-19 15:17:38 +02:00
Nicolas Grekas
4fde3bb4f3 feature #27421 CacheWarmerAggregate handle deprecations logs (ScullWM)
This PR was merged into the 4.2-dev branch.

Discussion
----------

CacheWarmerAggregate handle deprecations logs

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #27387
| License       | MIT

Actually the Web Debug Toolbar warning you about the deprecation messages thrown during the container built (#21502).
Cache warmup can throw deprecated message without any persistance, it may cause issue like #27387
This PR reproduce the same job for the cache warmer, and so on, handle deprecated messages during the warmup of Twig, Translator, Validator, Security and all `kernel.cache_warmer` services.

Here are the point that may be improvable in this PR:

1.  Actually I've "duplicate" the callable used in the `set_error_handler` of the Kernel.
IMHO I think that Kernel and CacheWarmerAggregate have differents jobs and a trait may be a good solution to share this error handler setter without duplicating the code, but I'm a little bit lost about the repercussion of adding a Trait in the Kernel.

2. I've think about extending the `CacheWarmerAggregate` into a `DeprecatedLogHandlingCacheWarmerAggregate` to add the debug and containerClass argument, and declare it as the `cache_warmer` service only in debug mode (by declaring it in the DebugBundle/Resources/config/services.xml).

Commits
-------

f03b8bba9d CacheWarmerAggregate handle deprecations logs
2018-06-19 15:15:00 +02:00
Yanick Witschi
ab86f43d78 Fix surrogate not using original request 2018-06-19 15:13:16 +02:00
Nicolas Grekas
e9e6ec54af feature #27611 [FrameworkBundle][SecurityBundle] Moved security expression providers pass logic to SecurityBundle (HeahDude)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[FrameworkBundle][SecurityBundle] Moved security expression providers pass logic to SecurityBundle

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ~
| License       | MIT
| Doc PR        | ~

Commits
-------

a8017be6ae [FrameworkBundle][SecurityBundle] Moved security expression providers pass logic to SecurityBundle
2018-06-19 15:04:04 +02:00
Jules Pietri
a8017be6ae [FrameworkBundle][SecurityBundle] Moved security expression providers pass logic to SecurityBundle 2018-06-19 15:02:06 +02:00
Nicolas Grekas
76d3589a44 feature #27277 [OptionsResolver] Introduce ability to deprecate options, allowed types and values (yceruto)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[OptionsResolver] Introduce ability to deprecate options, allowed types and values

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27216
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/9859

**Deprecating an option**
```php
$resolver = (new OptionsResolver())
    ->setDefined(['foo', 'bar'])
    ->setDeprecated('foo')
;
$resolver->resolve(['foo' => 'baz']); // PHP Deprecated: The option "foo" is deprecated.
```
With custom message:
```php
$resolver = (new OptionsResolver())
    ->setDefined('foo')
    ->setDefault('bar', function (Options $options) {
        return $options['foo'];
    })
    ->setDeprecated('foo', 'The option "foo" is deprecated, use "bar" option instead.')
;
$resolver->resolve(['foo' => 'baz']); // PHP Deprecated: The option "foo" is deprecated, use "bar" option instead.
$resolver->resolve(['bar' => 'baz']); // OK.
```
**Deprecating allowed types**
```php
$resolver = (new OptionsResolver())
    ->setDefault('type', null)
    ->setAllowedTypes('type', ['null', 'string', FormTypeInterface::class])
    ->setDeprecated('type', function ($value) {
        if ($value instanceof FormTypeInterface) {
            return sprintf('Passing an instance of "%s" to option "type" is deprecated, pass its FQCN instead.', FormTypeInterface::class);
        }
    })
;
$resolver->resolve(['type' => new ChoiceType()]); // PHP Deprecated: Passing an instance of "Symfony\Component\Form\FormTypeInterface" to option "type" is deprecated, pass its FQCN instead.
$resolver->resolve(['type' => ChoiceType::class]); // OK.
```
The closure is invoked when `resolve()` is called. The closure must return a string (the deprecation message) or an empty string to ignore the option deprecation.

Multiple types and normalizer:
```php
$resolver = (new OptionsResolver())
    ->setDefault('percent', 0.0)
    ->setAllowedTypes('percent', ['null', 'int', 'float'])
    ->setDeprecated('percent', function ($value) {
        if (null === $value) {
            return 'Passing "null" to option "percent" is deprecated, pass a float number instead.';
        }

        if (is_int($value)) {
            return sprintf('Passing an integer "%d" to option "percent" is deprecated, pass a float number instead.', $value);
        }
    })
    ->setNormalizer('percent', function (Options $options, $value) {
        return (float) $value;
    })
;
$resolver->resolve(['percent' => null]); // PHP Deprecated: Passing "null" to option "percent" is deprecated, pass a float number instead.
$resolver->resolve(['percent' => 20]); // PHP Deprecated: Passing an integer "20" to option "percent" is deprecated, pass a float number instead.
$resolver->resolve(['percent' => 20.0]); // OK.
```
The parameter passed to the closure is the value of the option after validating it and before normalizing it.

**Deprecating allowed values**
```php
$resolver = (new OptionsResolver())
    ->setDefault('percent', 0.0)
    ->setAllowedTypes('percent', 'float')
    ->setDeprecated('percent', function ($value) {
        if ($value < 0) {
            return 'Passing a number less than 0 to option "percent" is deprecated.';
        }
    })
;
$resolver->resolve(['percent' => -50.0]); // PHP Deprecated: Passing a number less than 0 to option "percent" is deprecated.
```

Commits
-------

f8746ce8bd Add ability to deprecate options
2018-06-19 14:56:30 +02:00
Nicolas Grekas
d148fa708a feature #26919 [TwigBridge] Added bundle name suggestion on wrongly overrided templates paths (pmontoya, Pascal Montoya)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[TwigBridge] Added bundle name suggestion on wrongly overrided templates paths

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #26898
| License       | MIT

Report unknown folders in templates/bundles in debug:twig and make suggestions if any

Developped with @bricejulia

Commits
-------

acfb325a35 refs #26898 Remove unnecessary loop Trim messages on build rather than on display
da42b3e23c refs #26898 Check if projectDir is not null before loop
da0c589385 refs #26898 Move changelog entry to 4.1.0 to 4.2.0
7d9467a319 Add an entry on json export format
bab9d99032 Use %twig.default_path% parameter and search in old folder structure too
1758de24a5 [TwigBridge] Added bundle name suggestion on wrongly overrided templates paths
2018-06-19 14:50:24 +02:00
Christian Flothmann
c2ce15301c deprecate tree builders without root nodes 2018-06-19 14:34:32 +02:00
Nicolas Grekas
18026dcc83 bug #27467 [HttpKernel] fix session tracking in surrogate master requests (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] fix session tracking in surrogate master requests

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Spotted while looking at ESI fragments resolved by`HttpCache`: right now when the master request starts the session, fragments are not cacheable anymore, even when they do not use the session.

Commits
-------

146e01cb44 [HttpKernel] fix session tracking in surrogate master requests
2018-06-19 13:58:43 +02:00
Michael Moravec
b0fa398187
Remove direct dependencies on doctrine/common 2018-06-19 13:41:48 +02:00
Nicolas Grekas
f065873881 feature #26486 [HttpFoundation] Adds getAcceptableFormats() method for Request (AndreiIgna)
This PR was squashed before being merged into the 4.2-dev branch (closes #26486).

Discussion
----------

[HttpFoundation] Adds getAcceptableFormats() method for Request

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #21909
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Adds a new method `getAcceptableFormats()` for `Request`. This reads the content types in Accept header and maps them to formats already defined in `Request` class

In a request made by a browser, based on the default Accept header, the `getAcceptableFormats()` will return an array `['html', 'xml']`

In progress
- [x] gather feedback for my changes
- [x] submit changes to the documentation

Commits
-------

8a127ea34a [HttpFoundation] Adds getAcceptableFormats() method for Request
2018-06-19 13:26:37 +02:00
Andrei Igna
8a127ea34a [HttpFoundation] Adds getAcceptableFormats() method for Request 2018-06-19 13:26:24 +02:00
Nicolas Grekas
9f1d1d82fb minor #27508 [Finder] Update RealIteratorTestCase (flip111)
This PR was submitted for the master branch but it was squashed and merged into the 2.8 branch instead (closes #27508).

Discussion
----------

[Finder] Update RealIteratorTestCase

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27480
| License       | MIT
| Doc PR        | n/a

Makes the entire test directory empty instead of trying to delete particular files and directories. The old method failed when trying to remove a directory which was not empty.

Commits
-------

7d0ebd41ab [Finder] Update RealIteratorTestCase
2018-06-19 13:07:17 +02:00
flip111
7d0ebd41ab [Finder] Update RealIteratorTestCase 2018-06-19 13:04:56 +02:00
Nicolas Grekas
6c03064cb6 feature #27535 [TwigBundle] Enhance the twig not found exception (behnoushnorouzi)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[TwigBundle] Enhance the twig not found exception

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27468
| License       | MIT
| Doc PR        | -

Improve error message to make it clear to developers what mistake they have made.

Commits
-------

32988b4294 Enhance the twig not found exception
2018-06-19 12:58:50 +02:00
Nicolas Grekas
c6948044c7 feature #27551 [FrameworkBundle] show public/private for aliases in debug:container command (OskarStark)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[FrameworkBundle] show public/private for aliases in debug:container command

| Q             | A
| ------------- | ---
| Branch?       |  master
| Bug fix?      | no
| New feature?  | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets |    <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | not needed <!-- required for new features -->

It could be helpful to see the public/private status for aliases in `debug:container` command.

Otherwise you need to dive into the code to get the information, because the result only shows the options of the aliased service.

## Look & Feel for public alias
![screenshot 2018-06-08 09 25 50](https://user-images.githubusercontent.com/995707/41144664-f3b50766-6afd-11e8-92d0-ca30513a1afc.png)

_text has slightly changed_

## Look & Feel for private alias
![screenshot 2018-06-08 09 23 31](https://user-images.githubusercontent.com/995707/41144593-b354aad2-6afd-11e8-8ab1-f9196e567f67.png)

_text has slightly changed_

//cc @nicolas-grekas

Commits
-------

1df7742345 [FrameworkBundle] show public/private for aliases in debug:container command
2018-06-19 12:57:50 +02:00
Nicolas Grekas
ec6b941738 [Routing] remove unneeded dev dep on doctrine/common 2018-06-19 11:52:17 +02:00
Nicolas Grekas
c6b3135c9b bug #27633 [Messenger] Fixed MessengerPass::guessHandledClasses return type (massimilianobraglia)
This PR was squashed before being merged into the 4.2-dev branch (closes #27633).

Discussion
----------

[Messenger] Fixed MessengerPass::guessHandledClasses return type

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

Good evening! Thanks for this amazing project.
I've searched over issues and PRs and I didn't find anything about this bug I found. Excuse me if this is a duplicate.

If you create an implementation of `MessageSubscriberInterface` and yield results from `getHandledMessages` method, a TypeError (like the following) will be raised:

```TypeError: Return value of Symfony\Component\Messenger\DependencyInjection\MessengerPass::guessHandledClasses() must be of the type array, object returned```

`MessengerPass::guessHandledClasses` return type declared is `array`, when `MessageSubscriberInterface::guessHandledClasses()`'s return type is `iterable`.

In this PR I have fixed the return type and wrote a simple test for it.

I am looking forward your review. Thank you.
Massimiliano

Commits
-------

0b1c8257d6 [Messenger] Fixed MessengerPass::guessHandledClasses return type
2018-06-19 11:34:47 +02:00
Massimiliano Braglia
0b1c8257d6 [Messenger] Fixed MessengerPass::guessHandledClasses return type 2018-06-19 11:34:40 +02:00
Nicolas Grekas
1f439e5845 minor #27623 [minor] SCA (kalessil)
This PR was squashed before being merged into the 3.4 branch (closes #27623).

Discussion
----------

[minor] SCA

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

New findings: language level, greedy regex, array_column usages

Commits
-------

5922507dc5 [minor] SCA
2018-06-19 11:31:47 +02:00
Vladimir Reznichenko
5922507dc5 [minor] SCA 2018-06-19 11:31:41 +02:00
Gautier Deuette
0bc53d66c0 [Validator] Remove BOM in some xlf files 2018-06-19 10:02:14 +02:00
Fabien Potencier
c0ca2afbb3 feature #27543 [Cache] serialize objects using native arrays when possible (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Cache] serialize objects using native arrays when possible

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

This PR allows leveraging OPCache shared memory when storing objects in `Php*` pool storages (as done by default for all system caches). This improves performance a bit further when loading e.g. annotations, etc. (bench coming);

Instead of using native php serialization, this uses a marshaller that represents objects in plain static arrays. Unmarshalling these arrays is faster than unserializing the corresponding PHP strings (because it works with copy-on-write, while unserialize cannot.)

php-serialization is still a possible format because we have to use it when serializing structures with internal references or with objects implementing `Serializable`. The best serialization format is selected automatically so this is completely seamless.

ping @palex-fpt since you gave me the push to work on this, and are pursuing a similar goal in #27484. I'd be thrilled to get some benchmarks on your scenarios.

Commits
-------

866420e2eb [Cache] serialize objects using native arrays when possible
2018-06-18 17:28:27 +02:00
Fabien Potencier
d075d0ce11 feature #27563 [Cache] Improve perf of array-based pools (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Cache] Improve perf of array-based pools

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

- skip key validation when key is already known
- remove overhead in `ArrayCache::get()` via inlining
- don't store simple values in serialized format when not needed, preserving COW

~~Needs #27565 to be green.~~

Commits
-------

92a2d4754f [Cache] Improve perf of array-based pools
2018-06-18 17:12:19 +02:00
Fabien Potencier
137dd7658e feature #27604 [Cache] Prevent stampede at warmup using flock() (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Cache] Prevent stampede at warmup using flock()

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Replaces #27028

This PR protects against cache stampede by wrapping the computation of items in a pool of locks.

For each apps, there can be at most 20 concurrent processes that compute items at the same time and only one per cache-key.

Commits
-------

0ac2777ad1 [Cache] Prevent stampede at warmup using flock()
2018-06-18 17:07:46 +02:00
Nicolas Grekas
0ac2777ad1 [Cache] Prevent stampede at warmup using flock() 2018-06-18 17:06:11 +02:00
MatTheCat
079b944077 Ensure updateTimestamp returns a boolean 2018-06-18 15:48:40 +02:00
karl.rixon
dae704ad2f Fix #27378: Error when rendering a DateIntervalType form with exactly 0 weeks 2018-06-18 12:57:58 +01:00
Pascal Montoya
acfb325a35
refs #26898
Remove unnecessary loop
Trim messages on build rather than on display
2018-06-18 12:27:44 +02:00
Pascal Montoya
da42b3e23c
refs #26898
Check if projectDir is not null before loop
2018-06-18 12:27:44 +02:00
Pascal Montoya
da0c589385
refs #26898
Move changelog entry to 4.1.0 to 4.2.0
2018-06-18 12:27:44 +02:00
Pascal Montoya
7d9467a319
Add an entry on json export format 2018-06-18 12:27:44 +02:00
Pascal Montoya
bab9d99032
Use %twig.default_path% parameter and search in old folder structure too 2018-06-18 12:27:44 +02:00
Pascal Montoya
1758de24a5
[TwigBridge] Added bundle name suggestion on wrongly overrided templates paths 2018-06-18 12:27:44 +02:00
Robin Chalas
28d754db2c Merge branch '4.0'
* 4.0:
  Fix merge
  [HttpKernel] Fix resetting DumpDataCollector::$isCollected
  [Framework][Workflow] Added support for interfaces
2018-06-18 11:32:54 +02:00
Robin Chalas
15c0d48277 Merge branch '4.0' into 4.1
* 4.0:
  Fix merge
  [HttpKernel] Fix resetting DumpDataCollector::$isCollected
  [Framework][Workflow] Added support for interfaces
2018-06-18 11:31:19 +02:00
Robin Chalas
57fc15bde6 Merge branch '3.4' into 4.0
* 3.4:
  Fix merge
  [HttpKernel] Fix resetting DumpDataCollector::$isCollected
  [Framework][Workflow] Added support for interfaces
2018-06-18 11:30:06 +02:00
Robin Chalas
13e983a127 Fix merge 2018-06-18 11:28:47 +02:00
Nicolas Grekas
866420e2eb [Cache] serialize objects using native arrays when possible 2018-06-18 10:20:36 +02:00
Oskar Stark
1df7742345 [FrameworkBundle] show public/private for aliases in debug:container command 2018-06-17 22:04:46 +02:00
Nicolas Grekas
4cec0e1260 [HttpKernel] Fix resetting DumpDataCollector::$isCollected 2018-06-16 10:35:33 +02:00
Fabien Potencier
50f2ed768a bug #27596 [Framework][Workflow] Added support for interfaces (vudaltsov)
This PR was squashed before being merged into the 3.4 branch (closes #27596).

Discussion
----------

[Framework][Workflow] Added support for interfaces

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

I consider this to be a bugfix in config, because `ClassInstanceSupportStrategy` (`InstanceOfSupportStrategy`) actually works with interfaces. Therefore propose to 3.4.

Commits
-------

6104c28c08 [Framework][Workflow] Added support for interfaces
2018-06-15 15:02:39 +02:00
Valentin Udaltsov
6104c28c08 [Framework][Workflow] Added support for interfaces 2018-06-15 15:02:31 +02:00
Nicolas Grekas
92a2d4754f [Cache] Improve perf of array-based pools 2018-06-15 11:22:35 +02:00
Nicolas Grekas
3ccbec3497 Merge branch '4.1'
* 4.1:
  fix merge
2018-06-15 10:20:40 +02:00
Nicolas Grekas
6e0818db16 fix merge 2018-06-15 10:15:34 +02:00
Nicolas Grekas
719b429655 fix merge 2018-06-15 10:13:37 +02:00
Nicolas Grekas
a687119e10 Merge branch '4.1'
* 4.1:
  remove HHVM code
  [VarDumper] Fix dumping ArrayObject and ArrayIterator instances
  [ProxyManagerBridge] Fixed support of private services
  [Cache] Fix typo in comment.
  [FrameworkBundle] give access to non-shared services when using test.service_container
  Fix bad method call with guard authentication + session migration
  Avoid calling eval when there is no script embedded in the toolbar
2018-06-15 09:52:48 +02:00
Nicolas Grekas
f658ed6d17 Merge branch '4.0' into 4.1
* 4.0:
  remove HHVM code
  [VarDumper] Fix dumping ArrayObject and ArrayIterator instances
  [ProxyManagerBridge] Fixed support of private services
  [Cache] Fix typo in comment.
  Fix bad method call with guard authentication + session migration
2018-06-15 09:52:42 +02:00
Nicolas Grekas
aa432743f5 remove HHVM code 2018-06-15 09:52:13 +02:00
Nicolas Grekas
79b804fdb7 Merge branch '3.4' into 4.0
* 3.4:
  [VarDumper] Fix dumping ArrayObject and ArrayIterator instances
  [ProxyManagerBridge] Fixed support of private services
  [Cache] Fix typo in comment.
  Fix bad method call with guard authentication + session migration
2018-06-15 09:50:28 +02:00
Nicolas Grekas
be700aed1d Merge branch '2.8' into 3.4
* 2.8:
  [VarDumper] Fix dumping ArrayObject and ArrayIterator instances
  Fix bad method call with guard authentication + session migration
2018-06-15 09:47:49 +02:00
Nicolas Grekas
2627c16d0b bug #27591 [VarDumper] Fix dumping ArrayObject and ArrayIterator instances (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

[VarDumper] Fix dumping ArrayObject and ArrayIterator instances

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Properties added on child classes of `ArrayObject` and `ArrayIterator`, or dynamic properties added on instances of them were now properly dumped. This fixes it.

![image](https://user-images.githubusercontent.com/243674/41349429-2660cbc6-6f10-11e8-8015-a3d6ad8b0c9c.png)

Commits
-------

3ecabfc36e [VarDumper] Fix dumping ArrayObject and ArrayIterator instances
2018-06-15 08:50:57 +02:00
Nicolas Grekas
ffa79bacc1 bug #27528 [FrameworkBundle] give access to non-shared services when using test.service_container (nicolas-grekas)
This PR was merged into the 4.1 branch.

Discussion
----------

[FrameworkBundle] give access to non-shared services when using test.service_container

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27488
| License       | MIT
| Doc PR        | -

Commits
-------

516ff5a985 [FrameworkBundle] give access to non-shared services when using test.service_container
2018-06-15 08:49:43 +02:00
Nicolas Grekas
3ecabfc36e [VarDumper] Fix dumping ArrayObject and ArrayIterator instances 2018-06-15 08:44:46 +02:00
benoushnorouzi
32988b4294 Enhance the twig not found exception
Enhance the twig not found exception
2018-06-14 14:22:04 +02:00
Nicolas Grekas
198bee0916 [ProxyManagerBridge] Fixed support of private services 2018-06-14 12:06:05 +02:00
Sepehr Lajevardi
39dd9b2f97 [Cache] Fix typo in comment. 2018-06-14 10:53:02 +02:00
Nicolas Grekas
516ff5a985 [FrameworkBundle] give access to non-shared services when using test.service_container 2018-06-14 10:43:49 +02:00
Fabien Potencier
b560883ffe feature #27315 [TwigBundle] add exception chain breadcrumbs navigation (kiler129)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[TwigBundle] add exception chain breadcrumbs navigation

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #26824
| License       | MIT
| Doc PR        | -

Small DX improvement allowing to jump to exception in chain:
![preview](https://media.giphy.com/media/23chfZo9oFzdOrZzYl/giphy.gif)

Commits
-------

5551e0c091 feature #26824 add exception chain breadcrumbs navigation
2018-06-14 07:06:08 +02:00
Rhodri Pugh
473a025643 add property path to exception message when error writing property 2018-06-12 16:19:40 +01:00
Ryan Weaver
2c0ac93e25 Fix bad method call with guard authentication + session migration 2018-06-12 15:17:58 +02:00
Christophe Coevoet
a0f78a5e0b Avoid calling eval when there is no script embedded in the toolbar 2018-06-12 14:15:08 +02:00
Nicolas Grekas
5c338cc7ab Merge branch '4.1'
* 4.1:
  fix typo
2018-06-11 16:42:15 +02:00
Nicolas Grekas
413af69e1d fix typo 2018-06-11 16:41:45 +02:00
Nicolas Grekas
c997026c91 Merge branch '4.1'
* 4.1:
  fix typo
2018-06-11 16:29:18 +02:00
Nicolas Grekas
fc666f0d80 fix typo 2018-06-11 16:29:01 +02:00
Nicolas Grekas
dca80ff177 Merge branch '4.1'
* 4.1:
  [Serializer] fix CS
  [Cache] Fix expiry comparisons in array-based pools
2018-06-11 16:10:14 +02:00
Nicolas Grekas
c1ba38ed47 Merge branch '4.0' into 4.1
* 4.0:
  [Serializer] fix CS
  [Cache] Fix expiry comparisons in array-based pools
2018-06-11 16:09:24 +02:00
Nicolas Grekas
b7d04a8f59 Merge branch '3.4' into 4.0
* 3.4:
  [Cache] Fix expiry comparisons in array-based pools
2018-06-11 16:09:09 +02:00
Nicolas Grekas
e564c70772 bug #27576 [Cache] Fix expiry comparisons in array-based pools (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] Fix expiry comparisons in array-based pools

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

68729cc68a [Cache] Fix expiry comparisons in array-based pools
2018-06-11 16:08:45 +02:00
Nicolas Grekas
f470afacd8 Merge branch '3.4' into 4.0
* 3.4:
  [Serializer] fix CS
2018-06-11 15:58:06 +02:00
Nicolas Grekas
24b6848ea7 [Serializer] fix CS 2018-06-11 15:57:31 +02:00
Nicolas Grekas
90afbf73ac Merge branch '4.1'
* 4.1:
  fix deps
  fixed CS
  [FrameworkBundle] fix for allowing single colon controller notation
2018-06-11 15:22:42 +02:00
Nicolas Grekas
66601613b2 Merge branch '4.0' into 4.1
* 4.0:
  fix deps
2018-06-11 15:22:23 +02:00
Nicolas Grekas
9dc1875780 Merge branch '3.4' into 4.0
* 3.4:
  fix deps
2018-06-11 15:21:24 +02:00
Nicolas Grekas
14bbcdb496 fix deps 2018-06-11 15:18:57 +02:00
Fabien Potencier
205d161c00 feature #27031 [Cache] Use sub-second accuracy for internal expiry calculations (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Cache] Use sub-second accuracy for internal expiry calculations

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | not really
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Embeds #26929, #27009 and #27028, let's focus on the 4th commit for now.

This is my last significant PR in the Cache series :)

By using integer expiries internally, our current implementations are sensitive to abrupt transitions when time() goes to next second: `$s = time(); sleep(1); echo time() - $s;` *can* display 2 from time to time.
This means that we do expire items earlier than required by the expiration settings on items.
This also means that there is no way to have a sub-second expiry. For remote backends, that's fine, but for ArrayAdapter, that's a limitation we can remove.

This PR replaces calls to `time()` by `microtime(true)`, providing more accurate timing measurements internally.

Commits
-------

08554ea18c [Cache] Use sub-second accuracy for internal expiry calculations
2018-06-11 15:14:37 +02:00
Fabien Potencier
8b72a6cb20 fixed CS 2018-06-11 15:11:40 +02:00
Fabien Potencier
cfb1ffb869 bug #27566 [FrameworkBundle] fix for allowing single colon controller notation (dmaicher)
This PR was merged into the 4.1 branch.

Discussion
----------

[FrameworkBundle] fix for allowing single colon controller notation

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27522
| License       | MIT
| Doc PR        | -

This fixes a BC break introduced in https://github.com/symfony/symfony/pull/26085#pullrequestreview-126370222.

ping @Tobion

Commits
-------

1680674174 [FrameworkBundle] fix for allowing single colon controller notation
2018-06-11 15:11:00 +02:00
Nicolas Grekas
68729cc68a [Cache] Fix expiry comparisons in array-based pools 2018-06-11 15:10:52 +02:00
Nicolas Grekas
169b13c348 Merge branch '4.1'
* 4.1:
  fixed CS
  Avoiding session migration for stateless firewall UsernamePasswordJsonAuthenticationListener
  fixed CS
  Avoid migration on stateless firewalls
  [Serializer] deserialize from xml: Fix a collection that contains the only one element
  [HttpKernel] Log/Collect exceptions at prio 0
  [PhpUnitBridge] Fix error on some Windows OS
  [DI] Deduplicate generated proxy classes
  [Routing] fix matching host patterns, utf8 prefixes and non-capturing groups
2018-06-11 14:56:48 +02:00
Nicolas Grekas
8bbda2c82b Merge branch '4.0' into 4.1
* 4.0:
  fixed CS
  Avoiding session migration for stateless firewall UsernamePasswordJsonAuthenticationListener
  fixed CS
  Avoid migration on stateless firewalls
  [Serializer] deserialize from xml: Fix a collection that contains the only one element
  [PhpUnitBridge] Fix error on some Windows OS
  [DI] Deduplicate generated proxy classes
2018-06-11 14:56:28 +02:00
Nicolas Grekas
e540a16f24 Merge branch '3.4' into 4.0
* 3.4:
  fixed CS
  Avoiding session migration for stateless firewall UsernamePasswordJsonAuthenticationListener
  fixed CS
  Avoid migration on stateless firewalls
  [Serializer] deserialize from xml: Fix a collection that contains the only one element
  [PhpUnitBridge] Fix error on some Windows OS
  [DI] Deduplicate generated proxy classes
2018-06-11 14:55:40 +02:00
Nicolas Grekas
873abdad12 Merge branch '2.8' into 3.4
* 2.8:
  fixed CS
  Avoid migration on stateless firewalls
2018-06-11 14:53:53 +02:00
Nicolas Grekas
08554ea18c [Cache] Use sub-second accuracy for internal expiry calculations 2018-06-11 14:32:29 +02:00
Nicolas Grekas
51381e530a [Cache] Unconditionally use PhpFilesAdapter for system pools 2018-06-11 09:57:54 +02:00
Fabien Potencier
7e3b7b0b50 feature #27009 [Cache] Add stampede protection via probabilistic early expiration (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Cache] Add stampede protection via probabilistic early expiration

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        |

This PR implements [probabilistic early expiration](https://en.wikipedia.org/wiki/Cache_stampede#Probabilistic_early_expiration) on top of `$cache->get($key, $callback);`

It adds a 3rd arg to `CacheInterface::get`:
> float $beta A float that controls the likelyness of triggering early expiration. 0 disables it, INF forces immediate expiration. The default is implementation dependend but should typically be 1.0, which should provide optimal stampede protection.

Commits
-------

13523ad985 [Cache] Add stampede protection via probabilistic early expiration
2018-06-11 09:05:59 +02:00
Nicolas Grekas
13523ad985 [Cache] Add stampede protection via probabilistic early expiration 2018-06-10 18:44:41 +02:00
Fabien Potencier
697a6a0ae4 fixed CS 2018-06-10 12:33:24 +02:00
Fabien Potencier
f96f4c5ab5 bug #27556 Avoiding session migration for stateless firewall UsernamePasswordJsonAuthenticationListener (weaverryan)
This PR was squashed before being merged into the 3.4 branch (closes #27556).

Discussion
----------

Avoiding session migration for stateless firewall UsernamePasswordJsonAuthenticationListener

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | Related to #27395
| License       | MIT
| Doc PR        | symfony/symfony-docs#9860

This is the sister PR to #27452, which covered all the other authentication listeners.

Commits
-------

c06f3229de Avoiding session migration for stateless firewall UsernamePasswordJsonAuthenticationListener
2018-06-10 12:32:37 +02:00
Ryan Weaver
c06f3229de Avoiding session migration for stateless firewall UsernamePasswordJsonAuthenticationListener 2018-06-10 12:32:26 +02:00
Fabien Potencier
5c2b2bb2ce fixed CS 2018-06-10 12:30:11 +02:00
Fabien Potencier
d2757de3b9 bug #27452 Avoid migration on stateless firewalls (weaverryan)
This PR was squashed before being merged into the 2.8 branch (closes #27452).

Discussion
----------

Avoid migration on stateless firewalls

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | Related to #27395
| License       | MIT
| Doc PR        | symfony/symfony-docs#9860

This is a proof-of-concept. Once we agree / are happy, I need to add this to all of the other authentication mechanisms that recently got the session migration code & add tests.

Basically, this avoids migrating the session if the firewall is stateless. There were 2 options to do this:

A) Make the `SessionAuthenticationStrategy` aware of all stateless firewalls. **This is the current approach**
or
B) Make each individual authentication listener aware whether or not *its* firewall is stateless.

Commits
-------

cca73bb564 Avoid migration on stateless firewalls
2018-06-10 12:27:47 +02:00
Ryan Weaver
cca73bb564 Avoid migration on stateless firewalls 2018-06-10 12:27:33 +02:00
Fabien Potencier
f36930f21e bug #27568 [DI] Deduplicate generated proxy classes (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Deduplicate generated proxy classes

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27537
| License       | MIT
| Doc PR        | -

Commits
-------

322f58b334 [DI] Deduplicate generated proxy classes
2018-06-10 12:04:52 +02:00
Fabien Potencier
836f1216a3 bug #27511 [Routing] fix matching host patterns, utf8 prefixes and non-capturing groups (nicolas-grekas)
This PR was merged into the 4.1 branch.

Discussion
----------

[Routing] fix matching host patterns, utf8 prefixes and non-capturing groups

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27448, #27461, #27504, #27512
| License       | MIT
| Doc PR        | -

Commits
-------

465b15caa8 [Routing] fix matching host patterns, utf8 prefixes and non-capturing groups
2018-06-10 11:55:51 +02:00
Fabien Potencier
ac70edf8cd bug #27326 [Serializer] deserialize from xml: Fix a collection that contains the only one element (webnet-fr)
This PR was squashed before being merged into the 3.4 branch (closes #27326).

Discussion
----------

[Serializer] deserialize from xml: Fix a collection that contains the only one element

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27279
| License       | MIT
| Doc PR        |

In xml when parent node (`restaurants`) contains several children nodes with the same tag (`restaurant`) it is clear that the children form a collection:

```
restaurants = {array} [1]
 restaurant = {array} [2]
  0 = {array} [2]
   name = "Some restaurant name"
   type = "Chinese"
  1 = {array} [2]
   name = "Another restaurant name"
   type = "Italian"
```

Afterwards the object denormalizer has no problem to create a collection of restaurants.

But when there is only one child (`restaurant`) the decoded normalized array will not contain a collection:

```
restaurants = {array} [1]
 restaurant = {array} [2]
  name = "Some restaurant name"
  type = "Chinese"
```

In this situation the object denormalizer threw unexpected exception. This PR modifies `AbstractObjectNormalizer` that is it will fill a collection containing the sole element properly.

Commits
-------

1f346f446d [Serializer] deserialize from xml: Fix a collection that contains the only one element
2018-06-10 11:53:47 +02:00
Webnet team
1f346f446d [Serializer] deserialize from xml: Fix a collection that contains the only one element 2018-06-10 11:53:40 +02:00
Roland Franssen
85b832bcc9 [HttpKernel] Log/Collect exceptions at prio 0 2018-06-10 11:25:14 +02:00
nsbx
50979b5ea4 [PhpUnitBridge] Fix error on some Windows OS 2018-06-10 09:25:02 +02:00
Nicolas Grekas
322f58b334 [DI] Deduplicate generated proxy classes 2018-06-09 21:22:19 +02:00
David Maicher
1680674174 [FrameworkBundle] fix for allowing single colon controller notation 2018-06-09 14:38:46 +02:00
Nicolas Grekas
84ada0c0c1 Merge branch '4.1'
* 4.1:
  [FrameworkBundle] decouple some cache-warmer's test from internal details
  bug #27405 [Cache] TagAwareAdapter should not corrupt memcached connection in ascii mode
  Remove released semaphore
2018-06-09 00:51:43 +02:00
Nicolas Grekas
28af1a62d1 Merge branch '4.0' into 4.1
* 4.0:
  [FrameworkBundle] decouple some cache-warmer's test from internal details
  bug #27405 [Cache] TagAwareAdapter should not corrupt memcached connection in ascii mode
  Remove released semaphore
2018-06-09 00:51:37 +02:00
Nicolas Grekas
a250e67097 Merge branch '3.4' into 4.0
* 3.4:
  [FrameworkBundle] decouple some cache-warmer's test from internal details
  bug #27405 [Cache] TagAwareAdapter should not corrupt memcached connection in ascii mode
  Remove released semaphore
2018-06-09 00:51:16 +02:00
Nicolas Grekas
7f2cb7361a bug #27357 [Lock] Remove released semaphore (jderusse)
This PR was merged into the 3.4 branch.

Discussion
----------

[Lock] Remove released semaphore

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27356
| License       | MIT
| Doc PR        | NA

This PR remove the semaphore with `sem_remove`. By removing without releasing the semaphore, all pending blocking acquiring will fail that's why the acquire method has also been update to handle such case

Commits
-------

77b9f90a32 Remove released semaphore
2018-06-09 00:46:17 +02:00
Nicolas Grekas
88098f3cba bug #27416 TagAwareAdapter over non-binary memcached connections corrupts memcache (Aleksey Prilipko)
This PR was merged into the 3.4 branch.

Discussion
----------

TagAwareAdapter over non-binary memcached connections corrupts memcache

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no
| Fixed tickets | #27405
| License       | MIT
| Doc PR        |

TagAwareAdapter uses non-ascii symbols in key names. It breaks memcached connections in non-binary mode.

Commits
-------

67d4e6dd29 bug #27405 [Cache] TagAwareAdapter should not corrupt memcached connection in ascii mode
2018-06-09 00:45:16 +02:00
Nicolas Grekas
847abd3ec9 [FrameworkBundle] decouple some cache-warmer's test from internal details 2018-06-09 00:30:30 +02:00
Nicolas Grekas
1b2bd8f419 Merge branch '4.1'
* 4.1:
  [Cache][Security] Use Throwable where possible
  revert #27545
  Update Finder.php
  [FrameworkBundle] remove dead code in CachePoolClearerPass
  Fix security-core cross-dependencies, fixes #27507
  Pass previous exception to FatalErrorException
2018-06-08 11:40:00 +02:00
Nicolas Grekas
302b0d41ee Merge branch '4.0' into 4.1
* 4.0:
  [Cache][Security] Use Throwable where possible
  revert #27545
  Update Finder.php
  [FrameworkBundle] remove dead code in CachePoolClearerPass
  Fix security-core cross-dependencies, fixes #27507
  Pass previous exception to FatalErrorException
2018-06-08 11:39:36 +02:00
Nicolas Grekas
ca48f4c0f0 Merge branch '3.4' into 4.0
* 3.4:
  revert #27545
  Update Finder.php
  [FrameworkBundle] remove dead code in CachePoolClearerPass
  Fix security-core cross-dependencies, fixes #27507
  Pass previous exception to FatalErrorException
2018-06-08 11:39:19 +02:00
Nicolas Grekas
9586c4334e Merge branch '2.8' into 3.4
* 2.8:
  revert #27545
  Update Finder.php
  Fix security-core cross-dependencies, fixes #27507
  Pass previous exception to FatalErrorException
2018-06-08 11:38:38 +02:00
Nicolas Grekas
9786ec8e19 [Cache][Security] Use Throwable where possible 2018-06-08 11:29:49 +02:00
Nicolas Grekas
465b15caa8 [Routing] fix matching host patterns, utf8 prefixes and non-capturing groups 2018-06-08 10:42:17 +02:00
Christian Flothmann
8fd4b441c4 revert #27545
The SplFileInfo class indeed does exist in the Symfony\Component\Finder
namespace.
2018-06-08 09:55:24 +02:00
Fabien Potencier
e2effa3141 minor #27532 Fix security-core cross-dependencies, fixes #27507 (stephank)
This PR was merged into the 2.8 branch.

Discussion
----------

Fix security-core cross-dependencies, fixes #27507

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27507
| License       | MIT
| Doc PR        | -

Based on earlier changes in #27295

Commits
-------

725d774a16 Fix security-core cross-dependencies, fixes #27507
2018-06-08 08:37:32 +02:00
Nyholm
b79f38c364 [WebServerBundle] Improve the error message when web server is already running 2018-06-08 08:35:42 +02:00
Tarmo Leppänen
a74ee8d594 Update Finder.php
Corrected return type which causes following error with (psalm)[https://getpsalm.org/]
```
ERROR: PossiblyInvalidArgument - src/Command/Utils/CheckVendorDependencies.php:170:62 - Argument 1 of iterator_to_array expects Traversable, possibly different type array<mixed, Symfony\Component\Finder\SplFileInfo>|Iterator provided $directories = array_map($closure, iterator_to_array($finder->getIterator()));
```
2018-06-07 23:32:28 +02:00
Nicolas Grekas
974991f8c6 [FrameworkBundle] remove dead code in CachePoolClearerPass 2018-06-07 23:05:52 +02:00
Stéphan Kochen
725d774a16 Fix security-core cross-dependencies, fixes #27507 2018-06-07 10:54:04 +02:00
Fabien Potencier
ae30a80f77 bug #27514 [Debug] Pass previous exception to FatalErrorException (pmontoya)
This PR was merged into the 2.8 branch.

Discussion
----------

[Debug] Pass previous exception to FatalErrorException

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27483
| License       | MIT

Add a previous parameter to FatalErrorException.
Call \ErrorException with this parameter.
Update parent::__constructor for inherited classes with default parameters and the new one

Commits
-------

7f9780b5df Pass previous exception to FatalErrorException
2018-06-06 15:30:44 +02:00
Nicolas Grekas
50c4384caf Merge branch '4.1'
* 4.1:
  Revert "bug #26138 [HttpKernel] Catch HttpExceptions when templating is not installed (cilefen)"
2018-06-06 12:57:26 +02:00
Nicolas Grekas
72f7ac0441 Merge branch '4.0' into 4.1
* 4.0:
  Revert "bug #26138 [HttpKernel] Catch HttpExceptions when templating is not installed (cilefen)"
2018-06-06 12:57:03 +02:00
Nicolas Grekas
59cd2777cb Merge branch '3.4' into 4.0
* 3.4:
  Revert "bug #26138 [HttpKernel] Catch HttpExceptions when templating is not installed (cilefen)"
2018-06-06 12:52:25 +02:00
Nicolas Grekas
4435144a24 bug #27516 Revert "bug #26138 [HttpKernel] Catch HttpExceptions when templating is not installed (cilefen)" (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

Revert "bug #26138 [HttpKernel] Catch HttpExceptions when templating is not installed (cilefen)"

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27212
| License       | MIT
| Doc PR        | -

This reverts commit b213c5a758, reversing
changes made to 61af0e3a25.

This breaks BC and is more like a new feature, let's move this on master.

Commits
-------

c6acad719d Revert "bug #26138 [HttpKernel] Catch HttpExceptions when templating is not installed (cilefen)"
2018-06-06 12:47:46 +02:00
Nicolas Grekas
8ec22e5e88 Merge branch '4.1'
* 4.1:
  [FrameworkBundle] Fix test-container on kernel reboot, revert to returning the real container from Client::getContainer()
  Remove mentions of "beta" in composer.json files
  [DI] Ignore missing tree root nodes on validate
  [WebProfilerBundle] fixed getSession when no session has been set deprecation warnings
  bug #27299 [Cache] memcache connect should not add duplicate entries on sequential calls
  [Router] regression when matching a route
  [FrameworkBundle][SecurityBundle] Remove no-longer necessary Bundle::registerCommands override
  [Routing] Don't reorder past variable-length placeholders
  [DebugBundle] DebugBundle::registerCommands should be noop
  [BrowserKit] Fix a BC break in Client affecting Panthère
  [DX] Improve exception message when AbstractController::getParameter fails
  simple-phpunit: remove outdated appveryor workaround
2018-06-06 11:59:09 +02:00
Nicolas Grekas
c9118b9f29 Merge branch '4.0' into 4.1
* 4.0:
  Remove mentions of "beta" in composer.json files
  bug #27299 [Cache] memcache connect should not add duplicate entries on sequential calls
  simple-phpunit: remove outdated appveryor workaround
2018-06-06 11:58:49 +02:00
Nicolas Grekas
b99a5a4926 Merge branch '3.4' into 4.0
* 3.4:
  Remove mentions of "beta" in composer.json files
  bug #27299 [Cache] memcache connect should not add duplicate entries on sequential calls
  simple-phpunit: remove outdated appveryor workaround
2018-06-06 11:57:47 +02:00
Nicolas Grekas
51f36e73a0 Merge branch '2.8' into 3.4
* 2.8:
  Remove mentions of "beta" in composer.json files
2018-06-06 11:56:41 +02:00
Nicolas Grekas
c6acad719d Revert "bug #26138 [HttpKernel] Catch HttpExceptions when templating is not installed (cilefen)"
This reverts commit b213c5a758, reversing
changes made to 61af0e3a25.
2018-06-06 11:42:07 +02:00
Pascal Montoya
7f9780b5df
Pass previous exception to FatalErrorException 2018-06-06 10:34:52 +02:00
Fabien Potencier
6770630cee bug #27501 [FrameworkBundle] Fix test-container on kernel reboot, revert to returning the real container from Client::getContainer() (nicolas-grekas)
This PR was merged into the 4.1 branch.

Discussion
----------

[FrameworkBundle] Fix test-container on kernel reboot, revert to returning the real container from Client::getContainer()

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | yes
| New feature?  | -
| BC breaks?    | yes
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27494
| License       | MIT
| Doc PR        | -

By making `Client::getContainer()` return the new test container, we broke BC, as spotted in linked issue.

Always use `static::$container` in your tests instead.

While reverting to returning the real container, I noticed we have a serious design issue in the way the test container currently works: because the kernel can be rebooted, we cannot inject the container directly, but have to go through the kernel all the time. Fixing this forces doing a BC break on the constructor of `TestContainer`. Since this is a new class and since it's mostly internal, I think we should do it now. I've marked the class as internal to further strengthen this.

Commits
-------

6764d4e012 [FrameworkBundle] Fix test-container on kernel reboot, revert to returning the real container from Client::getContainer()
2018-06-06 10:11:09 +02:00
Thomas Perez
f03b8bba9d CacheWarmerAggregate handle deprecations logs 2018-06-06 00:11:23 +02:00
Tobias Schultze
d8739d183e feature #27471 [DI] Improve performance of removing/inlining passes (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[DI] Improve performance of removing/inlining passes

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #27386
| License       | MIT
| Doc PR        | -

Here is an optimization to reclaim some compilation time by optimizing the analysis of unused and inlined services.

This PR removes any use case for `RepeatedPass`, instead:
- `RemoveUnusedDefinitionsPass` works in one run, removing all private services that are unreachable from public services
-  `InlineServiceDefinitionsPass` reduces the number of nodes to analyze per iteration using `AnalyzeServiceReferencesPass` on a duplicated container internally.

https://blackfire.io/profiles/compare/00723822-6c09-431c-b98d-4a4197d044fc/graph?settings%5Bdimension%5D=wt&settings%5Bdisplay%5D=focused&settings%5BtabPane%5D=nodes&selected=Symfony%5CComponent%5CDependencyInjection%5CCompiler%5CRepeatedPass%3A%3Aprocess&callname=Symfony%5CComponent%5CDependencyInjection%5CCompiler%5CRepeatedPass%3A%3Aprocess

![image](https://user-images.githubusercontent.com/243674/40884496-c31e780e-6714-11e8-8218-967c4b25b9ce.png)

Commits
-------

cf375e5286 [DI] Improve performance of removing/inlining passes
2018-06-05 21:28:56 +02:00
Nicolas Grekas
6764d4e012 [FrameworkBundle] Fix test-container on kernel reboot, revert to returning the real container from Client::getContainer() 2018-06-05 15:25:09 +02:00
Nicolas Grekas
cf375e5286 [DI] Improve performance of removing/inlining passes 2018-06-05 13:59:51 +02:00
Nicolas Grekas
6a0b75fb9b Remove mentions of "beta" in composer.json files 2018-06-05 10:24:18 +02:00
Aleksey Prilipko
67d4e6dd29 bug #27405 [Cache] TagAwareAdapter should not corrupt memcached connection in ascii mode 2018-06-05 17:08:01 +10:00
Jérémy Derussé
77b9f90a32
Remove released semaphore 2018-06-05 07:35:41 +02:00
Fabien Potencier
8130f22f4a bug #27472 [DI] Ignore missing tree root nodes on validate (ro0NL)
This PR was squashed before being merged into the 4.1 branch (closes #27472).

Discussion
----------

[DI] Ignore missing tree root nodes on validate

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | yes
| New feature?  | technically yes
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #27450
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
 - Bug fixes must be submitted against the lowest 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 the master branch.
-->

Commits
-------

b3cdfc64b5 [DI] Ignore missing tree root nodes on validate
2018-06-05 07:03:36 +02:00
Roland Franssen
b3cdfc64b5 [DI] Ignore missing tree root nodes on validate 2018-06-05 07:03:28 +02:00
Fabien Potencier
4cd64771c9 minor #27481 [DI] Don't generate factories for errored services (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[DI] Don't generate factories for errored services

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Spotted while comparing the dumped container of Blackfire with Symfony 4.0 vs 4.1.

Commits
-------

a6b6206a62 [DI] Don't generate factories for errored services
2018-06-05 06:56:14 +02:00
Nicolas Grekas
4f197a5512 feature #27462 [FrameworkBundle] Deprecate auto-injection of the container in AbstractController instances (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[FrameworkBundle] Deprecate auto-injection of the container in AbstractController instances

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Should enhance DX by preventing situations like #27436.

Commits
-------

e2f344fa32 [FrameworkBundle] Deprecate auto-injection of the container in AbstractController instances
2018-06-04 23:09:49 +02:00
Greg ORIOL
0f3ba5a57d [WebProfilerBundle] fixed getSession when no session has been set deprecation warnings 2018-06-04 22:59:51 +02:00
Aleksey Prilipko
af0699012a bug #27299 [Cache] memcache connect should not add duplicate entries on sequential calls 2018-06-04 22:06:44 +02:00
Nicolas Grekas
fa022f05be feature #27077 [DependencyInjection] add ServiceSubscriberTrait (kbond)
This PR was squashed before being merged into the 4.2-dev branch (closes #27077).

Discussion
----------

[DependencyInjection] add ServiceSubscriberTrait

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #23898
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/9809

This allows you to easily configure Service Subscribers with the following convention:

```php
class MyService implements ServiceSubscriberInterface
{
    use ServiceSubscriberTrait;

    public function doSomething()
    {
        // $this->router() ...
    }

    private function router(): RouterInterface
    {
        return $this->container->get(__METHOD__);
    }
}
```

This also allows you to create helper traits like `RouterAware`, `LoggerAware` etc... and compose your services with them (*not* using `__METHOD__` in traits because it doesn't behave as expected.).

```php
trait LoggerAware
{
    private function logger(): LoggerInterface
    {
        return $this->container->get(__CLASS__.'::'.__FUNCTION__);
    }
}
```

```php
trait RouterAware
{
    private function router(): RouterInterface
    {
        return $this->container->get(__CLASS__.'::'.__FUNCTION__);
    }
}
```

```php
class MyService implements ServiceSubscriberInterface
{
    use ServiceSubscriberTrait, LoggerAware, RouterAware;

    public function doSomething()
    {
        // $this->router() ...
        // $this->logger() ...
    }
}
```

Commits
-------

238e793431 [DependencyInjection] add ServiceSubscriberTrait
2018-06-04 21:55:57 +02:00
Kevin Bond
238e793431 [DependencyInjection] add ServiceSubscriberTrait 2018-06-04 21:55:50 +02:00
Nicolas Grekas
a6b6206a62 [DI] Don't generate factories for errored services 2018-06-04 21:50:03 +02:00
Nicolas Grekas
2521e7ba81 bug #27498 [Routing] Don't reorder past variable-length placeholders (nanocom, nicolas-grekas)
This PR was merged into the 4.1 branch.

Discussion
----------

[Routing] Don't reorder past variable-length placeholders

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no
| Fixed tickets | #27491
| License       | MIT

Commits
-------

44616d9bcc [Router] regression when matching a route
7a750d4508 [Routing] Don't reorder past variable-length placeholders
2018-06-04 21:26:49 +02:00
Nicolas Grekas
7605706329 bug #27496 [DebugBundle] DebugBundle::registerCommands should be noop (ogizanagi)
This PR was merged into the 4.1 branch.

Discussion
----------

[DebugBundle] DebugBundle::registerCommands should be noop

| Q             | A
| ------------- | ---
| Branch?       | 4.1 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #27493   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

Commits
-------

dd4b0edb22 [DebugBundle] DebugBundle::registerCommands should be noop
2018-06-04 21:25:20 +02:00
Nicolas Grekas
cc0320f1e1 minor #27497 [FrameworkBundle][SecurityBundle] Remove no-longer necessary Bundle::registerCommands override (ogizanagi)
This PR was merged into the 4.1 branch.

Discussion
----------

[FrameworkBundle][SecurityBundle] Remove no-longer necessary Bundle::registerCommands override

| Q             | A
| ------------- | ---
| Branch?       | 4.1 <!-- see below -->
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | N/A   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

These two bundles requires `symfony/http-kernel:^4.1` which already makes [`Bundle::registerCommands`](49ad34b78e/src/Symfony/Component/HttpKernel/Bundle/Bundle.php (L143-L145)) a noop.

Commits
-------

7c97846811 [FrameworkBundle][SecurityBundle] Remove no-longer necessary Bundle::registerCommands override
2018-06-04 21:23:39 +02:00
Arnaud Kleinpeter
44616d9bcc [Router] regression when matching a route 2018-06-04 19:55:59 +02:00
Maxime Steinhausser
7c97846811 [FrameworkBundle][SecurityBundle] Remove no-longer necessary Bundle::registerCommands override 2018-06-04 19:55:59 +02:00
Nicolas Grekas
7a750d4508 [Routing] Don't reorder past variable-length placeholders 2018-06-04 19:55:59 +02:00
Maxime Steinhausser
dd4b0edb22 [DebugBundle] DebugBundle::registerCommands should be noop 2018-06-04 19:45:48 +02:00
Fabien Potencier
49ad34b78e bug #27485 [BrowserKit] Fix a BC break in Client affecting Panthère (dunglas)
This PR was squashed before being merged into the 4.1 branch (closes #27485).

Discussion
----------

[BrowserKit] Fix a BC break in Client affecting Panthère

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | dunglas/panthere#25
| License       | MIT
| Doc PR        | n/a

Commits
-------

e3aa90f852 [BrowserKit] Fix a BC break in Client affecting Panthère
2018-06-04 19:32:02 +02:00
Kévin Dunglas
e3aa90f852 [BrowserKit] Fix a BC break in Client affecting Panthère 2018-06-04 19:31:56 +02:00
Nicolas Grekas
e2f344fa32 [FrameworkBundle] Deprecate auto-injection of the container in AbstractController instances 2018-06-04 13:21:25 +02:00
Robin Chalas
9660103ff1 minor #27443 [DX] Improve exception message when AbstractController::getParameter fails (curry684)
This PR was squashed before being merged into the 4.1 branch (closes #27443).

Discussion
----------

[DX] Improve exception message when AbstractController::getParameter fails

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | no (DX)
| New feature?  | no
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #27436
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Improve exception message for situations where the `parameter_bag` is not present in `AbstractController`. Also fixed the exception to the correct type.

Commits
-------

a8f4128 [DX] Improve exception message when AbstractController::getParameter fails
2018-06-04 11:10:04 +02:00
Niels Keurentjes
a8f41289c4 [DX] Improve exception message when AbstractController::getParameter fails 2018-06-04 11:10:01 +02:00
Nicolas Grekas
b51b17d7e8 Merge branch '4.1'
* 4.1:
  [DI] Remove default env type check on validate
  [FrameworkBundle][TwigBridge] Fix BC break from strong dependency on CSRF token storage
2018-06-03 23:37:29 +02:00
Roland Franssen
a0015a18ec [DI] Remove default env type check on validate 2018-06-03 23:36:42 +02:00
Gabriel Ostrolucký
11a14e001c simple-phpunit: remove outdated appveryor workaround 2018-06-02 19:48:17 +02:00
Nicolas Grekas
146e01cb44 [HttpKernel] fix session tracking in surrogate master requests 2018-06-01 15:46:26 +02:00
Titouan Galopin
68994a662e [FrameworkBundle][TwigBridge] Fix BC break from strong dependency on CSRF token storage 2018-05-31 18:59:04 +02:00
Fabien Potencier
c81f88f38b feature #27398 [Cache] Remove TaggableCacheInterface, alias cache.app.taggable to CacheInterface (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Cache] Remove TaggableCacheInterface, alias cache.app.taggable to CacheInterface

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Actually, there is no downside in using a taggable cache pool as a backend for CacheInterface.
This means we can simplify things and remove the TaggableCacheInterface and keep only CacheInterface (master-only).

Commits
-------

c250fbdda0 [Cache] Remove TaggableCacheInterface, alias cache.app.taggable to CacheInterface
2018-05-31 16:26:45 +02:00
Yonel Ceruto
f8746ce8bd Add ability to deprecate options 2018-05-31 07:26:55 -04:00
Nicolas Grekas
5abffbbd07 Merge branch '4.1'
* 4.1: (22 commits)
  [HttpKernel] Fix restoring trusted proxies in tests
  Update UPGRADE-4.0.md
  [Messenger] Fix suggested enqueue adapter package
  bumped Symfony version to 4.1.1
  updated VERSION for 4.1.0
  updated CHANGELOG for 4.1.0
  Insert correct parameter_bag service in AbstractController
  Revert "feature #26702 Mark ExceptionInterfaces throwable (ostrolucky)"
  CODEOWNERS: some more rules
  removed unneeded comments in tests
  removed unneeded comments in tests
  Change PHPDoc in ResponseHeaderBag::getCookies() to help IDEs
  [HttpKernel] fix registering IDE links
  update UPGRADE-4.1 for feature #26332 Form field help option
  [HttpKernel] Set first trusted proxy as REMOTE_ADDR in InlineFragmentRenderer.
  [Process] Consider \"executable\" suffixes first on Windows
  Triggering RememberMe's loginFail() when token cannot be created
  bumped Symfony version to 4.1.0
  updated VERSION for 4.1.0-BETA3
  updated CHANGELOG for 4.1.0-BETA3
  ...
2018-05-31 12:18:23 +02:00
Nicolas Grekas
8bbd7389a3 Merge branch '4.0' into 4.1
* 4.0:
  [HttpKernel] Fix restoring trusted proxies in tests
  Update UPGRADE-4.0.md
  CODEOWNERS: some more rules
  removed unneeded comments in tests
  removed unneeded comments in tests
  Change PHPDoc in ResponseHeaderBag::getCookies() to help IDEs
  [HttpKernel] fix registering IDE links
  [HttpKernel] Set first trusted proxy as REMOTE_ADDR in InlineFragmentRenderer.
  [Process] Consider \"executable\" suffixes first on Windows
  Triggering RememberMe's loginFail() when token cannot be created
  [Serializer] Fix serializer tries to denormalize null values on nullable properties
  [FrameworkBundle] Change priority of AddConsoleCommandPass to TYPE_BEFORE_REMOVING
2018-05-31 12:17:53 +02:00
Nicolas Grekas
b2e93cfb8a Merge branch '3.4' into 4.0
* 3.4:
  [HttpKernel] Fix restoring trusted proxies in tests
  Update UPGRADE-4.0.md
  CODEOWNERS: some more rules
  removed unneeded comments in tests
  removed unneeded comments in tests
  Change PHPDoc in ResponseHeaderBag::getCookies() to help IDEs
  [HttpKernel] fix registering IDE links
  [HttpKernel] Set first trusted proxy as REMOTE_ADDR in InlineFragmentRenderer.
  [Process] Consider \"executable\" suffixes first on Windows
  Triggering RememberMe's loginFail() when token cannot be created
  [Serializer] Fix serializer tries to denormalize null values on nullable properties
  [FrameworkBundle] Change priority of AddConsoleCommandPass to TYPE_BEFORE_REMOVING
2018-05-31 12:16:04 +02:00
Nicolas Grekas
143bdfc073 Merge branch '2.8' into 3.4
* 2.8:
  [HttpKernel] Fix restoring trusted proxies in tests
  CODEOWNERS: some more rules
2018-05-31 12:13:22 +02:00
Nicolas Grekas
efe9beb186 [HttpKernel] Fix restoring trusted proxies in tests 2018-05-31 12:02:37 +02:00
Fabien Potencier
1356fe7b58 minor #27406 [Security] Add missing upgrade note about GuardAuthenticationListener-related deprecation (DonCallisto)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security] Add missing upgrade note about GuardAuthenticationListener-related deprecation

| Q             | A
| ------------- | ---
| Branch?       | 4.0
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   |
| Fixed tickets |
| License       | MIT
| Doc PR        |

This https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/Security/Guard/Firewall/GuardAuthenticationListener.php#L127 was not reported.

Commits
-------

c09ca94a28 Update UPGRADE-4.0.md
2018-05-31 09:38:11 +02:00
DonCallisto
c09ca94a28 Update UPGRADE-4.0.md
This https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/Security/Guard/Firewall/GuardAuthenticationListener.php#L127 was not reported.
2018-05-31 09:29:12 +02:00
Samuel ROZE
59375662a3 feature #27343 [Messenger][Profiler] Show dispatch caller (ogizanagi)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Messenger][Profiler] Show dispatch caller

| Q             | A
| ------------- | ---
| Branch?       | 4.2 <!-- see below -->
| Bug fix?      | no
| New feature?  | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | N/A  <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

Just something I missed on my checklist in the first PR:

![mai-22-2018 19-51-52](https://user-images.githubusercontent.com/2211145/40380514-a0ba3326-5df9-11e8-9dd6-82a42dc7ccae.gif)

Commits
-------

1c2f43f17c [Messenger][Profiler] Show dispatch caller
2018-05-31 09:25:34 +02:00
Fabien Potencier
c8ce780b9c feature #27429 [PropertyInfo] Auto-enable PropertyInfo component (sroze)
This PR was squashed before being merged into the 4.2-dev branch (closes #27429).

Discussion
----------

[PropertyInfo] Auto-enable PropertyInfo component

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ø
| License       | MIT
| Doc PR        | ø

The PropertyInfo component (used by the Serializer to provide more insights from PhpDocs, etc...) is disabled by default, not sure why. This enables it by default when the component is installed.

Commits
-------

06ea72e3b2 [PropertyInfo] Auto-enable PropertyInfo component
2018-05-31 07:58:01 +02:00
Samuel ROZE
06ea72e3b2 [PropertyInfo] Auto-enable PropertyInfo component 2018-05-31 07:57:52 +02:00
Maxime Steinhausser
16ebf43740 bug #27389 [Serializer] Fix serializer tries to denormalize null values on nullable properties (ogizanagi)
This PR was merged into the 3.4 branch.

Discussion
----------

[Serializer] Fix serializer tries to denormalize null values on nullable properties

| Q             | A
| ------------- | ---
| Branch?       | 3.4 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #27384   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

Commits
-------

ca314889e7 [Serializer] Fix serializer tries to denormalize null values on nullable properties
2018-05-30 20:05:22 +02:00
Maxime Steinhausser
f5703dc6b3 [Messenger] Fix suggested enqueue adapter package 2018-05-30 19:32:47 +02:00
Samuel ROZE
bbbcd46005 Add an alias to the property info type extractor 2018-05-30 18:13:59 +02:00
Fabien Potencier
52647b86bf bumped Symfony version to 4.1.1 2018-05-30 15:07:50 +02:00
Fabien Potencier
1d9e422693 updated VERSION for 4.1.0 2018-05-30 14:52:34 +02:00
Fabien Potencier
be1b37f017 feature #27417 [WebProfilerBundle] Make Twig bundle an explicit dependency (fabpot)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[WebProfilerBundle] Make Twig bundle an explicit dependency

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #26115
| License       | MIT

Let's make Twig bundle an explicit dependency of WebProfilerBundle. That's better for DX and as Silex won't be maintained when 4.2 is out, it's the right time to do so.

Commits
-------

cac37caa7d [WebProfilerBundle] made Twig bundle an explicit dependency
2018-05-30 14:32:32 +02:00
Maxime Steinhausser
1c2f43f17c [Messenger][Profiler] Show dispatch caller 2018-05-30 12:45:35 +02:00
Nicolas Grekas
79adbcc990 bug #27420 Revert "feature #26702 Mark ExceptionInterfaces throwable (ostrolucky)" (nicolas-grekas)
This PR was merged into the 4.1 branch.

Discussion
----------

Revert "feature #26702 Mark ExceptionInterfaces throwable (ostrolucky)"

This reverts commit 9fda6d3ee3, reversing
changes made to ca53d3e0fd.

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27419
| License       | MIT
| Doc PR        | -

#26702 introduced a BC break.

Commits
-------

2ddb89b7a3 Revert "feature #26702 Mark ExceptionInterfaces throwable (ostrolucky)"
2018-05-30 11:29:56 +02:00
Niels Keurentjes
37270d79a2 Insert correct parameter_bag service in AbstractController 2018-05-30 11:26:42 +02:00
Nicolas Grekas
2ddb89b7a3 Revert "feature #26702 Mark ExceptionInterfaces throwable (ostrolucky)"
This reverts commit 9fda6d3ee3, reversing
changes made to ca53d3e0fd.
2018-05-30 09:26:09 +02:00
Fabien Potencier
cac37caa7d [WebProfilerBundle] made Twig bundle an explicit dependency 2018-05-30 09:08:30 +02:00
Fabien Potencier
28c8c85da1 removed unneeded comments in tests 2018-05-30 06:26:49 +02:00
Fabien Potencier
10580f1efe Merge branch '2.8' into 3.4
* 2.8:
  removed unneeded comments in tests
  Change PHPDoc in ResponseHeaderBag::getCookies() to help IDEs
  [HttpKernel] Set first trusted proxy as REMOTE_ADDR in InlineFragmentRenderer.
  [Process] Consider \"executable\" suffixes first on Windows
  Triggering RememberMe's loginFail() when token cannot be created
2018-05-30 06:24:30 +02:00
Fabien Potencier
09c660d454 removed unneeded comments in tests 2018-05-30 06:18:42 +02:00
Fabien Potencier
3bade96ff2 feature #27024 [Finder] added "use natural sort" option (vyshkant)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Finder] added "use natural sort" option

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #26930
| License       | MIT
| Doc PR        | symfony/symfony-docs#9671

Added `$useNaturalSort` optional argument to `Finder::sortByName()` method. If it is specified and equals to `true`, ["natural sort order" algorithm](https://en.wikipedia.org/wiki/Natural_sort_order) will be applied, which means that `strnatcmp` function will be used instead of `strcmp` (see #26930 for details).

Commits
-------

e697c7d272 [Finder] added "use natural sort" option
2018-05-30 06:00:02 +02:00
Fabien Potencier
3114ffb0ae bug #27272 [FrameworkBundle] Change priority of AddConsoleCommandPass to TYPE_BEFORE_REMOVING (upyx)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] Change priority of AddConsoleCommandPass to TYPE_BEFORE_REMOVING

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27259
| License       | MIT
| Doc PR        | no

Hello!
There is fix for #27259 issue. It changes priority of `AddConsoleCommandPass` to `TYPE_BEFORE_REMOVING` as @chalasr advised. I'm not sure about side effects by that.

Commits
-------

e36099503f [FrameworkBundle] Change priority of AddConsoleCommandPass to TYPE_BEFORE_REMOVING
2018-05-30 05:54:26 +02:00
Nicolas Grekas
896be4cc2b [FrameworkBundle] Allow configuring taggable cache pools 2018-05-29 15:12:15 +02:00
Davide Borsatto
479aa9074b Change PHPDoc in ResponseHeaderBag::getCookies() to help IDEs 2018-05-29 13:28:37 +02:00
Nicolas Grekas
c250fbdda0 [Cache] Remove TaggableCacheInterface, alias cache.app.taggable to CacheInterface 2018-05-28 21:56:05 +02:00
Nicolas Grekas
92e3023195 [HttpKernel] fix registering IDE links 2018-05-28 17:16:05 +02:00
Fabien Potencier
518ec864e9 bug #26973 [HttpKernel] Set first trusted proxy as REMOTE_ADDR in InlineFragmentRenderer. (kmadejski)
This PR was squashed before being merged into the 2.8 branch (closes #26973).

Discussion
----------

[HttpKernel] Set first trusted proxy as REMOTE_ADDR in InlineFragmentRenderer.

| Q             | A
| ------------- | ---
| Branch?       | 2.7 and up
| Bug fix?      | improvement
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ---
| License       | MIT
| Doc PR        | ---

SubRequest used in `InlineFragmentRendered` explicitly sets `$server['REMOTE_ADDR']` to `127.0.0.1`. Therefore, it's required to configure `127.0.0.1` address in TRUSTED_PROXIES environment variable. Without that, `Request::isFromTrustedProxy()` will return false.
The current behavior might be a little bit problematic, for instance, in case where images are rendered through subrequests. These might end-up with an incorrect schema in URL (`http` instead of `https`).

Commits
-------

18f55feef8 [HttpKernel] Set first trusted proxy as REMOTE_ADDR in InlineFragmentRenderer.
2018-05-27 09:44:41 +02:00
Kamil Madejski
18f55feef8 [HttpKernel] Set first trusted proxy as REMOTE_ADDR in InlineFragmentRenderer. 2018-05-27 09:44:31 +02:00
Fabien Potencier
dc0ac87b89 bug #27303 [Process] Consider "executable" suffixes first on Windows (sanmai)
This PR was squashed before being merged into the 2.8 branch (closes #27303).

Discussion
----------

[Process] Consider "executable" suffixes first on Windows

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        | n/a

Executable finder should consider "executable" suffixes first on Windows because we basically ignore executability on Windows (on the lines below changed), which leads, for example, to finding usually-non-executable `phpunit` file first where both `phpunit` and `phpunit.bat` are present.

I may miss something here, so please tell me if this makes any sense.

Same change against master: #27301

Commits
-------

9372e7a813 [Process] Consider \"executable\" suffixes first on Windows
2018-05-27 09:40:52 +02:00
Alexey Kopytko
9372e7a813 [Process] Consider \"executable\" suffixes first on Windows 2018-05-27 09:40:41 +02:00
Fabien Potencier
f557f943ba feature #26981 No more support for custom anon/remember tokens based on FQCN (Iltar van der Berg)
This PR was squashed before being merged into the 4.2-dev branch (closes #26981).

Discussion
----------

No more support for custom anon/remember tokens based on FQCN

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #26940
| License       | MIT
| Doc PR        | ~

This PR deprecates the ability to configure a custom anonymous and remember me token class, via the AuthenticationTrustResolver. The only change required _if_ you have changed the token classes like this, is to extend the Anonymous/RememberMe token classes.

Commits
-------

860d4549c2 No more support for custom anon/remember tokens based on FQCN
2018-05-27 09:21:43 +02:00
Iltar van der Berg
860d4549c2 No more support for custom anon/remember tokens based on FQCN 2018-05-27 09:19:43 +02:00
Ryan Weaver
e3412e6a67 Triggering RememberMe's loginFail() when token cannot be created 2018-05-27 09:16:31 +02:00
Fabien Potencier
62adf93109 bumped Symfony version to 4.1.0 2018-05-26 17:55:46 +02:00
Fabien Potencier
ce538ca559 updated VERSION for 4.1.0-BETA3 2018-05-26 17:53:24 +02:00
Maxime Steinhausser
ca314889e7 [Serializer] Fix serializer tries to denormalize null values on nullable properties 2018-05-26 11:53:53 +02:00
Nicolas Grekas
e077c798f0 Merge branch '4.1'
* 4.1:
  [Routing] Account for greediness when merging route patterns
2018-05-25 23:27:57 +02:00
Nicolas Grekas
d5a8237b1c [Routing] Account for greediness when merging route patterns 2018-05-25 23:14:53 +02:00
Nicolas Grekas
ee22169caa Merge branch '4.1'
* 4.1:
  [HttpKernel] fix test
2018-05-25 17:22:45 +02:00
Nicolas Grekas
2ed650332f Merge branch '4.0' into 4.1
* 4.0:
  [HttpKernel] fix test
2018-05-25 17:22:41 +02:00
Nicolas Grekas
a453bdf921 Merge branch '3.4' into 4.0
* 3.4:
  [HttpKernel] fix test
2018-05-25 17:22:18 +02:00
Nicolas Grekas
6fc7fdb182 [HttpKernel] fix test 2018-05-25 17:22:00 +02:00
Nicolas Grekas
b1a41a4812 Merge branch '4.1'
* 4.1:
  [HttpKernel] Dont reset start time when not needed
2018-05-25 17:07:57 +02:00
Nicolas Grekas
84748d6420 Merge branch '4.0' into 4.1
* 4.0:
  [HttpKernel] Dont reset start time when not needed
2018-05-25 17:07:41 +02:00
Nicolas Grekas
3a2f37f15d Merge branch '3.4' into 4.0
* 3.4:
  [HttpKernel] Dont reset start time when not needed
2018-05-25 17:07:09 +02:00
Nicolas Grekas
9de5014b27 [HttpKernel] Dont reset start time when not needed 2018-05-25 17:06:28 +02:00
Nicolas Grekas
201b472009 Merge branch '4.1'
* 4.1: (26 commits)
  Revert "bug #27312 Supress deprecation notices thrown when getting private servies from container in tests (arderyp)"
  [HttpKernel] reset kernel start time on reboot
  Add code of Conduct links in our README
  bumped Symfony version to 4.0.12
  [FrameworkBundle] Fix using test.service_container when Client is rebooted
  [DI] never inline lazy services
  updated VERSION for 4.0.11
  updated CHANGELOG for 4.0.11
  bumped Symfony version to 3.4.12
  updated VERSION for 3.4.11
  updated CHANGELOG for 3.4.11
  Default testsuite to latest PHPUnit 6.*
  [Github] Update the pull-request template
  bumped Symfony version to 2.8.42
  updated VERSION for 2.8.41
  updated CHANGELOG for 2.8.41
  Tweak Argon2 test config
  [HttpFoundation] Fix cookie test with xdebug
  [FrameworkBundle] cleanup generated test container
  [Serializer] Check the value of enable_max_depth if defined
  ...
2018-05-25 16:55:42 +02:00
Nicolas Grekas
d4d137de53 Merge branch '4.0' into 4.1
* 4.0:
  [HttpKernel] reset kernel start time on reboot
  Add code of Conduct links in our README
  bumped Symfony version to 4.0.12
  [DI] never inline lazy services
  updated VERSION for 4.0.11
  updated CHANGELOG for 4.0.11
  bumped Symfony version to 3.4.12
  updated VERSION for 3.4.11
  updated CHANGELOG for 3.4.11
  Default testsuite to latest PHPUnit 6.*
  [Github] Update the pull-request template
  bumped Symfony version to 2.8.42
  updated VERSION for 2.8.41
  updated CHANGELOG for 2.8.41
  [HttpFoundation] Fix cookie test with xdebug
  [Serializer] Check the value of enable_max_depth if defined
  [DI] remove dead code
  [PhpUnitBridge] silence some stderr outputs
  [Validator] Update sl translation
2018-05-25 16:55:38 +02:00
Nicolas Grekas
101ff69e1a Merge branch '3.4' into 4.0
* 3.4:
  [HttpKernel] reset kernel start time on reboot
  Add code of Conduct links in our README
  [DI] never inline lazy services
  bumped Symfony version to 3.4.12
  updated VERSION for 3.4.11
  updated CHANGELOG for 3.4.11
  Default testsuite to latest PHPUnit 6.*
  [Github] Update the pull-request template
  bumped Symfony version to 2.8.42
  updated VERSION for 2.8.41
  updated CHANGELOG for 2.8.41
  [HttpFoundation] Fix cookie test with xdebug
  [Serializer] Check the value of enable_max_depth if defined
  [DI] remove dead code
  [PhpUnitBridge] silence some stderr outputs
  [Validator] Update sl translation
2018-05-25 16:54:15 +02:00
Nicolas Grekas
bf20260025 Merge branch '2.8' into 3.4
* 2.8:
  Add code of Conduct links in our README
  [DI] never inline lazy services
  Default testsuite to latest PHPUnit 6.*
  [Github] Update the pull-request template
  bumped Symfony version to 2.8.42
  updated VERSION for 2.8.41
  updated CHANGELOG for 2.8.41
2018-05-25 16:50:57 +02:00
Nicolas Grekas
ab09fcc249 Revert "bug #27312 Supress deprecation notices thrown when getting private servies from container in tests (arderyp)"
This reverts commit 70c70e2d9f, reversing
changes made to 7497ad4a68.
2018-05-25 16:46:53 +02:00
Nicolas Grekas
d314735919 feature #27336 [Security][SecurityBundle] FirewallMap/FirewallContext deprecations (chalasr)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Security][SecurityBundle] FirewallMap/FirewallContext deprecations

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes/no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Next to #24805.

Commits
-------

a71ba78478 [Security][SecurityBundle] FirewallMap/FirewallContext deprecations
2018-05-25 16:45:07 +02:00
Nicolas Grekas
79bd461d59 bug #27344 [HttpKernel] reset kernel start time on reboot (kiler129)
This PR was squashed before being merged into the 3.4 branch (closes #27344).

Discussion
----------

[HttpKernel] reset kernel start time on reboot

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27319
| License       | MIT
| Doc PR        | n/a

I created branch from 3.4, since the furthest thing I could find for the reboot feature was a4fc49294e and it originated during stabilization phase of 3.4.

ping @nicolas-grekas

Commits
-------

b7feef00ae [HttpKernel] reset kernel start time on reboot
2018-05-25 16:43:55 +02:00
kiler129
b7feef00ae [HttpKernel] reset kernel start time on reboot 2018-05-25 16:43:44 +02:00
Nicolas Grekas
7064a77e87 minor #27347 [Validator] Update sl translation (petk)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Update sl translation

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | N/A

This patch updates Slovenian sl_SI translation for the 3.4 branches and up to master.

Commits
-------

a7a1325eab [Validator] Update sl translation
2018-05-25 16:42:15 +02:00
Nicolas Grekas
cb106fa2ff bug #27365 [Serializer] Check the value of enable_max_depth if defined (dunglas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Serializer] Check the value of enable_max_depth if defined

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | n/a

Because it confuses some users that `['enable_max_depth' => false]` actually triggers the check.

Commits
-------

e88e0f30f1 [Serializer] Check the value of enable_max_depth if defined
2018-05-25 16:39:07 +02:00
Nicolas Grekas
f8e21fd67b bug #27358 [PhpUnitBridge] silence some stderr outputs (ostrolucky)
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnitBridge] silence some stderr outputs

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Solves following issues

![obrazok](https://user-images.githubusercontent.com/496233/40449464-cc02bda2-5ed8-11e8-8a79-65c996ffc59d.png)

and

![obrazok](https://user-images.githubusercontent.com/496233/40452080-eb57381a-5ee0-11e8-82b5-99e13b357f74.png)

Commits
-------

87b3ad91d2 [PhpUnitBridge] silence some stderr outputs
2018-05-25 16:38:26 +02:00