Commit Graph

45151 Commits

Author SHA1 Message Date
Jordi Boggiano
9e62330bc4
[HttpFoundation] Add a way to anonymize IPs 2019-11-08 18:11:01 +01:00
Nicolas Grekas
585c0df909 feature #31310 [DependencyInjection] Added option ignore_errors: not_found for imported config files (pulzarraider)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Added option `ignore_errors: not_found` for imported config files

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

If someone want to add optional config file. The only available choice was to add `ignore_errors: true` option

e.g.
```
imports:
    - { resource: parameters.yml, ignore_errors: true }
```

But this will hide all errors in imported file. We ran in many situations that broke our Symfony applications because we had a typo in this imported files.

This PR introduce new possible value `not_found` for `ignore_errors` option. It can be used for optional config files like the `ignore_errors: true`, but it will ignore only the file non-existence, not the possible syntax errors inside.

Usage:
```
imports:
    - { resource: parameters.yml, ignore_errors: not_found}
```

Commits
-------

e0ee01c10d [DependencyInjection] Added option `ignore_errors: not_found` while importing config files
2019-11-08 09:53:35 +01:00
Nicolas Grekas
7a8b85cc67 bug #34285 [FrameworkBundle] fix SodiumVault after stof review (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] fix SodiumVault after stof review

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

As spotted by @stof in https://github.com/symfony/symfony/pull/34275#pullrequestreview-313355834

Commits
-------

a594599078 [FrameworkBundle] fix SodiumVault after stof review
2019-11-08 09:34:16 +01:00
Nicolas Grekas
8aaa8c5fc6 Merge branch '4.3' into 4.4
* 4.3:
  [DI] Dont cache classes with missing parents
  [HttpClient] Fix a crash when calling CurlHttpClient::__destruct()
  [Validator] Add the missing translations for the Hebrew (\"he\") locale and fix 2 typos
  [FrameworkBundle][Translation] Invalidate cached catalogues when the scanned directories change
2019-11-08 09:33:02 +01:00
Nicolas Grekas
a1fc280bf2 Merge branch '3.4' into 4.3
* 3.4:
  [DI] Dont cache classes with missing parents
  [Validator] Add the missing translations for the Hebrew (\"he\") locale and fix 2 typos
2019-11-08 09:31:27 +01:00
Nicolas Grekas
b8cdc6e6bb bug #34282 [DI] Dont cache classes with missing parents (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Dont cache classes with missing parents

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

Commits
-------

1606430cfd [DI] Dont cache classes with missing parents
2019-11-08 09:30:13 +01:00
Nicolas Grekas
1606430cfd [DI] Dont cache classes with missing parents 2019-11-08 09:28:59 +01:00
Nicolas Grekas
201d17181a bug #34287 [HttpClient] Fix a crash when calling CurlHttpClient::__destruct() (dunglas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] Fix a crash when calling CurlHttpClient::__destruct()

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

I've not identified the exact issue, but when the profiler is enabled, an HttpClient instance is created and not used, then a crash occurs when `__destruct()` is called because `$this->mutli->handle` value is `0` has this point, while `curl_multi_setopt` expect a `resource`.

This PR fixes the issue, but it's maybe not the good approach.

Reproducer: symfony/mercure-bundle#14

curl version: 7.67.0

```
php -v
PHP 7.3.11 (cli) (built: Oct 24 2019 11:29:52) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.11, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.11, Copyright (c) 1999-2018, by Zend Technologies
    with blackfire v1.27.1~mac-x64-non_zts73, https://blackfire.io, by Blackfire
```

Commits
-------

d2c5ffda52 [HttpClient] Fix a crash when calling CurlHttpClient::__destruct()
2019-11-08 09:24:00 +01:00
Kévin Dunglas
d2c5ffda52 [HttpClient] Fix a crash when calling CurlHttpClient::__destruct() 2019-11-08 09:23:45 +01:00
Nicolas Grekas
e2467e2e8f minor #34286 Unallow symfony/http-kernel ^5.0 (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

Unallow symfony/http-kernel ^5.0

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/pull/34265#discussion_r343739637
| License       | MIT
| Doc PR        | -

The components that have a data collector cannot be compatible with HttpKernel `DataCollectorInterface` 5.0.

Commits
-------

da454db947 Unallow symfony/http-kernel ^5.0
2019-11-08 09:07:43 +01:00
Thomas Calvet
da454db947 Unallow symfony/http-kernel ^5.0 2019-11-07 18:22:59 +01:00
Nicolas Grekas
a594599078 [FrameworkBundle] fix SodiumVault after stof review 2019-11-07 17:20:24 +01:00
Nicolas Grekas
6779c338a4 feature #34216 [HttpClient] allow arbitrary JSON values in requests (pschultz)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] allow arbitrary JSON values in requests

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

Allow arbitrary values in the "json" request option. Previously values were
limitated to arrays and objects of type JsonSerializable. This doesn't account
for scalar values and classes with public properties (which don't need to
implement JsonSerializable), [all of which are perfectly acceptable arguments to
json_encode](https://www.php.net/manual/en/function.json-encode.php):

> value
> The value being encoded. Can be any type except a resource.

It seems silly to expect users to add classes implementing JsonSerializable to represent, say, scalar values or an empty object.

I'm not sure if you consider removed exceptional cases a BC break or not. I'm assuming "no" for now.

Commits
-------

e98731aabf [HttpClient] allow arbitrary JSON values in requests
2019-11-07 13:58:30 +01:00
Peter Schultz
e98731aabf [HttpClient] allow arbitrary JSON values in requests
Allow arbitrary values in the "json" request option. Previously values were
limitated to arrays and objects of type JsonSerializable. This doesn't account
for scalar values and classes with public properties (which don't need to
implement JsonSerializable), all of which are perfectly acceptable arguments to
json_encode.
2019-11-07 13:44:51 +01:00
Nicolas Grekas
9a2043769e bug #34275 [FrameworkBundle] allow using secrets when the sodium ext is missing (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] allow using secrets when the sodium ext is missing

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

When all secrets are defined as env vars, there is no need for the sodium vault, yet it chokes on instantiation currently.

Commits
-------

326284ae95 [FrameworkBundle] allow using secrets when the sodium ext is missing
2019-11-07 13:04:15 +01:00
Andrej Hudec
e0ee01c10d [DependencyInjection] Added option ignore_errors: not_found while importing config files 2019-11-07 12:06:31 +01:00
Nicolas Grekas
326284ae95 [FrameworkBundle] allow using secrets when the sodium ext is missing 2019-11-07 08:50:00 +01:00
Fabien Potencier
4056baf0f4 bug #34129 [FrameworkBundle][Translation] Invalidate cached catalogues when the scanned directories change (fancyweb)
This PR was merged into the 4.3 branch.

Discussion
----------

[FrameworkBundle][Translation] Invalidate cached catalogues when the scanned directories change

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/33992
| License       | MIT
| Doc PR        | -

The cache file name needs to depend on the scanned directories list. Otherwise, when a new directory is added, even if the container is rebuilt and the `FWB Translator` gets the new scanned directories list, the cached catalogue name is still the same and is resolved accordingly.

An alternative would be to make the `Translation Translator` `getCatalogueCachePath()` method and `fallbackLocales` `@internal` and `protected` to just override everything in the `FWB Translator`. The `cacheVary` argument has the benefit to be reusable by all the `Translation` component users.

Note that there is a negative minor performance impact that increases when the list of scanned directories grows.

Commits
-------

6cbee0944c [FrameworkBundle][Translation] Invalidate cached catalogues when the scanned directories change
2019-11-07 00:21:49 +01:00
Yonel Ceruto
ba07cda358 minor #34249 [TwigBridge] Fix switch-custom changelog entry (ogizanagi)
This PR was merged into the 4.4 branch.

Discussion
----------

[TwigBridge] Fix switch-custom changelog entry

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- see below -->
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Relates to #33954
| License       | MIT
| Doc PR        | N/A

As it doesn't really mention `switch-custom` is a css class.

Commits
-------

b03b7f4 [TwigBridge] Fix switch-custom changelog entry
2019-11-06 12:55:14 -05:00
Nicolas Grekas
88759a31f6 minor #34267 Skip validation of services that make the CI fail (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

Skip validation of services that make the CI fail

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

Commits
-------

403fdf4a59 Skip validation of services that make the CI fail
2019-11-06 18:05:06 +01:00
Nicolas Grekas
403fdf4a59 Skip validation of services that make the CI fail 2019-11-06 17:48:56 +01:00
Nicolas Grekas
a1155ea6e2 Merge branch '4.3' into 4.4
* 4.3:
  [Serializer] Use context to compute MetadataAwareNameConverter cache
2019-11-06 17:13:44 +01:00
Nicolas Grekas
e91488cd0a bug #34246 [Serializer] Use context to compute MetadataAwareNameConverter cache (antograssiot)
This PR was merged into the 4.3 branch.

Discussion
----------

[Serializer] Use context to compute MetadataAwareNameConverter cache

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

This is a follow up PR to #34035 to address @nicolas-grekas 's [comment](https://github.com/symfony/symfony/pull/34035#issuecomment-549867560)

The static cache has been re-introduced and the context is used to compute the cache key used for denormalization

Commits
-------

0ac5346bf5 [Serializer] Use context to compute MetadataAwareNameConverter cache
2019-11-06 17:12:31 +01:00
Anto
0ac5346bf5
[Serializer] Use context to compute MetadataAwareNameConverter cache 2019-11-06 17:10:14 +01:00
Nicolas Grekas
80d520fa63 minor #34264 [VarDumper] Mark StubCaster as @final (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[VarDumper] Mark StubCaster as @final

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

Looks like it was forgotten in https://github.com/symfony/symfony/pull/33882.

@lyrixx was it intentional?

Commits
-------

d25b60961f [VarDumper] Mark StubCaster as @final
2019-11-06 17:09:29 +01:00
Thomas Calvet
d25b60961f [VarDumper] Mark StubCaster as @final 2019-11-06 17:06:09 +01:00
Nicolas Grekas
2a4b0b850e minor #34262 [DoctrineBridge] conflict with validator < 4.4 (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DoctrineBridge] conflict with validator < 4.4

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

Or you'll get `PHP Fatal error:  Trait 'Symfony\Component\Validator\Mapping\Loader\AutoMappingTrait' not found`.

/cc @dunglas FYI

Commits
-------

ca398df11f [DoctrineBridge] conflict with validator < 4.4
2019-11-06 16:10:23 +01:00
Nicolas Grekas
ca398df11f [DoctrineBridge] conflict with validator < 4.4 2019-11-06 16:07:32 +01:00
Nicolas Grekas
b337a015a9 Merge branch '4.3' into 4.4
* 4.3:
  fix typo (bis)
  fix typo
  [HttpKernel] backport FC compat code
2019-11-06 15:44:36 +01:00
Nicolas Grekas
50633f2579 fix typo (bis) 2019-11-06 15:43:50 +01:00
Nicolas Grekas
9641215656 fix typo 2019-11-06 15:42:57 +01:00
Nicolas Grekas
4c401ebdd6 [HttpKernel] backport FC compat code 2019-11-06 15:42:08 +01:00
Nicolas Grekas
bd7da14243 minor #34261 [DoctrineBridge] fix min version of http-kernel (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DoctrineBridge] fix min version of http-kernel

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

Required after #34257 and #34230

Commits
-------

69ba86ba66 [DoctrineBridge] fix min version of http-kernel
2019-11-06 15:29:25 +01:00
Nicolas Grekas
69ba86ba66 [DoctrineBridge] fix min version of http-kernel 2019-11-06 15:26:48 +01:00
Nicolas Grekas
3a4d60f298 minor #34260 [Messenger] conflict with FrameworkBundle < 4.4 (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] conflict with FrameworkBundle < 4.4

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

Commits
-------

cddf3e9083 conflict with FrameworkBundle < 4.4
2019-11-06 15:12:58 +01:00
Nicolas Grekas
777ff14c75 minor #34257 [DoctrineBridge] Reopen DoctrineDataCollector to extensibility (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[DoctrineBridge] Reopen DoctrineDataCollector to extensibility

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

DoctrineBundle is using it (0d20a98fb8/DataCollector/DoctrineDataCollector.php (L41)) and we don't want to prevent them from doing it.

Commits
-------

af021248bf [DoctrineBridge] Reopen DoctrineDataCollector to extensibility
2019-11-06 15:12:17 +01:00
Christian Flothmann
cddf3e9083 conflict with FrameworkBundle < 4.4 2019-11-06 15:11:47 +01:00
Thomas Calvet
af021248bf [DoctrineBridge] Reopen DoctrineDataCollector to extensibility 2019-11-06 14:58:24 +01:00
Nicolas Grekas
92687435dc bug #34258 [HttpClient] fix support for NTLM auth (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] fix support for NTLM auth

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

A `401` with `WWW-Authenticate: NTLM [...]` is not the final response code when using `auth_ntlm`.

Commits
-------

370c4379a5 [HttpClient] fix support for NTLM auth
2019-11-06 14:55:28 +01:00
Nicolas Grekas
370c4379a5 [HttpClient] fix support for NTLM auth 2019-11-06 14:41:42 +01:00
Nicolas Grekas
62bf1f5002 bug #34255 [HttpClient] fix after merge from 4.3 (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] fix after merge from 4.3

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

Commits
-------

3c6dc96ab4 [HttpClient] fix after merge from 4.3
2019-11-06 13:03:36 +01:00
Nicolas Grekas
3932642619 bug #34250 [VarDumper] fix tests & displaying generators (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[VarDumper] fix tests & displaying generators

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

Replaces #34248

Commits
-------

bcf43a4593 [VarDumper] fix tests & displaying generators
2019-11-06 13:03:12 +01:00
Nicolas Grekas
dac61d0667 Merge branch '4.3' into 4.4
* 4.3:
  [HttpClient] expose only gzip when doing transparent compression
  add species to inflector and inflector tests
2019-11-06 13:02:32 +01:00
Nicolas Grekas
4f04bedd00 bug #34251 [HttpClient] expose only gzip when doing transparent compression (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] expose only gzip when doing transparent compression

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

Commits
-------

6571dddc4c [HttpClient] expose only gzip when doing transparent compression
2019-11-06 13:01:29 +01:00
Nicolas Grekas
3c6dc96ab4 [HttpClient] fix after merge from 4.3 2019-11-06 12:53:36 +01:00
Nicolas Grekas
6571dddc4c [HttpClient] expose only gzip when doing transparent compression 2019-11-06 11:21:02 +01:00
Nicolas Grekas
bcf43a4593 [VarDumper] fix tests & displaying generators 2019-11-06 10:36:47 +01:00
Nicolas Grekas
ddf9e0fa1c bug #34244 [Inflector] add support for 'species' (jeffreymoelands)
This PR was merged into the 4.3 branch.

Discussion
----------

[Inflector] add support for 'species'

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

This PR improves the inflection of the word 'species'
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

cc87e40a8f add species to inflector and inflector tests
2019-11-06 09:52:55 +01:00
Maxime Steinhausser
b03b7f4ef5 [TwigBridge] Fix switch-custom changelog entry
As it doesn't really mention `switch-custom` is a css class.
2019-11-06 09:18:31 +01:00
Tobias Schultze
ba1ba971d6 minor #34245 Fix WeekType tests (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

Fix WeekType tests

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

`WeekToArrayTransformer::reverseTransform()` requires an integer + `testWeekChoices()` widget arg was forgotten.

Commits
-------

906b82eb97 Fix WeekType tests
2019-11-06 00:27:01 +01:00