Commit Graph

26276 Commits

Author SHA1 Message Date
Nicolas Grekas 9461750bd0 [Cache] Drop counting hit/miss in ProxyAdapter 2016-05-25 09:47:04 +02:00
Fabien Potencier 7dc1491ec0 bug #18837 [Serializer] AbstractObjectNormalizer: be sure that isAllowedAttribute is called (dunglas)
This PR was submitted for the master branch but it was merged into the 3.1 branch instead (closes #18837).

Discussion
----------

[Serializer] AbstractObjectNormalizer: be sure that isAllowedAttribute is called

| 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

Please merge before the release of 3.1 (potential bug fix)

Commits
-------

29b4115 [Serializer] AbstractObjectNormalizer: be sure that isAllowedAttribute is called
2016-05-24 12:12:38 +02:00
Kévin Dunglas 29b4115d1a [Serializer] AbstractObjectNormalizer: be sure that isAllowedAttribute is called 2016-05-24 12:12:38 +02:00
Fabien Potencier 070a02ca7d bug #18838 [Serializer] ObjectNormalizer: add missing parameters (dunglas)
This PR was submitted for the master branch but it was merged into the 3.1 branch instead (closes #18838).

Discussion
----------

[Serializer] ObjectNormalizer: add missing parameters

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

Please merge before the release of 3.1 (potential bug fix)

Commits
-------

58ac241 [Serializer] ObjectNormalizer: add missing parameters
2016-05-24 12:10:23 +02:00
Kévin Dunglas 58ac241c1d [Serializer] ObjectNormalizer: add missing parameters 2016-05-24 12:10:22 +02:00
Fabien Potencier 330c09b390 Merge branch '3.0' into 3.1
* 3.0:
  [Yaml] fix exception contexts
  People - person singularization
  [Yaml] properly handle unindented collections
  [Serializer] Add test for ignored attributes during denormalization
  chomp newlines only at the end of YAML documents
  Fixed server status command when port has been omitted
  Update UPGRADE FROM 2.x to 3.0
  fix removed commands wording in upgrade file
  Catch \Throwable
  Catch \Throwable
  [DependencyInjection] Avoid generating call_user_func in more cases
  [Validator] Support for DateTimeImmutable
  [FrameworkBundle] update upgrade instructions
  Use levenshtein level for better Bundle matching
  [WebProfilerBundle] Fix CORS ajax security issues
  remove methods that were needed for PHP 5.3
  [DX][DI] Make Autowiring exceptions more future friendly
2016-05-24 12:06:56 +02:00
Fabien Potencier 90dcd92691 Merge branch '2.8' into 3.0
* 2.8:
  [Yaml] fix exception contexts
  People - person singularization
  [Yaml] properly handle unindented collections
  [Serializer] Add test for ignored attributes during denormalization
  chomp newlines only at the end of YAML documents
  Fixed server status command when port has been omitted
  Update UPGRADE FROM 2.x to 3.0
  fix removed commands wording in upgrade file
  Catch \Throwable
  Catch \Throwable
  Use levenshtein level for better Bundle matching
  [WebProfilerBundle] Fix CORS ajax security issues
  [DX][DI] Make Autowiring exceptions more future friendly
2016-05-24 12:03:10 +02:00
Fabien Potencier 5cb0ad3f81 Merge branch '2.7' into 2.8
* 2.7:
  [Yaml] fix exception contexts
  People - person singularization
  [Yaml] properly handle unindented collections
  [Serializer] Add test for ignored attributes during denormalization
  chomp newlines only at the end of YAML documents
  Fixed server status command when port has been omitted
  Update UPGRADE FROM 2.x to 3.0
  Catch \Throwable
  Use levenshtein level for better Bundle matching
  [WebProfilerBundle] Fix CORS ajax security issues
2016-05-24 12:00:02 +02:00
Fabien Potencier eac5868d20 Merge branch '2.3' into 2.7
* 2.3:
  [Yaml] fix exception contexts
  People - person singularization
  [Yaml] properly handle unindented collections
  chomp newlines only at the end of YAML documents
2016-05-24 11:57:18 +02:00
Fabien Potencier 53b7236fa8 bug #18844 [Yaml] fix exception contexts (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

[Yaml] fix exception contexts

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

Commits
-------

9bdaba4 [Yaml] fix exception contexts
2016-05-23 14:56:22 +02:00
Christian Flothmann 9bdaba4801 [Yaml] fix exception contexts 2016-05-23 12:02:40 +02:00
Martin Morávek (moravek.martin) 55d9a7a732 Added people - person inflection 2016-05-23 11:06:27 +02:00
Fabien Potencier 7830fa7dbd bug #18840 [Yaml] properly handle unindented collections (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

[Yaml] properly handle unindented collections

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

Commits
-------

717e1a9 [Yaml] properly handle unindented collections
2016-05-23 11:02:43 +02:00
Fabien Potencier eff863b434 bug #18765 Catch \Throwable (fprochazka)
This PR was merged into the 2.8 branch.

Discussion
----------

Catch \Throwable

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

The first commit is based on symfony/symfony#15949
Depends on symfony/symfony#18813, symfony/symfony#18812

----

I'm new to symfony, so I'm not sure where are all the places where it makes sense to actually catch the throwable and where not. I added most places that seemed logical and when I wasn't sure, I added it anyway. I'm hoping you guys (and girls?) can point out the places where the catch should not be added, I'll fix it and then I can create several PR's for the older branches. A lot of this IMHO should go also to 3.0.

Commits
-------

de671f4 Catch \Throwable
2016-05-23 11:00:59 +02:00
Fabien Potencier f55680b3ab bug #18813 Catch \Throwable (fprochazka)
This PR was merged into the 2.7 branch.

Discussion
----------

Catch \Throwable

| Q             | A
| ------------- | ---
| Branch?       | 2.7, 2.8, 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

Related symfony/symfony#18765, symfony/symfony#15949
Depends on symfony/symfony#18812

Commits
-------

103526b Catch \Throwable
2016-05-23 10:58:41 +02:00
Fabien Potencier fe98cec50e bug #18839 People - person singularization (Keeo)
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes #18839).

Discussion
----------

People - person singularization

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

Bugfix for version 2.8 - more information [#18824]

Commits
-------

02070f9 People - person singularization
2016-05-23 10:52:54 +02:00
Martin Morávek (moravek.martin) 02070f9fd3 People - person singularization 2016-05-23 10:52:53 +02:00
Fabien Potencier f4678599f2 bug #18820 [Config] Allow schemed paths in FileResource (nicolas-grekas)
This PR was merged into the 3.1 branch.

Discussion
----------

[Config] Allow schemed paths in FileResource

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

This is a small new feature fixing a BC break that has been introduced in #17598 on 3.1.
It happens that 3.1 is breaking a `phar` app on our side where we end up doing something like `new FileResource('phar://...')`.

Ping @xabbuh and @javiereguiluz esp.

Commits
-------

c73f34d [Config] Allow schemed path in FileResource
2016-05-23 10:50:05 +02:00
Fabien Potencier 26b79228a6 bug #18828 [Yaml] chomp newlines only at the end of YAML documents (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

[Yaml] chomp newlines only at the end of YAML documents

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

Commits
-------

a4b1fa6 chomp newlines only at the end of YAML documents
2016-05-23 10:48:11 +02:00
Fabien Potencier d8341421af minor #18836 [Serializer] Add test for ignored attributes during denormalization (dunglas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Serializer] Add test for ignored attributes during denormalization

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

Commits
-------

c2f7fed [Serializer] Add test for ignored attributes during denormalization
2016-05-23 10:44:03 +02:00
Christian Flothmann 717e1a9e47 [Yaml] properly handle unindented collections 2016-05-22 18:07:51 +02:00
Kévin Dunglas c2f7fedfd6 [Serializer] Add test for ignored attributes during denormalization 2016-05-22 13:47:44 +02:00
Christian Flothmann a4b1fa6694 chomp newlines only at the end of YAML documents 2016-05-21 09:04:04 +02:00
Nicolas Grekas 7d6e9b20ab minor #18818 fix removed commands wording in upgrade file (xabbuh)
This PR was merged into the 2.8 branch.

Discussion
----------

fix removed commands wording in upgrade file

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

Commits
-------

3234ca4 fix removed commands wording in upgrade file
2016-05-20 17:01:42 +02:00
Nicolas Grekas 95bb8bb6c8 bug #18814 Fixed server status command when port has been omitted (peterrehm)
This PR was submitted for the 2.8 branch but it was merged into the 2.7 branch instead (closes #18814).

Discussion
----------

Fixed server status command when port has been omitted

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

Modified the status command to behave exactly as the server:start command. When the port is omitted in the address argument the default port is added from the port option.

Commits
-------

94e4706 Fixed server status command when port has been omitted
2016-05-20 17:00:42 +02:00
Peter Rehm 94e4706609 Fixed server status command when port has been omitted 2016-05-20 17:00:42 +02:00
Nicolas Grekas 4f7c6ceb60 minor #18772 Update UPGRADE FROM 2.x to 3.0 (bradbyu)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #18772).

Discussion
----------

Update UPGRADE FROM 2.x to 3.0

| Q             | A
| ------------- | ---
| Branch?       | "master"
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | deprecated in 2.7 removed in 3.0
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | http://symfony.com/doc/2.8/reference/forms/types/text.html for starters

You missed the Form max_length option deprecation in several field types (Text, Password, Email, etc...).

Commits
-------

cd66a45 Update UPGRADE FROM 2.x to 3.0
2016-05-20 16:53:18 +02:00
bradbyu cd66a452c6 Update UPGRADE FROM 2.x to 3.0 2016-05-20 16:53:05 +02:00
Nicolas Grekas c73f34d2bc [Config] Allow schemed path in FileResource 2016-05-20 13:48:17 +02:00
Christian Flothmann 3234ca491c fix removed commands wording in upgrade file 2016-05-19 21:50:23 +02:00
Filip Procházka de671f4cb2 Catch \Throwable 2016-05-19 16:01:30 +02:00
Filip Procházka 103526b40f Catch \Throwable 2016-05-19 15:58:47 +02:00
Nicolas Grekas 7bdd50cae6 minor #18682 [DependencyInjection] Avoid generating call_user_func in more cases (realityking)
This PR was submitted for the master branch but it was merged into the 3.0 branch instead (closes #18682).

Discussion
----------

[DependencyInjection] Avoid generating call_user_func in more cases

| 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 is a follow up to #9807 to add the PHP 5.4 only coded I excluded when I split it off #9432.

Commits
-------

2718a6c [DependencyInjection] Avoid generating call_user_func in more cases
2016-05-19 10:07:44 +02:00
Rouven Weßling 2718a6c764 [DependencyInjection] Avoid generating call_user_func in more cases 2016-05-19 10:07:44 +02:00
Nicolas Grekas 5c3962e1b0 bug #18759 [Validator] Support for DateTimeImmutable (krzysiekpiasecki)
This PR was squashed before being merged into the 3.0 branch (closes #18759).

Discussion
----------

[Validator] Support for DateTimeImmutable

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

When validating with DateTime constraint UnexpectedTypeException is thrown for DateTimeImmutable instances.

Why PR?
- DateTimeImmutable behaves like a DateTime. Both implements the same interface DateTimeInterface.
- DateTimeInterface cannot be implemented by the client.

Commits
-------

f49659f [Validator] Support for DateTimeImmutable
2016-05-19 09:37:29 +02:00
Krzysiek Piasecki f49659f137 [Validator] Support for DateTimeImmutable 2016-05-19 09:37:05 +02:00
Nicolas Grekas 39a18cd95d minor #18780 [DX][DependencyInjection] Make Autowiring exceptions more future friendly (lemoinem)
This PR was merged into the 2.8 branch.

Discussion
----------

[DX][DependencyInjection] Make Autowiring exceptions more future friendly

| Q             | A
| ------------- | ---
| Branch?       | 2.8, 3.0
| Bug fix?      | no (forward compatibility)
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | N/A

This is a follow-up on #18766 (3.1, master) and #18691 (2.8, 3.0).

This PR changes the exception messages to the ones introduced in #18766 and #17877. I also unified the tests so they are exactly the same.

This way the error messages will be the same in 2.8 onward.

Commits
-------

834f550 [DX][DI] Make Autowiring exceptions more future friendly
2016-05-19 09:30:57 +02:00
Christian Flothmann d794f2f267 minor #18806 [YAML] Fixed upgrade file (HeahDude)
This PR was merged into the 3.1 branch.

Discussion
----------

[YAML] Fixed upgrade file

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

6bcb74d [YAML] fixed "dump" signature in upgrade file
2016-05-18 14:00:20 +02:00
Jules Pietri 6bcb74d27c [YAML] fixed "dump" signature in upgrade file 2016-05-18 11:23:21 +02:00
Fabien Potencier 2731787e8b bug #18799 Use levenshtein level for better Bundle matching (j0k3r)
This PR was merged into the 2.7 branch.

Discussion
----------

Use levenshtein level for better Bundle matching

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

_I've targetted 2.7 branch since this was introduced in the 2.6 version but the 2.6 isn't maintain anymore._

**TL;DR:** I found unused code in bad bundle exception when Symfony try to find the best bundle to fix the typo. Should we remove that code (and got a potential lower matching bundle name) or keep it and make it work?

-----

I've noticed that a part of the code wasn't used when determining which bundle typo was written on _bad bundle exception_, from https://github.com/symfony/symfony/pull/11210.

```php
$alternative = null;
$shortest = null;
foreach ($bundleNames as $bundleName) {
    // if there's a partial match, return it immediately
    if (false !== strpos($bundleName, $nonExistentBundleName)) {
        return $bundleName;
    }

    $lev = levenshtein($nonExistentBundleName, $bundleName);
    if ($lev <= strlen($nonExistentBundleName) / 3 && ($alternative === null || $lev < $shortest)) {
        $alternative = $bundleName;
    }
}
```

In this snippet, the `$shortest` wasn't update in the `foreach`. Reading the code, I guess it was supposed to add an even better accuracy when multiple bundle matche the typo'd bundle name.

Which mean when an alternative is found, we have to assign the level `$lev` from that match to `$shortest`.

```php
if ($lev <= strlen($nonExistentBundleName) / 3 && ($alternative === null || $lev < $shortest)) {
    $alternative = $bundleName;
    $shortest = $lev;
}
```

Let say you have these bundles: `FoooooBundle` and `FooBundle` and you request the bundle `FoodBundle`.

- Without `$shortest` updated, you'll got a suggestion with `FoooooBundle` (first matching bundle found)
- With `$shortest` upadted, you'll got a suggestion with `FooBundle` (because it has a better level than `FoooooBundle`)

This isn't a _bug fix_ since this is only supposed to help developper but not the final user.

**Question is**: should we keep that level comparison or just remove it?

Commits
-------

ac7f74e Use levenshtein level for better Bundle matching
2016-05-17 20:42:59 +02:00
Fabien Potencier 720dac1fbc minor #18802 [FrameworkBundle] update upgrade instructions (xabbuh)
This PR was merged into the 3.0 branch.

Discussion
----------

[FrameworkBundle] update upgrade instructions

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

Commits
-------

187b645 [FrameworkBundle] update upgrade instructions
2016-05-17 20:41:18 +02:00
Nicolas Grekas fce062adf9 minor #18792 [Cache] Rename nonce to version (nicolas-grekas)
This PR was submitted for the master branch but it was merged into the 3.1 branch instead (closes #18792).

Discussion
----------

[Cache] Rename nonce to version

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

ping @javiereguiluz

Commits
-------

0c8358b [Cache] Rename nonce to version
2016-05-17 19:16:01 +02:00
Nicolas Grekas 0c8358b3fe [Cache] Rename nonce to version 2016-05-17 19:16:01 +02:00
Christian Flothmann 187b645615 [FrameworkBundle] update upgrade instructions 2016-05-17 18:54:36 +02:00
Jeremy Benoist ac7f74ecca Use levenshtein level for better Bundle matching 2016-05-17 15:13:00 +02:00
Fabien Potencier 20d694e6ec bug #18413 [2.7][WebProfilerBundle] Fix CORS ajax security issues (romainneutron)
This PR was merged into the 2.7 branch.

Discussion
----------

[2.7][WebProfilerBundle] Fix CORS ajax security issues

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

The WebProfiler toolbar monitors ajax requests. However, when using cross domain ajax requests, it triggers a security issues `Refused to get unsafe header "X-Debug-Token"` `Refused to get unsafe header "X-Debug-Token-Link"` because if the other app is not a Symfony App configured to expose these headers in CORS.

![image](https://cloud.githubusercontent.com/assets/137574/14225799/f462c09c-f8cf-11e5-925d-88be99945a92.png)

This fixes the issue. It adds a new configuration node to explicitly activate it on purpose.

Commits
-------

f8dd87d [WebProfilerBundle] Fix CORS ajax security issues
2016-05-17 14:55:53 +02:00
Romain Neutron f8dd87d7cc [WebProfilerBundle] Fix CORS ajax security issues 2016-05-16 18:19:08 +02:00
Tobias Schultze 2484087a12 minor #18783 [Console] remove methods that were needed for PHP 5.3 (xabbuh)
This PR was merged into the 3.0 branch.

Discussion
----------

[Console] remove methods that were needed for PHP 5.3

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

Commits
-------

7d9e74e remove methods that were needed for PHP 5.3
2016-05-15 11:45:37 +02:00
Christian Flothmann 7d9e74e340 remove methods that were needed for PHP 5.3 2016-05-14 13:18:56 +02:00
Mathieu Lemoine 834f550263 [DX][DI] Make Autowiring exceptions more future friendly 2016-05-13 15:42:47 -04:00