Commit Graph

74 Commits

Author SHA1 Message Date
Nicolas Grekas cc5e582dcf [BC BREAK][DI] Always autowire "by id" instead of using reflection against all existing services 2017-04-05 23:48:42 +02:00
Fabien Potencier 457174dad9 feature #21919 [Form] Deprecated usage of "choices" option in sub types (HeahDude)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Form] Deprecated usage of "choices" option in sub types

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | ~

Follows #21880 and the discussion in #20771.

Commits
-------

b5b56fcbac [Form] Deprecated usage of "choices" option in sub types
2017-04-05 11:14:26 -07:00
Fabien Potencier 24b1b0d908 fixed wording 2017-04-04 12:45:53 -07:00
Jérôme Vasseur 4ec80b1ae8 Use IteratorArgument for voters 2017-04-04 19:58:27 +02:00
Nicolas Grekas 72e28957e2 [BC BREAK][HttpFoundation] Request::setTrustedProxies() takes a new required $trustedHeaderSet argument 2017-04-03 11:58:17 +02:00
Nicolas Grekas b07da3dc1e [DI] Enhance DX by throwing instead of triggering a deprecation notice 2017-03-28 08:18:44 +02:00
HeahDude b5b56fcbac [Form] Deprecated usage of "choices" option in sub types 2017-03-27 18:52:54 +02:00
HeahDude 8b850e6074 Fixed duplicated Console subtitle in UPGRADE file 2017-03-26 23:24:36 +02:00
Fabien Potencier ba4d6bce29 feature #18140 [Console] Add console.ERROR event and deprecate console.EXCEPTION (wouterj)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Console] Add console.ERROR event and deprecate console.EXCEPTION

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

The current `console.EXCEPTION` event is only dispatched for exceptions during the execution of `Command#execute()`. All other exceptions (e.g. the ones thrown by listeners to events) are catched by the `try ... catch` loop in `Application#doRunCommand()`. This means that there is _no way to override exception handling_.
## The Solution

This PR adds a `console.ERROR` event which has the same scope as the default `try ... catch` loop. This allows to customize all exception handling.

In order to keep BC, a new event was created and `console.EXCEPTION` was deprecated.

Commits
-------

c02a4c9857 Added a console.ERROR event
2017-03-22 16:10:45 -07:00
Fabien Potencier 1635a6a4e7 feature #20516 [Security][SecurityBundle] Enhance automatic logout url generation (ogizanagi)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Security][SecurityBundle] Enhance automatic logout url generation

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

This should help whenever:

- [the token does not implement the `getProviderKey` method](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Security/Http/Logout/LogoutUrlGenerator.php#L89-L99)
- you've got multiple firewalls sharing a same context but a logout listener only define on one of them.

##### Behavior:

> When not providing the firewall key:
>
>- Try to find the key from the token (unless it's an anonymous token)
>- If found, try to get the listener from the key. If the listener is found, stop there.
>- Try from the injected firewall key. If the listener is found, stop there.
>- Try from the injected firewall context. If the listener is found, stop there.
>
>The behavior remains unchanged when providing explicitly the firewall key. No fallback.

Commits
-------

5b7fe852aa [Security][SecurityBundle] Enhance automatic logout url generation
2017-03-22 14:38:03 -07:00
Robin Chalas 0b741da343 Move AddValidatorInitializersrPass & AddConstraintValidatorsPass to the Validator 2017-03-22 21:51:09 +01:00
Nicolas Grekas d3c960493c [HttpFoundation] Add $trustedHeaderSet arg to Request::setTrustedProxies() - deprecate not setting it 2017-03-22 21:29:40 +01:00
Robin Chalas 85177a649e [FrameworkBundle] Make Translator works with any PSR-11 container 2017-03-22 16:47:35 +01:00
Fabien Potencier 7ed3237645 [FrameworkBundle] deprecated cache:clear with warmup 2017-03-21 15:16:20 -07:00
Fabien Potencier a96a99723a feature #21889 Deprecate the special SYMFONY__ environment variables (javiereguiluz)
This PR was squashed before being merged into the 3.3-dev branch (closes #21889).

Discussion
----------

Deprecate the special SYMFONY__ environment variables

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

Commits
-------

e3362e854c Deprecate the special SYMFONY__ environment variables
2017-03-21 08:27:08 -07:00
Javier Eguiluz e3362e854c Deprecate the special SYMFONY__ environment variables 2017-03-21 08:27:06 -07:00
Robin Chalas c99641a540 Document removal of server:* commands from the framework 2017-03-21 15:47:31 +01:00
Christian Flothmann 731a74e79c [Yaml] deprecate "? " starting unquoted strings 2017-03-20 10:21:06 +01:00
Fabien Potencier c72a4f0a79 bug #21514 301 status code must drop request method to GET. (jlamur)
This PR was merged into the 3.3-dev branch.

Discussion
----------

301 status code must drop request method to GET.

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| BC breaks?    | yes
| Tests pass?   | yes
| Fixed tickets | #20924
| License       | MIT

[RFC 7231 §6.4.2](https://tools.ietf.org/html/rfc7231#section-6.4.2) states that 301 HTTP Code should forward POST requests to the Location URI.

But, it also states that:

> For historical reasons, a user agent MAY change the request method from POST to GET for the subsequent request.

This is the behavior implemented in almost all user agents.
However the `BrowserKit` did forward the method to the subsequent request.

This PR make the `BrowserKit` change the request method from POST to GET when the response status code is 301.

Commits
-------

abda966d75 301 status code must drop request method to GET.
2017-03-14 13:25:39 -07:00
Jules Lamur abda966d75 301 status code must drop request method to GET.
[RFC 7231 §6.4.2](https://tools.ietf.org/html/rfc7231#section-6.4.2) states that 301 HTTP Code should forward POST requests to the Location URI.

But, it also states that:

> For historical reasons, a user agent MAY change the request method from POST to GET for the subsequent request.

This is the behavior implemented in almost all user agents.
However the `BrowserKit` did forward the method to the subsequent request.
2017-03-07 14:08:59 +01:00
Christian Flothmann 3c5d9155d4 deprecate implicit string casting of mapping keys 2017-03-06 20:18:14 +01:00
Robin Chalas 32be16b239 Move RoutingResolverPass to the Routing component 2017-03-05 16:12:05 +01:00
Christian Flothmann 903ee47957 fix upgrade file 2017-03-04 16:15:59 +01:00
Fabien Potencier b118c650a3 feature #21815 [FrameworkBundle][HttpKernel] Move ControllerArgumentValueResolverPass to the HttpKernel component (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle][HttpKernel] Move ControllerArgumentValueResolverPass to the HttpKernel component

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

Commits
-------

8bad8a109c Move ControllerArgumentValueResolverPass to the HttpKernel component
2017-03-04 07:06:49 -08:00
Robin Chalas 8bad8a109c Move ControllerArgumentValueResolverPass to the HttpKernel component 2017-03-03 13:55:06 +01:00
Thierry Thuon 5b0641ebe1 Add deprecation note on routing class parameters 2017-03-01 21:50:23 +01:00
Maxime STEINHAUSSER 5b7fe852aa [Security][SecurityBundle] Enhance automatic logout url generation 2017-03-01 19:01:06 +01:00
Guilhem Niot 597b6bcab6 [DependencyInjection] Use a service locator in AddConstraintValidatorsPass 2017-03-01 08:17:18 -08:00
Robin Chalas 7a7ff24a43 Move PropertyInfoPass to the PropertyInfo component 2017-03-01 09:44:14 +01:00
Fabien Potencier 28a00dac0c feature #19822 [HttpKernel] Deprecate X-Status-Code for better alternative (jameshalsall)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[HttpKernel] Deprecate X-Status-Code for better alternative

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

This marks the X-Status-Code header method of setting a custom response status
code in exception listeners for a better alternative. There is now a new method
on the `GetResponseForExceptionEvent` that allows successful status codes in
the response sent to the client.

The old method of setting the X-Status-Code header will now throw a deprecation warning.

Instead, in your exception listener you simply call `GetResponseForExceptionEvent::allowCustomResponseCode()` which will tell the Kernel not to override the status code of the event's response object.

Currenty the `X-Status-Code` header will still be removed, so as not to change the existing behaviour, but this is something we can remove in 4.0.

TODO:
- [x] Replace usage of X-Status-Code in `FormAuthenticationEntryPoint`
- [x] Open Silex issue
- [x] Rename method on the response
- [x] Ensure correct response code is set in `AuthenticationEntryPointInterface` implementations
- [x] Ensure the exception listeners are marking `GetResponseForExceptionEvent` as allowing a custom response code
- [x] In the Security component we should only use the new method of setting a custom response code if it is available, and fall back to the `X-Status-Code` method

Commits
-------

cc0ef282cd [HttpKernel] Deprecate X-Status-Code for better alternative
2017-02-28 22:52:11 -08:00
Robin Chalas 80867422ac [Console] Explicitly passed options without value (or empty) should remain empty 2017-03-01 00:35:20 +01:00
Fabien Potencier 41fd5d1286 feature #21375 [FrameworkBundle][Config] Move ConfigCachePass from FrameworkBundle to Config (Deamon)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle][Config] Move ConfigCachePass from FrameworkBundle to Config

| Q             | A
| ------------- | ---
| Branch?       | master<!--see comment below-->
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes/no
| Fixed tickets | - <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | <!--highly recommended for new features-->

This MR is part of the #21284 todo list
<!--
- 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.
- Please fill in this template according to the PR you're about to submit.
- Replace this comment by a description of what your PR is solving.
-->

Commits
-------

bce445f452 Move ConfigCachePass from FrameworkBundle to Config
2017-02-28 08:10:35 -08:00
Christian Flothmann 3cfa0c7ecb Revert "feature #21792 [Security] deprecate multiple providers in context listener (xabbuh)"
This reverts commit 924c1f06bf, reversing
changes made to afff0ce43e.
2017-02-28 13:21:14 +01:00
Deamon bce445f452 Move ConfigCachePass from FrameworkBundle to Config 2017-02-28 08:42:35 +01:00
Fabien Potencier 924c1f06bf feature #21792 [Security] deprecate multiple providers in context listener (xabbuh)
This PR was squashed before being merged into the 3.3-dev branch (closes #21792).

Discussion
----------

[Security] deprecate multiple providers in context listener

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

Passing multiple user providers to the context listener does not make
much sense. The listener is only responsible to refresh users for a
particular firewall. Thus, it must only be aware of the user provider
for this particular firewall.

Commits
-------

53df0de7fc [Security] deprecate multiple providers in context listener
fbd9f88e31 [SecurityBundle] only pass relevant user provider
2017-02-27 18:37:47 -08:00
Christian Flothmann 53df0de7fc [Security] deprecate multiple providers in context listener
Passing multiple user providers to the context listener does not make
much sense. The listener is only responsible to refresh users for a
particular firewall. Thus, it must only be aware of the user provider
for this particular firewall.
2017-02-27 23:13:46 +01:00
Robin Chalas 8293b753cf Replace some container injections by service locators 2017-02-26 14:01:31 +01:00
James Halsall cc0ef282cd
[HttpKernel] Deprecate X-Status-Code for better alternative
This marks the X-Status-Code header method of setting a custom response
status code in exception listeners as deprecated. Instead there is now
a new method on the GetResponseForExceptionEvent that allows successful
status codes in the response sent to the client.
2017-02-23 21:30:09 +00:00
Robin Chalas 8d03332726 [SecurityBundle] Don't normalize keys of in-memory users 2017-02-22 18:37:26 +01:00
David Buchmann 2c5f8797b8 add missing changelog for deprecated strict attribute 2017-02-18 18:21:29 +01:00
Guilhem N 313fec952f [PropertyInfo] Make classes final 2017-02-18 09:10:28 +01:00
Christian Flothmann c02dca3483 [Yaml] deprecate parsing mappings without keys 2017-02-17 16:52:41 +01:00
Maxime Steinhausser 366aefd75f [SecurityBundle] UserPasswordEncoderCommand: ask user class choice question 2017-02-16 16:01:42 +01:00
Fabien Potencier 923d50b625 feature #21283 [Form][FrameworkBundle] Move FormPass to the Form component (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Form][FrameworkBundle] Move FormPass to the Form component

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

So that anyone using only Form and DI can use it for registering form types/type guessers.
Follows #19443, related to #21284

Commits
-------

e68a6d963c [FrameworkBundle][Form] Move FormPass to the Form component
2017-02-16 05:34:28 -08:00
Fabien Potencier 846d24ae36 feature #21293 [FrameworkBundle][Serializer] Move SerializerPass to the Serializer (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle][Serializer] Move SerializerPass to the Serializer

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

Part of #21284

Commits
-------

95cf5084c0 [FrameworkBundle][Serializer] Move SerializerPass to the Serializer
2017-02-16 05:30:28 -08:00
WouterJ c02a4c9857 Added a console.ERROR event 2017-02-04 18:07:02 +01:00
Nicolas Grekas 330b61fecb [Process] Accept command line arrays and per-run env vars, fixing signaling and escaping 2017-02-01 23:01:35 +01:00
Fabien Potencier 46daa359ea feature #21470 [Process] Deprecate not inheriting env vars + compat related settings (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Process] Deprecate not inheriting env vars + compat related settings

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

Turning compat on/off is not a feature in itself.

About env vars: if one has unwanted env vars, one will still be able to remove them explicitly for the command. From my experience, not having eg PATH or HTTP_PROXY, etc. is more problematic. I'd prefer people to care about setting/unsetting the environment vars **they know about**, rather than allowing them to start with no ENV and discover later that they missed setting some var.

Commits
-------

df14451a73 [Process] Deprecate not inheriting env vars + compat related settings
2017-02-01 13:16:10 -08:00
Nicolas Grekas b11d391cb7 [DI] Deprecate autowiring-types in favor of aliases 2017-02-01 19:42:39 +01:00
Robin Chalas 5b72cf6950
[Security] Lazy load request matchers 2017-01-31 21:20:22 +01:00