Commit Graph

29365 Commits

Author SHA1 Message Date
Nicolas Grekas
8a37722adb [ClassLoader] Deprecated the component 2017-01-20 11:22:07 +01:00
Kévin Dunglas
dc115ab91b
[DependencyInjection] XML: optimize defaults parsing 2017-01-20 11:07:17 +01:00
Kévin Dunglas
5cf76f774c
[DependencyInjection] Fix return of YamlFileLoader::parseDefaults 2017-01-20 01:22:02 +01:00
Fabien Potencier
922b7c1a54 bug #21338 [Cache] Fix tags expiration (nicolas-grekas)
This PR was merged into the 3.2 branch.

Discussion
----------

[Cache] Fix tags expiration

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

Commits
-------

c0022f29d6 [Cache] Fix tags expiration
2017-01-19 10:47:58 -08:00
Nicolas Grekas
63b8d31885 minor #21342 [DependencyInjection] YAML: reduce the complexity of the _defaults parser (dunglas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DependencyInjection] YAML: reduce the complexity of the _defaults parser

| 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

Commits
-------

130fa1f [DependencyInjection] YAML: reduce the complexity of the _defaults parser
2017-01-19 19:39:41 +01:00
Fabien Potencier
77289b9023 bug #21333 [HttpKernel] Fix ArgumentValueResolver for arguments default null (chalasr)
This PR was merged into the 2.7 branch.

Discussion
----------

[HttpKernel] Fix ArgumentValueResolver for arguments default null

| 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

If an argument has `null` as default value __and annotations are used for routing__, then it is not resolved by the ArgumentResolver e.g:

```php

public function showAction(Request $request) {
   dump($request); // Request object
}

public function showAction(?Request $request) {
   dump($request); // Request object
}

public function showAction(Request $request = null) {
   dump($request); // null
}
```
To me, the last example should have been a Request object too.

Note that it is the same behavior when using `UserInterface` or whatever, I ran into this issue while trying to dump a user for a route accepting both anonymous and authenticated requests, the argument was always null while `$this->getUser()` returned the expected value. According to http://symfony.com/blog/new-in-symfony-3-2-user-value-resolver-for-controllers it should have worked through the argument.

I propose to make it works as a bugfix.
Any suggestion for improving the patch will be really welcomed. ping @iltar

Commits
-------

d3fa8a1859 Avoid setting request attributes from signature arguments in AnnotationClassLoader
2017-01-19 09:09:26 -08:00
Kévin Dunglas
130fa1f4f7
[DependencyInjection] YAML: reduce the complexity of the _defaults parser 2017-01-19 17:27:08 +01:00
Robin Chalas
d3fa8a1859 Avoid setting request attributes from signature arguments in AnnotationClassLoader 2017-01-19 17:02:55 +01:00
Fabien Potencier
5ba84cab08 minor #21346 [DependencyInjection] Add some missing typehints in YamlFileLoader (dunglas)
This PR was merged into the 2.7 branch.

Discussion
----------

[DependencyInjection] Add some missing typehints in YamlFileLoader

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

34330e5136 [DependencyInjection] Add some missing typehints in YamlFileLoader
2017-01-19 07:37:36 -08:00
Fabien Potencier
6148457502 minor #21345 [DependencyInjection] minor: Fix a param type (dunglas)
This PR was merged into the 2.7 branch.

Discussion
----------

[DependencyInjection] minor: Fix a param type

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

c82aa84c26 [DependencyInjection] minor: Fix a DocBlock
2017-01-19 07:37:02 -08:00
Kévin Dunglas
34330e5136
[DependencyInjection] Add some missing typehints in YamlFileLoader 2017-01-19 14:51:14 +01:00
Kévin Dunglas
c82aa84c26
[DependencyInjection] minor: Fix a DocBlock 2017-01-19 14:34:44 +01:00
Nicolas Grekas
6acb80f48f [DI] Factorize compiler passes around new AbstractRecursivePass 2017-01-18 21:44:53 +01:00
Fabien Potencier
419bcf6c58 bug #20871 [HttpKernel] Give higher priority to adding request formats (akeeman)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #20871).

Discussion
----------

[HttpKernel] Give higher priority to adding request formats

| Q             | A
| ------------- | ---
| Branch?       | 3.2
| Bug fix?      | yes
| New feature?  | yes
| BC breaks?    | yes (unlikely to break projects*)
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | not documented

\* Only applies to the unlikely case where formats are used before this event is loaded key. Users must have specified custom formats, and actually using them should then break their application. I think that's an unlikely case.

## Problem
It's possible to extend the formats known by the `Request` using a piece of config:
```yaml
framework:
    request:
        formats:
            json: 'application/merge-patch+json'
```

Using this in a `kernel.request` event is currently not possible, as it loads after any custom events.

## Offered solution
Increasing the priority of the AddRequestFormatsListener listener resolves this problem.
This change only impacts projects that use the `framework.request.formats` configuration key, as the listener is not loaded if it isn't defined.

Commits
-------

9edb457e44 [HttpKernel] Give higher priority to adding request formats
2017-01-18 11:53:10 -08:00
Arjan Keeman
9edb457e44 [HttpKernel] Give higher priority to adding request formats 2017-01-18 11:53:09 -08:00
Fabien Potencier
bfdac85304 bug #21332 [PropertyInfo] Don't try to access a property thru a static method (dunglas)
This PR was merged into the 2.8 branch.

Discussion
----------

[PropertyInfo] Don't try to access a property thru a static method

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

See also #21331.

Commits
-------

3b4858fe88 [PropertyInfo] Don't try to access a property thru a static method
2017-01-18 11:21:25 -08:00
Fabien Potencier
4491eb6463 feature #21334 [Workflow] Introduce concept of SupportStrategyInterface (andesk, lyrixx)
This PR was merged into the 3.3-dev branch.

Discussion
----------

 [Workflow] Introduce concept of SupportStrategyInterface

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

Commits
-------

134a58b4c4 [Workflow] Fixed code and tests
184301206f [Workflow] Introduce concept of SupprtStrategyInterface to allow other support checks than class instance
2017-01-18 11:12:00 -08:00
Fabien Potencier
6283fc41fd bug #21336 [PhpUnit] Blacklist DeprecationErrorHandler in stack traces (nicolas-grekas)
This PR was merged into the 3.2 branch.

Discussion
----------

[PhpUnit] Blacklist DeprecationErrorHandler in stack traces

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

So that phpunit doesn't tell about DeprecationErrorHandler in failure's stack traces.

Commits
-------

3f693aeb86 [PhpUnit] Blacklist DeprecationErrorHandler in stack traces
2017-01-18 08:05:17 -08:00
Grégoire Pineau
134a58b4c4 [Workflow] Fixed code and tests 2017-01-18 17:03:37 +01:00
Nicolas Grekas
c0022f29d6 [Cache] Fix tags expiration 2017-01-18 16:46:19 +01:00
Fabien Potencier
0ca3e96d13 bug #21331 [PropertyInfo] Exclude static methods form properties guessing (dunglas)
This PR was merged into the 2.8 branch.

Discussion
----------

[PropertyInfo] Exclude static methods form properties guessing

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

Commits
-------

190c736d3c [PropertyInfo] Exclude static methods form properties guessing
2017-01-18 07:18:26 -08:00
Fabien Potencier
d0da74ef0b minor #21329 Added WebVTT to the list of MIME type extensions (javiereguiluz)
This PR was merged into the 3.3-dev branch.

Discussion
----------

Added WebVTT to the list of MIME type extensions

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

This is not included in the Apache list of MIME types ... but the related standard looks pretty serious:

* https://developer.mozilla.org/en-US/docs/Web/API/WebVTT_API
* https://w3c.github.io/webvtt/

Commits
-------

9e2a111e4b Added WebVTT to the list of MIME type extensions
2017-01-18 07:15:43 -08:00
Nicolas Grekas
3f693aeb86 [PhpUnit] Blacklist DeprecationErrorHandler in stack traces 2017-01-18 16:07:33 +01:00
Andreas Kleemann
184301206f [Workflow] Introduce concept of SupprtStrategyInterface to allow other support checks than class instance 2017-01-18 14:25:21 +01:00
Kévin Dunglas
3b4858fe88
[PropertyInfo] Don't try to access a property thru a static method 2017-01-18 13:18:58 +01:00
Kévin Dunglas
190c736d3c
[PropertyInfo] Exclude static methods form properties guessing 2017-01-18 13:05:57 +01:00
Javier Eguiluz
9e2a111e4b Added WebVTT to the list of MIME type extensions 2017-01-18 10:20:49 +01:00
James Halsall
9896547a4d
Add basic support for automatic console exception logging 2017-01-18 08:53:03 +01:00
Fabien Potencier
5921530a1a fixed a CS 2017-01-17 21:51:21 -08:00
Fabien Potencier
cf7d2f2c57 feature #20390 [Ldap] added Ldap entry rename for ExtLdap adapter (fruitwasp)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Ldap] added Ldap entry rename for ExtLdap adapter

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

Commits
-------

2d8eeb200f [LDAP] implemented LDAP entry rename for ExtLdap adapter
2017-01-17 21:50:56 -08:00
Fabien Potencier
e823e85a7c feature #21065 Added cache data collector and profiler page (Nyholm)
This PR was squashed before being merged into the 3.3-dev branch (closes #21065).

Discussion
----------

Added cache data collector and profiler page

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

Adding a first version of cache profiler page. Most things are taken from PHP-cache.
FYI: @aequasi

### What is included?

A collector, recording adapter and a profiler page.

![screen shot 2016-12-27 at 16 07 35](https://cloud.githubusercontent.com/assets/1275206/21502325/4bee2ed4-cc4f-11e6-89fc-37ed16aca864.png)
![screen shot 2016-12-27 at 16 07 45](https://cloud.githubusercontent.com/assets/1275206/21502326/4bee9450-cc4f-11e6-904d-527b7b0ce85b.png)

### What is not included?

* A good logo
* Nice design on the profiler page

This PR aims to pass as the minimum requirement for a cache page. Im happy to do fancy extra features but those should be a different PR.

Commits
-------

7497f1c6b6 Added cache data collector and profiler page
2017-01-17 21:46:26 -08:00
Tobias Nyholm
7497f1c6b6 Added cache data collector and profiler page 2017-01-17 21:46:25 -08:00
Fabien Potencier
24f0fd0dda bug #21280 [Workflow] Fixed support of multiple transitions with the same name. (lyrixx)
This PR was merged into the 3.2 branch.

Discussion
----------

[Workflow] Fixed support of multiple transitions with the same name.

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

---

The previous behavior was underterministic because it took the first
transition during the `can` and the `apply` method. But the "first"
does not mean anything. Now the workflown apply all possible transitions
with the same name.

Commits
-------

edd5431e6e [Workflow] Fixed support of multiple transition with the same name.
2017-01-17 21:35:58 -08:00
Fabien Potencier
30a01437d4 bug #21271 [Workflow] Added new validator to make sure each place has unique translation names (Nyholm)
This PR was submitted for the master branch but it was merged into the 3.2 branch instead (closes #21271).

Discussion
----------

[Workflow] Added new validator to make sure each place has unique translation names

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

A definition where a place that has transitions with the same name is an invalid definition.

```yaml
invalid1:
  places: ['a', 'b', 'c']
  transitions:
    t1:
      from: a
      to: b
    t1:
      from: a
      to: c

valid1:
  places: ['a', 'b', 'c']
  transitions:
    t1:
      from: a
      to: b
    t2:
      from: a
      to: c

valid2:
  places: ['a', 'b', 'c']
  transitions:
    t1:
      from: a
      to: b
    t1:
      from: b
      to: c

valid3:
  places: ['a', 'b', 'c', 'd']
  transitions:
    t1:
      from: ['a', 'b']
      to: d
    t2:
      from: ['a', 'b']
      to: c
```

FYI @lyrixx

Commits
-------

eece8adfdd [Workflow] Added new validator to make sure each place has unique translation names
2017-01-17 21:32:36 -08:00
Tobias Nyholm
eece8adfdd [Workflow] Added new validator to make sure each place has unique translation names 2017-01-17 21:32:36 -08:00
Fabien Potencier
71f8f1546f bug #21312 [DI] Do not set values of lazy arguments after inlining them (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Do not set values of lazy arguments after inlining them

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

Commits
-------

04da7c30d9 [DI] Do not inline values of lazy arguments
2017-01-17 21:25:27 -08:00
Fabien Potencier
9d09059cb5 bug #21323 [Cache] [PdoAdapter] Fix MySQL 1170 error (blob as primary key) (akeeman)
This PR was submitted for the master branch but it was merged into the 3.2 branch instead (closes #21323).

Discussion
----------

[Cache] [PdoAdapter] Fix MySQL 1170 error (blob as primary key)

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

When using a Doctrine\DBAL\Connection to initialize the PdoAdapter, PdoAdapter::createTable tries to create a table using a blob field as primary key. [This is not an option for MySQL](https://techjourney.net/mysql-error-1170-42000-blobtext-column-used-in-key-specification-without-a-key-length/), resulting in an exeption: `Syntax error or access violation: 1170 BLOB/TEXT column 'item_id' used in key specification without a key length`. This commit supplies a way to act like the non-Connection way creates the table does.

Commits
-------

08c6a650b9 [Cache] [PdoAdapter] Fix MySQL 1170 error (blob as primary key)
2017-01-17 15:05:43 -08:00
Arjan Keeman
08c6a650b9 [Cache] [PdoAdapter] Fix MySQL 1170 error (blob as primary key) 2017-01-17 15:05:43 -08:00
Robin Chalas
04da7c30d9
[DI] Do not inline values of lazy arguments 2017-01-17 22:10:00 +01:00
Fabien Potencier
1dfb1080b2 minor #21324 [FrameworkBundle] Fix third level headers for MarkdownDescriptor (ogizanagi)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Fix third level headers for MarkdownDescriptor

| 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

`~` is not valid as an underlining char when using markdown on the contrary of reStructuredText.
See the rendering of [builder_1_public.md (before)](https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.md)  vs [builder_1_public.md (after)](https://github.com/ogizanagi/symfony/blob/fix/2.7/fwb/md_third_lvl_headers/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.md) for instance.

This PR fixes it by using a third level header.

~~**EDIT:** There is no BC break. Wrong PR template information.~~

Commits
-------

ce29ab1d92 [FrameworkBundle] Fix third level headers for MarkdownDescriptor
2017-01-17 12:04:54 -08:00
Maxime Steinhausser
ce29ab1d92 [FrameworkBundle] Fix third level headers for MarkdownDescriptor 2017-01-17 19:39:37 +01:00
Fabien Potencier
84d0da2502 bug #21318 Don't add csp-headers if none are required (arjenm)
This PR was merged into the 3.2 branch.

Discussion
----------

Don't add csp-headers if none are required

| Q             | A
| ------------- | ---
| Branch?       | 3.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | This PR is also the ticket
| License       | MIT

In 3.2 a tool to adjust Content Security Policy headers in combination with the WebProfiler was added. We encountered a bug in its behavior.
We had CSP-headers that did not have a script-src/style-src nor a default-src (it was something like `form-action: https:`). In that scenario, the ContentSecurityPolicyHandler would add `script-src: 'unsafe-inline' 'nonce-....'`, but that would actually change the "everything is allowed scenario" into "only inline and nonce-... is allowed". The result was _only_ the javascript of WebProfiler was allowed, rather than everything.

This PR fixes the scenario where no default-src nor a script-src/style-src is provided. It simply continue's rather than treats it as an empty list of rules that need additional rules.

~A bug I did find, but not fix, is the fact that that `'unsafe-inline'` is ignored in at least Firefox and Chrome due to the fact there is also a nonce-element in the rule.~

Commits
-------

6fecc94103 Don't add csp-headers if none are required
2017-01-17 07:09:27 -08:00
Fabien Potencier
0dd6a906ea bug #21291 [Ldap] Ldap username case fix (quentinus95)
This PR was submitted for the master branch but it was merged into the 3.1 branch instead (closes #21291).

Discussion
----------

[Ldap] Ldap username case fix

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

Commits
-------

c91689ba2d [Ldap] Using Ldap stored username instead of form submitted one
6641b79d58 [Ldap] load users with the good username case
2017-01-17 07:06:58 -08:00
Quentin de Longraye
c91689ba2d [Ldap] Using Ldap stored username instead of form submitted one 2017-01-17 07:06:58 -08:00
Quentin de Longraye
6641b79d58 [Ldap] load users with the good username case 2017-01-17 07:06:58 -08:00
Jakub Zalas
d3b5d8efdf
Fix tests with ICU 57.1 2017-01-17 14:48:15 +00:00
Jakub Zalas
677d820874
Fix the condition checking the minimum ICU version 2017-01-17 13:59:23 +00:00
Arjen van der Meijden
6fecc94103 Don't add csp-headers if none are required 2017-01-17 09:49:30 +01:00
Nicolas Grekas
87dcda896c bug #21311 [Debug] Fix fatal error when changing ErrorHandler loggers if an exception is buffered (skalpa)
This PR was merged into the 3.2 branch.

Discussion
----------

[Debug] Fix fatal error when changing ErrorHandler loggers if an exception is buffered

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

Prevents a fatal error when setting a new logger if the bootstrapping logger buffered an exception that does not extend `ErrorException`.

@nicolas-grekas The faulty behaviour was added by 8f245493f4, so this PR is against 3.2 and not 2.8.

Commits
-------

a6527f8 [Debug] Fix fatal error when changing ErrorHandler loggers if an exception is buffered
2017-01-16 18:59:03 +01:00
skalpa
a6527f895b [Debug] Fix fatal error when changing ErrorHandler loggers if an exception is buffered 2017-01-16 17:23:42 +00:00