Commit Graph

38614 Commits

Author SHA1 Message Date
Nicolas Grekas
76cf0ca661 Merge branch '3.4' into 4.1
* 3.4:
  Fix CS
  Allow reuse of Session between requests
  [MonologBridge] Re-add option option to ignore empty context and extra data
  [Lock] remove useless code
  [PhpUnitBridge] fix disabling DeprecationErrorHandler using phpunit.xml file
  Provide debug_backtrace with proper args
  [DI] fix infinite loop involving self-references in decorated services
  forward false label option to nested types
  forward the invalid_message option in date types
2018-09-21 14:49:42 +02:00
Nicolas Grekas
0218507b06 Merge branch '2.8' into 3.4
* 2.8:
  Fix CS
  Allow reuse of Session between requests
  Provide debug_backtrace with proper args
  forward false label option to nested types
  forward the invalid_message option in date types
2018-09-21 14:47:54 +02:00
Nicolas Grekas
76c2de0317 Fix CS 2018-09-21 14:46:38 +02:00
Rhodri Pugh
cbc2be8ba8 [Serializer] deprecated normalizers and encoders who dont implement the base interfaces 2018-09-21 14:14:25 +02:00
Nicolas Grekas
0d9154e5bb feature #27920 Add Zookeeper data store for Lock Component (Ganesh Chandrasekaran)
This PR was merged into the 4.2-dev branch.

Discussion
----------

Add Zookeeper data store for Lock Component

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

This change adds a new feature to the Lock Component to give the capability to store locks in Zookeeper Data Store. The corresponding documentation PR should describe how this works.

The change here also adds a functional test to make sure all the basic functionality of the lock using this data store works.

Requirements for this to work are having a PHP-Zookeeper extension available to use this.

Commits
-------

c72c297dc3 Add new Zookeeper Data Store. Add functional test for Zookeeper Data Store. Modify Store Factory to support initialization of Zookeeper Data Store.
2018-09-21 13:57:52 +02:00
Nicolas Grekas
5d30df78e7 bug #28433 [HttpFoundation] Allow reuse of Session between requests if ID did not change (tgalopin)
This PR was merged into the 2.8 branch.

Discussion
----------

[HttpFoundation] Allow reuse of Session between requests if ID did not change

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

I stumbled upon the issue from https://github.com/symfony/symfony/issues/13450 in a more simple case than what was exposed in the issue. From my understanding, the problem arises when the session is used between an access to the session and a functional test request: because the session was accessed (usually using the container directly), the session has started and the following request fails.

This PR checks whether the ID was actually regenerated before throwing (if a setId is called with the same ID, it is the same request context, it shouldn't throw IMO).

Not sure I understood everything correctly though, feel free to fix it for me if needed.

Commits
-------

fd30f4a21d Allow reuse of Session between requests
2018-09-21 13:42:18 +02:00
Titouan Galopin
fd30f4a21d Allow reuse of Session between requests 2018-09-21 13:38:21 +02:00
Nicolas Grekas
3c1961ca37 minor #28513 [Validator] add exception when intl component not found (ronfroy)
This PR was squashed before being merged into the 4.2-dev branch (closes #28513).

Discussion
----------

[Validator] add exception when intl component not found

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

<!--
Add some exception when the Intl component is not found but required on some constraints
-->

Commits
-------

b6f29f4721 [Validator] add exception when intl component not found
2018-09-21 13:37:55 +02:00
Rudy Onfroy
b6f29f4721 [Validator] add exception when intl component not found 2018-09-21 13:37:49 +02:00
Nicolas Grekas
6856c023e3 feature #28317 [VarDumper] Allow dd() to be called without arguments (SjorsO)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[VarDumper] Allow dd() to be called without arguments

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

**Description**
A while back the `dd()` helper was [added to the VarDumper component](https://github.com/symfony/symfony/pull/26970) which was (i think) inspired by Laravel's `dd()` helper. Laravel has [removed their version of the helper](https://github.com/laravel/framework/pull/25087) in favor of the helper in Symfony.

However, as opposed to the Laravel helper, the Symfony helper requires at least one argument. Calling the Laravel helper with no arguments simply killed the program (and usually showed a white screen), calling the Symfony helper with no arguments throws a `TypeError: Too few arguments to function dd()` exception (which gets rendered by the error handler and fills the whole screen with useless information).

Being able to call the `dd()` helper with no arguments is useful because it is a quick way to tell you if your code reaches a certain point. If it does, you can fill in the `dd()` with variables to keep debugging.

This PR allows the dd helper to be called without arguments.

This PR also makes the helper call `die` instead of `exit` to better reflect the function name 😄

Commits
-------

a73dfadc18 [VarDumper] Allow dd() to be called without arguments
2018-09-21 13:20:56 +02:00
Sjors Ottjes
a73dfadc18 [VarDumper] Allow dd() to be called without arguments 2018-09-21 13:19:29 +02:00
Nicolas Grekas
ea2a65c271 feature #28424 [Ldap] Add verbose ext-ldap error if present for easier debugging (scaytrase)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Ldap] Add verbose ext-ldap error if present for easier debugging

| Q             | A
| ------------- | ---
| Branch?       | master (be careful when merging)
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   |
| Fixed tickets | #28149
| License       | MIT
| Doc PR        |

Added an optional message suffix if ldap_errno is not equals to 0

Commits
-------

761415fc1b Add verbose ext-ldap error if present for easier debugging
2018-09-21 13:16:30 +02:00
Nicolas Grekas
a55853d044 feature #28521 [Yaml] Added support for multiple files or directories in LintCommand (yceruto)
This PR was squashed before being merged into the 4.2-dev branch (closes #28521).

Discussion
----------

[Yaml] Added support for multiple files or directories in LintCommand

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

Commits
-------

d0f7950860 [Yaml] Added support for multiple files or directories in LintCommand
2018-09-21 13:02:50 +02:00
Yonel Ceruto
d0f7950860 [Yaml] Added support for multiple files or directories in LintCommand 2018-09-21 13:02:43 +02:00
Nicolas Grekas
4d6fc63b12 feature #28522 [Translation] Added support for multiple files or directories in XliffLintCommand (yceruto)
This PR was squashed before being merged into the 4.2-dev branch (closes #28522).

Discussion
----------

[Translation] Added support for multiple files or directories in XliffLintCommand

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

Same approach of https://github.com/symfony/symfony/pull/28521

Commits
-------

88ec37bed7 [Translation] Added support for multiple files or directories in XliffLintCommand
2018-09-21 13:01:58 +02:00
Yonel Ceruto
88ec37bed7 [Translation] Added support for multiple files or directories in XliffLintCommand 2018-09-21 13:01:50 +02:00
Nicolas Grekas
e198a26baf feature #28523 [FrameworkBundle] Register an identity translator as fallback (yceruto)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[FrameworkBundle] Register an identity translator as fallback

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

The same approach as https://github.com/symfony/symfony/pull/24358, suggested by @xabbuh here https://github.com/symfony/symfony/issues/27589#issuecomment-421542776

**Templating Engine Context**

The Form component can be used without the Translation component.
However, to be able to use the default form themes provided by the
`FrameworkBundle` you need to have the `translator` helper to be available.

This change ensure that there will always be a `translator` helper which
as a fallback will just return the message key if no translator is present.

Commits
-------

5330f2d017 [FrameworkBundle] Register an identity translator as fallback
2018-09-21 13:01:20 +02:00
Nicolas Grekas
7d51b57427 minor #28526 [Contracts] fine tune composer.json declarations for suggest/provide (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Contracts] fine tune composer.json declarations for suggest/provide

| 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
-------

8a11e76c14 [Contracts] fine tune composer.json declarations for suggest/provide
2018-09-21 13:00:31 +02:00
Nicolas Grekas
8a11e76c14 [Contracts] fine tune composer.json declarations for suggest/provide 2018-09-20 15:44:19 +02:00
Nicolas Grekas
5a10f2de9e bug #28508 [Form] forward false label option to nested types (xabbuh)
This PR was merged into the 2.8 branch.

Discussion
----------

[Form] forward false label option to nested types

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

This change does not fix any built-in Symfony form themes, but takes
into account the changes made in #28469 to allow third-party form themes
work properly.

Commits
-------

3247cdeea9 forward false label option to nested types
2018-09-20 14:21:23 +02:00
Nicolas Grekas
bf4d011b3d feature #28473 [Validator] Check the BIC country with symfony/intl (sylfabre)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Validator] Check the BIC country with symfony/intl

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

Check the BIC country code against the list from Intl component instead of a simple check alphabetical test.

This PR uses the Intl component which is not part of the required dependencies of the Validator component (https://github.com/symfony/validator/blob/master/composer.json): `symfony/intl` is only required for dev. So I'm making a PR against master because it may break existing code.
But `CountryValidator` does the same so it may not be an issue after all.

Commits
-------

27bd3a8192 [Validator] Check the BIC country with symfony/intl Fix #28167
2018-09-20 14:02:31 +02:00
Nicolas Grekas
31e96f7435 bug #28471 [MonologBridge] Re-add option option to ignore empty context and extra data (mpdude)
This PR was squashed before being merged into the 3.4 branch (closes #28471).

Discussion
----------

[MonologBridge] Re-add option option to ignore empty context and extra data

| 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        |

In #11496, an option was added to `ConsoleFormatter` to ignore empty context and extra data. This setting was even turned on by default.

The `ConsoleHandler` was then overhauled in #21705. During this change, the option got lost.

Commits
-------

d1e7438605 [MonologBridge] Re-add option option to ignore empty context and extra data
2018-09-20 13:58:14 +02:00
Matthias Pigulla
d1e7438605 [MonologBridge] Re-add option option to ignore empty context and extra data 2018-09-20 13:58:05 +02:00
Nicolas Grekas
b349b64488 bug #28464 [Form] forward the invalid_message option in date types (xabbuh)
This PR was merged into the 2.8 branch.

Discussion
----------

[Form] forward the invalid_message option in date types

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

Commits
-------

5318e2eb15 forward the invalid_message option in date types
2018-09-20 13:52:05 +02:00
Nicolas Grekas
398e261e4f minor #28515 [Lock] remove useless code (ronfroy)
This PR was submitted for the master branch but it was squashed and merged into the 3.4 branch instead (closes #28515).

Discussion
----------

[Lock] remove useless code

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

remove usless code

Commits
-------

0d38c710c3 [Lock] remove useless code
2018-09-20 13:44:21 +02:00
Rudy Onfroy
0d38c710c3 [Lock] remove useless code 2018-09-20 13:44:13 +02:00
Yonel Ceruto
5330f2d017 [FrameworkBundle] Register an identity translator as fallback
The Form component can be used without the Translation component.
However, to be able to use the default form themes provided by the
FrameworkBundle you need to have the `translator` helper to be
available.

This change ensure that there will always be a `translator` helper which
as a fallback will just return the message key if no translator is
present.
2018-09-20 13:39:51 +02:00
Nicolas Grekas
4da7ab1258 minor #28506 [PhpUnitBridge] Provide debug_backtrace with proper args (greg0ire)
This PR was merged into the 2.8 branch.

Discussion
----------

[PhpUnitBridge] Provide debug_backtrace with proper args

This would fail if we were using strict mode with php 7, because true is
only a valid argument for php < 5.3.6.
This was changed from PHP_VERSION_ID >= 50400 ?
DEBUG_BACKTRACE_IGNORE_ARGS | DEBUG_BACKTRACE_PROVIDE_OBJECT : true in
 #18272, but I do not understand why it was simlified, nor why
DEBUG_BACKTRACE_IGNORE_ARGS was there at that time.

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

Not sure if this qualifies as a bugfix. If not, should I simplify the ternary and target master? My fear is that having the code diverge too much will make it harder to merge subsequent PRs. I know this looks small, but I'm kind of preparing a big PR on the bridge and I'd rather have it smaller and easier to understand by moving everything I can with small patches like this one.

Commits
-------

0d826ae85d Provide debug_backtrace with proper args
2018-09-20 13:06:00 +02:00
Nicolas Grekas
a1ca55beea bug #28520 [Validator] Allow Validator without the translator component (sroze)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Validator] Allow Validator without the translator component

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

Validator should be available without the Translator service. #28210 introduced a regression, it was not the case anymore:
```

  You have requested a non-existent service "translator".

```

This fixes it.

Commits
-------

2dc92d7a4b Allow validator without the translator
2018-09-20 12:51:30 +02:00
Nicolas Grekas
da1999856f bug #28524 [PhpUnitBridge] fix disabling DeprecationErrorHandler using phpunit.xml file (soerenbernstein)
This PR was submitted for the master branch but it was squashed and merged into the 3.4 branch instead (closes #28524).

Discussion
----------

[PhpUnitBridge] fix disabling DeprecationErrorHandler using phpunit.xml file

Fixing #28519

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | don't know
| Fixed tickets | #28519
| License       | MIT

Commits
-------

3cd929bee0 [PhpUnitBridge] fix disabling DeprecationErrorHandler using phpunit.xml file
2018-09-20 09:47:32 +02:00
Sören Bernstein
3cd929bee0 [PhpUnitBridge] fix disabling DeprecationErrorHandler using phpunit.xml file 2018-09-20 09:47:26 +02:00
Samuel ROZE
2dc92d7a4b Allow validator without the translator 2018-09-20 08:09:04 +01:00
Ganesh Chandrasekaran
c72c297dc3 Add new Zookeeper Data Store. Add functional test for Zookeeper Data Store. Modify Store Factory to support initialization of Zookeeper Data Store. 2018-09-20 09:05:24 +02:00
Nicolas Grekas
9493cfd5f2 [HttpFoundation] make cookies auto-secure when passing them $secure=null + plan to make it and samesite=lax the defaults in 5.0 2018-09-20 08:41:35 +02:00
Grégoire Paris
0d826ae85d
Provide debug_backtrace with proper args
This would fail if we were using strict mode with php 7, because true is
only a valid argument for php < 5.3.6.
This was changed from PHP_VERSION_ID >= 50400 ?
DEBUG_BACKTRACE_IGNORE_ARGS | DEBUG_BACKTRACE_PROVIDE_OBJECT : true in
 #18272, but I do not understand why it was simplified, nor why
DEBUG_BACKTRACE_IGNORE_ARGS was there at that time.
2018-09-19 22:34:51 +02:00
Nicolas Grekas
05ebca763e [ProxyManagerBridge] minor CS fix 2018-09-19 22:15:40 +02:00
Sylvain Fabre
27bd3a8192 [Validator] Check the BIC country with symfony/intl
Fix #28167
2018-09-19 19:00:23 +02:00
Nicolas Grekas
cb13594826 feature #28487 [FrameworkBundle] Ignore backslashes in service ids when using debug:container and debug:autowiring (respinoza)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[FrameworkBundle] Ignore backslashes in service ids when using debug:container and debug:autowiring

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

Commits
-------

0aba355d8e [FrameworkBundle] Ignore backslashes in service ids when using `debug:container` and `debug:autowiring`
2018-09-19 16:47:07 +02:00
Roberto Espinoza
0aba355d8e [FrameworkBundle] Ignore backslashes in service ids when using debug:container and debug:autowiring 2018-09-19 16:42:41 +02:00
Nicolas Grekas
e0e5e83732 bug #28512 [DI] fix infinite loop involving self-references in decorated services (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] fix infinite loop involving self-references in decorated services

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

Commits
-------

20f27f9c72 [DI] fix infinite loop involving self-references in decorated services
2018-09-19 15:46:53 +02:00
Nicolas Grekas
20f27f9c72 [DI] fix infinite loop involving self-references in decorated services 2018-09-19 15:15:21 +02:00
Nicolas Grekas
da1175ca44 Merge branch '3.4' into 4.1
* 3.4:
  [DI] fix dumping lazy services
2018-09-19 10:47:33 +02:00
Nicolas Grekas
8877a338a8 bug #28507 [DI] fix dumping lazy services (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] fix dumping lazy services

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

Commits
-------

7cf1505a5b [DI] fix dumping lazy services
2018-09-19 10:46:38 +02:00
Christian Flothmann
3247cdeea9 forward false label option to nested types
This change does not fix any built-in Symfony form themes, but takes
into account the changes made in #28469 to allow third-party form themes
work properly.
2018-09-19 09:52:43 +02:00
Nicolas Grekas
7cf1505a5b [DI] fix dumping lazy services 2018-09-19 09:18:46 +02:00
Nicolas Grekas
6ec223bf6f [SecurityBundle] make remember-me cookies auto-secure + inherit their default config from framework.session.cookie_* 2018-09-18 21:47:13 +02:00
Nicolas Grekas
00e5cd9a1c Merge branch '4.1'
* 4.1:
  Fix expected values in datetime-local test
  [TwigBridge] exclude symfony/form 4.0.* from allowed deps
2018-09-18 20:13:12 +02:00
Nicolas Grekas
4879a75a9a minor #28504 [Form] Fix expected values in datetime-local test (mcfedr)
This PR was submitted for the master branch but it was merged into the 4.1 branch instead (closes #28504).

Discussion
----------

[Form] Fix expected values in datetime-local test

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

Commits
-------

5ed8b2710f Fix expected values in datetime-local test
2018-09-18 20:12:30 +02:00
Fred Cox
5ed8b2710f Fix expected values in datetime-local test 2018-09-18 20:12:21 +02:00
Nicolas Grekas
60187978dc Merge branch '3.4' into 4.1
* 3.4:
  [TwigBridge] exclude symfony/form 4.0.* from allowed deps
2018-09-18 19:14:12 +02:00