Commit Graph

27848 Commits

Author SHA1 Message Date
Fabien Potencier
9fc7306f72 feature #19741 [ExpressionLanguage] Making cache PSR6 compliant (Alexandre GESLIN)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[ExpressionLanguage] Making cache PSR6 compliant

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

Adding Cache component compatible ParserCache in ExpressionLanguage component.
I hope you will find it useful :) I would like to make tests also

Commits
-------

a7352ff [ExpressionLanguage] Making cache PSR6 compliant
2016-10-17 11:35:41 -07:00
Fabien Potencier
0ea0958dbe feature #20217 [Serializer] Support specifying format for DateTimeNormalizer::denormalize (teohhanhui)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Serializer] Support specifying format for DateTimeNormalizer::denormalize

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

Commits
-------

ff23924 [Serializer] Support specifying format for DateTimeNormalizer::denormalize
2016-10-17 07:13:55 -07:00
Teoh Han Hui
ff2392423b
[Serializer] Support specifying format for DateTimeNormalizer::denormalize 2016-10-17 16:06:12 +08:00
Fabien Potencier
f9bb4abd25 feature #19452 Remove the new SecurityUserValueResolver (weaverryan)
This PR was merged into the 3.2-dev branch.

Discussion
----------

Remove the new SecurityUserValueResolver

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no (the feature hasn't been released yet)
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Hi guys!

This is a revert for #18510 (ping @iltar), which is a nice idea, but will have some big practical implications:

1) You are only allowed to type-hint the argument with `UserInterface` exactly. For the 90% of Symfony project's that user a User entity for their User, this will be weird: I'll receive a `UserInterface`, that immediately call methods on it that aren't in the interface (and also, your IDE won't give you auto-completion). And as #18510 mentions, we can't allow people to type-hint their concrete `User` class, because this will conflict with SensioFWExtraBundle ParamConverter if there is a user id in the URL

2) Deprecating and removing `$this->getUser()` in a controller is a step back. Where we can, let's make controllers and services act *more* like each other. You can't call `$this->getUser()` in a service, but at least if you look at this method in `Controller`, you can see that it uses `security.token_storage` - which is how you will get the User object if you need it from within services.

Sorry for being late on this original issue! It looked good to me at first :).

Cheers!

Commits
-------

da7daee Removing the Controller::getUser() deprecation
2016-10-15 07:40:11 -07:00
Ryan Weaver
da7daee407 Removing the Controller::getUser() deprecation 2016-10-14 19:46:34 -04:00
Nicolas Grekas
870c302199 Merge branch '3.1'
* 3.1:
  Fix deps merge
2016-10-14 11:45:08 +02:00
Nicolas Grekas
af10027906 Merge branch '2.8' into 3.1
* 2.8:
  Fix deps merge
2016-10-14 11:44:55 +02:00
Nicolas Grekas
d24c340231 Fix deps merge 2016-10-14 11:42:19 +02:00
Nicolas Grekas
115a37999f bug #20214 Fix/broken merging of parameter bag env placeholders (mickadoo)
This PR was squashed before being merged into the 3.2-dev branch (closes #20214).

Discussion
----------

Fix/broken merging of parameter bag env placeholders

| Q             | A
| ------------- | ---
| Branch?       | "master"
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #20213
| License       | MIT
| Doc PR        | reference to the documentation PR, if any

In PR https://github.com/symfony/symfony/pull/20199 I made changes after review that broke the use of env variables, sorry about that - should have checked it a bit more before making the changes.

@nicolas-grekas, I know you're very busy with all that merging, but if you could take a look at this it would be great since you know most about it.

Commits
-------

b53e0de Fix/broken merging of parameter bag env placeholders
2016-10-14 11:11:11 +02:00
Michael Devery
b53e0de8f0 Fix/broken merging of parameter bag env placeholders 2016-10-14 11:11:06 +02:00
Fabien Potencier
69e86547d4 feature #15002 [DoctrineBridge] Add a way to select the repository used by the UniqueEntity validator (ogizanagi)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[DoctrineBridge] Add a way to select the repository used by the UniqueEntity validator

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #12573, #4087, #12977
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/7057

This is a cherry pick of #12977 on ~~2.8~~ 3.2 branch, as it is clearly a new feature, even if it was primary introduced in order to fix an inappropriate behavior that might be considered as a bug.

Commits
-------

00d5459 [Doctrine] [Bridge] Add a way to select the repository used by the UniqueEntity validator
2016-10-13 20:17:35 -07:00
Fabien Potencier
ac3eb5d91f Merge branch '3.1'
* 3.1:
  fixed typo
  [HttpCache] fix: do not cache OPTIONS request
  fixed CS
  Prevent infinite loop in PropertyMetadata
2016-10-13 18:32:06 -07:00
Fabien Potencier
5c5af47914 Merge branch '2.8' into 3.1
* 2.8:
  fixed typo
  [HttpCache] fix: do not cache OPTIONS request
  fixed CS
  Prevent infinite loop in PropertyMetadata
2016-10-13 18:31:28 -07:00
Fabien Potencier
c0ed0cbdff Merge branch '2.7' into 2.8
* 2.7:
  fixed typo
  [HttpCache] fix: do not cache OPTIONS request
  fixed CS
  Prevent infinite loop in PropertyMetadata
2016-10-13 18:30:48 -07:00
Fabien Potencier
0f76683d33 minor #20183 Changed mentions of 'symfony2' to 'symfony' (a-ast)
This PR was merged into the 3.2-dev branch.

Discussion
----------

Changed mentions of 'symfony2' to 'symfony'

| Q             | A
| ------------- | ---
| Branch?       | 3.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

Mentions of Symfony2 could be confusing for developers.
I changed
1. Surrogate capability name from 'symfony2' to 'symfony'
2. User Agent of BrowerKit Client from 'Symfony2 BrowserKit' to 'Symfony BrowserKit'
3. 'symfony2 is fun' in StopwatchExtensionTest. Not only Symfony2 is fun. Symfony3 is even more fun.

Commits
-------

6ebd03d Changed mentions of 'symfony2' to 'symfony'
2016-10-13 18:29:39 -07:00
Fabien Potencier
f76e77f924 fixed typo 2016-10-13 18:29:00 -07:00
Fabien Potencier
55c3f89ef1 bug #20205 [HttpCache] fix: do not cache OPTIONS request (dmaicher)
This PR was merged into the 2.7 branch.

Discussion
----------

[HttpCache] fix: do not cache OPTIONS request

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

The HttpCache should not cache any OPTIONS request as they are by spec not cacheable (mentioned here https://github.com/symfony/symfony/issues/20202#issuecomment-253033144 by @xabbuh).

Commits
-------

c43de7f [HttpCache] fix: do not cache OPTIONS request
2016-10-13 18:28:24 -07:00
David Maicher
c43de7f21a [HttpCache] fix: do not cache OPTIONS request 2016-10-13 22:14:35 +02:00
Fabien Potencier
df138fb636 fixed CS 2016-10-13 07:02:27 -07:00
Fabien Potencier
705a4f7e91 bug #20146 [Validator] Prevent infinite loop in PropertyMetadata (wesleylancel)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #20146).

Discussion
----------

[Validator] Prevent infinite loop in PropertyMetadata

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

This commit fixes a possible infinite loop in PropertyMetadata when the PropertyMetadata class was constructed with an existing property of class and later used (after being serialized and cached) on that same class while that property no longer existing. `get_parent_class` will return false when there is no parent class and `property_existing` will then keeping return false causing the `while` loop to be infinite.

Commits
-------

c1ae7b6 Prevent infinite loop in PropertyMetadata
2016-10-13 07:00:51 -07:00
Wesley Lancel
c1ae7b6ad7 Prevent infinite loop in PropertyMetadata 2016-10-13 07:00:50 -07:00
Andrey Astakhov
6ebd03de9c Changed mentions of 'symfony2' to 'symfony'
- Changed surrogate capability name to symfony
- Changed user agent of the BrowserKit Client to 'Symfony BrowserKit'
- Changed 'symfony2' to 'symfony' in timing templates
- Updated changelog and upgrade files
2016-10-13 15:35:11 +02:00
Nicolas Grekas
f065095db7 Merge branch '3.1'
* 3.1:
  [travis] Test on PHP 7.1
  simplified code
  Remove unused variable
  3.0 Upgrade Guide: Added Table of Contents
  [HttpFoundation] add missing upgrade entry
  [FrameworkBundle] Convert null prefix to an empty string in translation:update command
  Improved the deprecation messages for service aliases
  [Serializer] minor: Remove an extra space in a YamlFileLoader error
  [HttpKernel] Clean ArgumentMetadataFactory::getType()
  [PropertyInfo] Fix edge cases in ReflectionExtractor
2016-10-13 08:29:04 +02:00
Nicolas Grekas
6d329d99fd Merge branch '2.8' into 3.1
* 2.8:
  [travis] Test on PHP 7.1
  simplified code
  Remove unused variable
  [FrameworkBundle] Convert null prefix to an empty string in translation:update command
  [PropertyInfo] Fix edge cases in ReflectionExtractor
2016-10-13 08:28:43 +02:00
Nicolas Grekas
7108c375a2 Merge branch '2.7' into 2.8
* 2.7:
  [travis] Test on PHP 7.1
  [FrameworkBundle] Convert null prefix to an empty string in translation:update command
2016-10-13 08:28:24 +02:00
Nicolas Grekas
ab6f181cb4 minor #19971 [travis] Test on PHP 7.1 (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[travis] Test on PHP 7.1

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Tests pass?   | let's see
| License       | MIT

PHP 7.1 RC2 has been released today.

Commits
-------

6602e21 [travis] Test on PHP 7.1
2016-10-13 08:03:00 +02:00
Nicolas Grekas
6602e21a9c [travis] Test on PHP 7.1 2016-10-13 07:51:16 +02:00
Fabien Potencier
aaab30ea80 simplified code 2016-10-12 18:43:15 -07:00
Fabien Potencier
eac27275b1 minor #20185 Remove unused variable (lin-lu)
This PR was submitted for the master branch but it was merged into the 2.8 branch instead (closes #20185).

Discussion
----------

Remove unused variable

Remove unused variable $key.

Commits
-------

129694f Remove unused variable
2016-10-12 18:42:27 -07:00
Lin Lu
129694f650 Remove unused variable 2016-10-12 18:42:26 -07:00
Fabien Potencier
6576ce7827 minor #20203 3.0 Upgrade Guide: Added Table of Contents (smithandre)
This PR was submitted for the master branch but it was merged into the 3.1 branch instead (closes #20203).

Discussion
----------

3.0 Upgrade Guide: Added Table of Contents

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

Added a table of contents, which helps me find relevant upgrade information a bit faster.  It's very basic and straight forward, as I don't want to add too much overhead in terms of maintaining these guides.

Commits
-------

3a458d3 3.0 Upgrade Guide: Added Table of Contents
2016-10-12 18:36:50 -07:00
Andre Smith
3a458d3823 3.0 Upgrade Guide: Added Table of Contents 2016-10-12 18:36:50 -07:00
Fabien Potencier
76817cdb70 minor #20209 [HttpFoundation] add missing upgrade entry (xabbuh)
This PR was merged into the 3.1 branch.

Discussion
----------

[HttpFoundation] add missing upgrade entry

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

Commits
-------

e116d3d [HttpFoundation] add missing upgrade entry
2016-10-12 13:30:28 -07:00
Christian Flothmann
e116d3d76d [HttpFoundation] add missing upgrade entry 2016-10-12 19:01:06 +02:00
Fabien Potencier
bf2ff76d86 minor #20196 [SecurityBundle] Cache contexts per request in FirewallMap (chalasr)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[SecurityBundle] Cache contexts per request in FirewallMap

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

From @HeahDude in https://github.com/symfony/symfony/pull/19819#r77274093, I propose to store and retrieve `Context` objects per `Request` using `SplObjectStorage`.

At the moment, contexts are consumed by the `Symfony\Components\Security\Http\Firewall` class only, but they could be indirectly by end users if #19490 and/or #19819 come to be merged.

Commits
-------

ffacec1 [SecurityBundle] Cache contexts per request in FirewallMap
2016-10-11 19:18:53 -07:00
Fabien Potencier
4cc24240c5 minor #20206 [TwigBridge] update the upgrade instructions (xabbuh)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[TwigBridge] update the upgrade instructions

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

2a970ce [TwigBridge] update the upgrade instructions
2016-10-11 18:40:21 -07:00
Christian Flothmann
2a970ceafb [TwigBridge] update the upgrade instructions 2016-10-11 22:49:30 +02:00
Fabien Potencier
406462f895 bug #20199 [DependencyInjection] Fix duplication of placeholders (mickadoo)
This PR was squashed before being merged into the 3.2-dev branch (closes #20199).

Discussion
----------

[DependencyInjection] Fix duplication of placeholders

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  |no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #20198
| License       | MIT
| Doc PR        | reference to the documentation PR, if any

Fixes performance issues related to merging parameter bags when using the `env()` parameters introduced in #19681

Commits
-------

124f30d [DependencyInjection] Fix duplication of placeholders
2016-10-11 08:16:26 -07:00
Michael Devery
124f30d4c6 [DependencyInjection] Fix duplication of placeholders 2016-10-11 08:16:23 -07:00
Robin Chalas
ffacec12c3
[SecurityBundle] Cache contexts per request in FirewallMap 2016-10-10 23:02:34 +02:00
Fabien Potencier
3f650f864c bug #20184 [FrameworkBundle] Convert null prefix to an empty string in translation:update (chalasr)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Convert null prefix to an empty string in translation:update

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

This command needs the ability to use an empty string as prefix, which is not possible using `bin/console translation:update --prefix=""` because `$argv` doesn't parse empty strings thus the value is converted to `null` by `ArgvInput` (only since #19946, before the option was not considered to be set, giving the default `'__'` thus this should be fine from a BC pov).

Here I propose to explicitly convert the `prefix` value to an empty string if set to `null`, as it is a very specific need and we can't guess that from `ArgvInput`.
An other way to fix it could be to add a `--no-prefix` option to the command but I don't think it is worth it, and it couldn't be treated as a bug fix thus not fixed before `3.2`.

Commits
-------

f02b687 [FrameworkBundle] Convert null prefix to an empty string in translation:update command
2016-10-09 04:27:22 -07:00
Robin Chalas
f02b6876b4
[FrameworkBundle] Convert null prefix to an empty string in translation:update command 2016-10-09 13:14:32 +02:00
Fabien Potencier
a5d134b136 minor #20172 [Cache] Accept only array in TagAwareAdapter::invalidateTags() (nicolas-grekas)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[Cache] Accept only array in TagAwareAdapter::invalidateTags()

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

Just to be sure that we won't suffer from some stupid incompatibility if a cache-tags PSR is published one day. See discussion: https://github.com/symfony/symfony/issues/19728#issuecomment-251674712

Commits
-------

a08acc7 [Cache] Accept only array in TagAwareAdapter::invalidateTags()
2016-10-09 04:12:45 -07:00
Fabien Potencier
eee1a446cd feature #20113 Use the method map as authoritative list of factories for dumped containers (stof)
This PR was merged into the 3.2-dev branch.

Discussion
----------

Use the method map as authoritative list of factories for dumped containers

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | only for weird broken cases
| Deprecations? | yes (but only for people doing weird things)
| Tests pass?   | yes
| Fixed tickets | #11761, #19690
| License       | MIT
| Doc PR        | n/a

The initial implementation of the method factory discovery was based on a naming convention for factory methods. However, this naming convention allowed to generate the same name for multiple ids. In the meantime, a method map was introduced to solve this issue (and others).
When accessing a service with a different id than the official one (thanks to ambiguities), this breaks the sharing of the service, as it creates a new instance each time and replaces the existing shared instance. This was also inconsistent between a dumped container (affected by this) and a non-dumped container (reporting a service not found error for the other id).

The method map is now the authoritative way to discover available service factories. When the dumped container was generated with a method map (which is the case when using the dumper shipped in the component), the logic based on defined methods is not executed anymore. This forbids using another id than the real one to access the service (preventing to trigger the broken behavior). So this breaks BC for people being lucky (i.e. they were using the broken id only once and *before* any usage of the official id) and fixes a WTF bug for all others.
When using a dumper which does not fill the method map, the old logic is still applied, but deprecation warnings are triggered on access to dumped services. Currently, this will trigger a deprecation warning for each new service instantiation. I have not found an easy way to trigger it only once (except adding a private property to remember we already triggered it, but is it worth it ?), but only people writing a project container by hand or writing their own dumper would ever see such deprecation anyway (as the core dumper generates the method map).

Additionally, this makes ``getServiceIds`` faster by avoiding doing a regex match for each method in the class.

Commits
-------

03b9108 Use the method map as authoritative list of factories for dumped containers
2016-10-08 11:47:22 -07:00
Fabien Potencier
451cdac477 minor #20186 [HttpKernel] removed implicit dep on Console (fabpot)
This PR was merged into the 3.2-dev branch.

Discussion
----------

[HttpKernel] removed implicit dep on Console

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

HttpKernel does not have console as a dependency, so we must ensure that this is not implicitly required (`DebugHandlersListener` already has this check).

Commits
-------

414206d [HttpKernel] removed implicit dep on Console
2016-10-08 11:41:43 -07:00
Fabien Potencier
414206db89 [HttpKernel] removed implicit dep on Console 2016-10-08 09:57:37 -07:00
maxime.steinhausser
00d54597ca [Doctrine] [Bridge] Add a way to select the repository used by the UniqueEntity validator
The new option expects an entity path, in order to select its repository.
This allows to properly use the UniqueEntity constraint on hierarchical (inheritance) entities, using the root class repository in order to check the uniqueness, and not just the child repository.
2016-10-08 00:45:53 +02:00
Fabien Potencier
e9c30f537a minor #20182 Fix typo in copyright comment (chalasr)
This PR was merged into the 3.2-dev branch.

Discussion
----------

Fix typo in copyright comment

| Q             | A
| ------------- | ---
| Branch?       | master
| Tests pass?   | yes
| License       | MIT

This was merged on 3.2 in #20127

Commits
-------

8619c7f Fix typo in copyright comment
2016-10-07 15:27:01 -07:00
Fabien Potencier
98e627a7af minor #20180 Improved the deprecation messages for service aliases (javiereguiluz)
This PR was squashed before being merged into the 3.1 branch (closes #20180).

Discussion
----------

Improved the deprecation messages for service aliases

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

Commits
-------

b1b21bf Improved the deprecation messages for service aliases
2016-10-07 15:26:03 -07:00
Javier Eguiluz
b1b21bf43d Improved the deprecation messages for service aliases 2016-10-07 15:26:02 -07:00