Commit Graph

29787 Commits

Author SHA1 Message Date
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
Fabien Potencier
afff0ce43e Merge branch '3.2'
* 3.2:
  [SecurityBundle] only pass relevant user provider
  [Intl] Make tests pass after the ICU data update
  [Intl] Update ICU data to 58.2
  do not register the test listener twice
  [DependencyInjection] removed dead code.
  [Yaml] Stop replacing NULLs when merging
  [WebServerBundle] fixed html attribute escape
2017-02-27 18:34:20 -08:00
Fabien Potencier
65b7d43ac3 Merge branch '2.8' into 3.2
* 2.8:
  [SecurityBundle] only pass relevant user provider
  [Intl] Make tests pass after the ICU data update
  [Intl] Update ICU data to 58.2
  do not register the test listener twice
  [DependencyInjection] removed dead code.
  [Yaml] Stop replacing NULLs when merging
  [WebServerBundle] fixed html attribute escape
2017-02-27 18:30:50 -08:00
Fabien Potencier
4d4dec3d41 Merge branch '2.7' into 2.8
* 2.7:
  [SecurityBundle] only pass relevant user provider
  [Intl] Make tests pass after the ICU data update
  [Intl] Update ICU data to 58.2
  [DependencyInjection] removed dead code.
  [Yaml] Stop replacing NULLs when merging
2017-02-27 18:24:56 -08:00
Fabien Potencier
eb750be851 bug #21791 [SecurityBundle] only pass relevant user provider (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[SecurityBundle] only pass relevant user provider

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

There is no need for the context listener to be aware of all the configured user providers. It must only use the provider for the current firewall (the one identified by the context key passed to the constructor) to refresh the user from the session.

Commits
-------

d97e07fd6a [SecurityBundle] only pass relevant user provider
2017-02-27 18:22:58 -08:00
Fabien Potencier
77f7a47dc5 feature #21625 Remove some container injections in favor of service locators (nicolas-grekas, chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

Remove some container injections in favor of service locators

| 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/21553#issuecomment-279214666
| License       | MIT
| Doc PR        | n/a

Commits
-------

8293b753cf Replace some container injections by service locators
0be9ea8ba1 [EventDispatcher] Fix abstract event subscribers registration
2017-02-27 18:18:26 -08:00
Fabien Potencier
43bff2279b feature #21539 Introduce weak vendors mode (greg0ire)
This PR was merged into the 3.3-dev branch.

Discussion
----------

Introduce weak vendors mode

Deprecations coming from the vendors are segregated from other
deprecations. A new mode is introduced, in which deprecations coming
from the vendors are not taken into account when deciding to exit with
an error code.

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

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

Sample output :

# Weak vendor mode

## With both vendors and non-vendor errors

```

WARNINGS!
Tests: 1068, Assertions: 2714, Warnings: 6, Skipped: 15.

Remaining deprecation notices (1)

some error: 1x
    1x in SonataAdminBundleTest::testBuild from Sonata\AdminBundle\Tests

Remaining vendor deprecation notices (4)

Legacy deprecation notices (48)
```

Exit code is 1

## After fixing non-vendor errors

```
WARNINGS!
Tests: 1068, Assertions: 2714, Warnings: 6, Skipped: 15.

Remaining vendor deprecation notices (4)

Legacy deprecation notices (48)
```

Exit code is 0

# TODO

- [x] fix colorization issues (vendor deprecation notices are always in red)
- [x] make the vendor detection more robust
- [x] make the vendor dir configurable
- [x] ~figure out how to run tests and~ add more of them
    - [x] test on non-vendor file
    - [x] test on vendor file
- [x] do not change the output of other modes

Commits
-------

61fd043dd5 Introduce weak vendors mode
2017-02-27 17:37:33 -08:00
Nicolas Grekas
68e1cb81f2 Merge branch '3.2'
* 3.2:
  [Process] Fix ignoring of bad env var names
2017-02-27 23:48:55 +01:00
Fabien Potencier
f2aa8136a8 feature #21638 [VarDumper] Allow seamless use of Data clones (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[VarDumper] Allow seamless use of Data clones

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

By implementing `ArrayAccess`, `Countable`, `IteratorAggregate`, `__get`, `__isset` and `__toString`,  VarDumper's `Data` objects become seamless and behave almost identically from their original clones values, especially from the PoV of Twig.

In data collectors, this allows replacing the many nested calls to `cloneVar` by a single one.

This makes the code simpler, and should make a significant difference in term of performance.

Todo:
- [x] push a Blackfire profile comparison
- [x] double check that the profiler works as expected.

Commits
-------

ab716c64de [VarDumper] Allow seamless use of Data clones
2017-02-27 14:21:39 -08:00
Fabien Potencier
e37bff942a bug #21602 [DI] Always consider abstract getters as autowiring candidates (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Always consider abstract getters as autowiring candidates

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes (a missing part of getter autowiring really)
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

When a definition is set to be autowired with no method explicitly configured, we already wire the constructor.
We should also autowire abstract getters - with the same reasoning that makes us autowire the constructor: without concrete getters, the class is unusable. This just makes it usable again.

Commits
-------

8f246bde1d [DI] Always consider abstract getters as autowiring candidates
2017-02-27 14:16:56 -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
Christian Flothmann
fbd9f88e31 [SecurityBundle] only pass relevant user provider 2017-02-27 23:02:11 +01:00
Fabien Potencier
70be4ba3ca minor #21790 [Intl] Update ICU data to 58.2 (jakzal)
This PR was squashed before being merged into the 2.7 branch (closes #21790).

Discussion
----------

[Intl] Update ICU data to 58.2

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

ICU 58.2 was released: http://site.icu-project.org/download/58

Commits
-------

d135e5cd2f [Intl] Make tests pass after the ICU data update
65faa1043d [Intl] Update ICU data to 58.2
2017-02-27 13:58:46 -08:00
Fabien Potencier
f1f982d65a bug #21741 [DI] Fix ordering of tags inheritance (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Fix ordering of tags inheritance

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

Tag inheritance should have predictable ordering, from child to parents.
This PR also adds tests for ResolveDefinitionInheritancePass (heavily inspired by ResolveDefinitionTemplatePass).

Commits
-------

18e7681fc5 [DI] Fix ordering of tags inheritance
2017-02-27 13:55:26 -08:00
Fabien Potencier
6d39fd4d51 bug #21776 [Process] Fix ignoring of bad env var names (nicolas-grekas)
This PR was merged into the 3.2 branch.

Discussion
----------

[Process] Fix ignoring of bad env var names

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

Patch backported from master, which is free from the linked issue.

Commits
-------

406bb09ae3 [Process] Fix ignoring of bad env var names
2017-02-27 13:33:35 -08:00
Christian Flothmann
d97e07fd6a [SecurityBundle] only pass relevant user provider 2017-02-27 22:20:22 +01:00
Fabien Potencier
29b5a6e157 minor #21779 [Form][Serializer] Add missing conflicts for DI (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Form][Serializer] Add missing conflicts for DI

| Q             | A
| ------------- | ---
| Branch?       | master
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/21375#discussion_r103180920
| License       | MIT

They make use of `PriorityTaggedServiceTrait` which is available since 3.2 only

Commits
-------

ddae4eff50 [Form][Serializer] Add missing conflicts for DI
2017-02-27 12:39:19 -08:00
Fabien Potencier
d5d68c0817 bug #21787 [PhpUnitBridge] do not register the test listener twice (xabbuh)
This PR was merged into the 2.8 branch.

Discussion
----------

[PhpUnitBridge] do not register the test listener twice

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

If the listener is already configured through the PHPUnit config, there
is no need to also enable it explicitly in the test runner.

Commits
-------

cee435fefd do not register the test listener twice
2017-02-27 12:29:08 -08:00
Nicolas Grekas
ab716c64de [VarDumper] Allow seamless use of Data clones 2017-02-27 21:09:01 +01:00
Robin Chalas
ddae4eff50 [Form][Serializer] Add missing conflicts for DI 2017-02-27 20:49:06 +01:00
Jakub Zalas
d135e5cd2f
[Intl] Make tests pass after the ICU data update 2017-02-27 19:39:35 +00:00
Jakub Zalas
65faa1043d
[Intl] Update ICU data to 58.2 2017-02-27 19:39:27 +00:00
Christian Flothmann
cee435fefd do not register the test listener twice
If the listener is already configured through the PHPUnit config, there
is no need to also enable it explicitly in the test runner.
2017-02-27 20:09:32 +01:00
Nicolas Grekas
22968cda3b minor #21783 [DependencyInjection] remove dead code (hhamon)
This PR was merged into the 2.7 branch.

Discussion
----------

[DependencyInjection] remove dead code

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

This PR removes some dead code introduced 7 years ago (!!!) by a wrong merge :)

Commits
-------

158b689 [DependencyInjection] removed dead code.
2017-02-27 16:31:05 +01:00
Nicolas Grekas
406bb09ae3 [Process] Fix ignoring of bad env var names 2017-02-27 16:27:30 +01:00
Hugo Hamon
158b689e76 [DependencyInjection] removed dead code. 2017-02-27 16:11:02 +01:00
Nicolas Grekas
e7a9f03bae minor #21773 [HttpKernel] Refactored SessionValueResolver (HeahDude)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[HttpKernel] Refactored SessionValueResolver

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

I thought the comment has been addressed in #21164, but it may have been unintentionally lost while rebasing?

Commits
-------

f0e832a [HttpKernel] Refactored SessionValueResolver
2017-02-27 15:04:15 +01:00
Jules Pietri
f0e832a6a1 [HttpKernel] Refactored SessionValueResolver 2017-02-27 08:09:42 +01:00
Fabien Potencier
fb65bd61d6 minor #21766 [DI] Remove experimental status from service-locator argument type (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Remove experimental status from service-locator argument type

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/21625#issuecomment-282483374, https://github.com/symfony/symfony/pull/21625#discussion_r102232221, #21710
| License       | MIT

The `service-locator` argument type is not controversial to me. We know its scope, nothing really surprising, just a map of services to be lazily loaded like `iterator` is (which is not experimental) but keyed.
About its api, it's just PSR-11 restricted to objects, nothing that can't be changed safely in the future.

As stated in https://github.com/symfony/symfony/pull/21625#issuecomment-282483374, it proven its usefulness already. I think what we were looking for by flagging it experimental is just to see it in action, we've 3 opened PRs for that (#21625, #21690, #21730).

This allows introducing deprecations for making use of the feature in the core, thus unlocks #21625 and #21690.

Commits
-------

46dc47af11 [DI] Remove experimental status from service-locator argument type
2017-02-26 14:51:27 -08:00
Fabien Potencier
43e32b86a2 feature #21164 [HttpKernel] Added the SessionValueResolver (iltar)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[HttpKernel] Added the SessionValueResolver

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

This feature adds the `SessionValueResolver`. That means that you no longer have to rely on injecting a `SessionInterface` implementation via the constructor or getting this implementation from the `Request`. Regardless of method, it does not know about the `getFlashBag()`.

By adding the `Session` to the action arguments, you can now type-hint against the implementation rather than interface, which contains the `getFlashBag()`, making it accessible rather than using duck-typing.

_It should also feel less like injecting a service into the constructor which has a state or getting a service from the request._

**Old Situation**
```php
class Controller
{
    public function __construct(SessionInterface $session) { /* ... */ }

    public function fooAction(Request $request)
    {
        $this->get('session')->get(...);
        $request->getSession()->get(...);
        $this->session->get(...)

        // duck-typing
        $this->get('session')->getFlashBag();
        $request->getSession()->getFlashBag();
        $this->session->getFlashBag();

        $this->addFlash(...);
    }
}
```

**New Situation** _- The controller shortcut for flashbag could in theory be removed now_
```php
class Controller
{
    public function fooAction(Session $session)
    {
        $session->get(...);
        $session->getFlashBag();
    }
}
```

Commits
-------

b4464dcea1 Added the SessionValueResolver
2017-02-26 14:45:04 -08:00
Robin Chalas
8293b753cf Replace some container injections by service locators 2017-02-26 14:01:31 +01:00
Christian Flothmann
8ddfc0673a bug #21756 [Yaml] Stop replacing NULLs when merging (gadelat)
This PR was merged into the 2.7 branch.

Discussion
----------

[Yaml] Stop replacing NULLs when merging

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

This introduces slight change of behaviour. Whereas previous code is overwriting already processed NULL values, this code is not. I think this is more expected behaviour, though?

Commits
-------

d967440 [Yaml] Stop replacing NULLs when merging
2017-02-26 13:37:39 +01:00
Robin Chalas
46dc47af11 [DI] Remove experimental status from service-locator argument type 2017-02-26 11:25:49 +01:00
Nicolas Grekas
0be9ea8ba1 [EventDispatcher] Fix abstract event subscribers registration 2017-02-26 09:54:11 +01:00
Gabriel Ostrolucký
d9674401de [Yaml] Stop replacing NULLs when merging 2017-02-25 19:32:58 +01:00
Javier Eguiluz
57a81eb992 bug #21689 [WebServerBundle] fixed html attribute escape (Seb33300)
This PR was merged into the 2.8 branch.

Discussion
----------

[WebServerBundle] fixed html attribute escape

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

In the Web Debug Toolbar, when a toolbar item has extra attributes, they are not properly escaped.
(If you put your mouse over the right toolbar item with sf version, you will see a tooltip with `""`)

Currently:
```html
title=&quot;&quot;
```

After:
```html
title=""
```

Commits
-------

1337cdb [WebServerBundle] fixed html attribute escape
2017-02-25 15:10:58 +01:00
Fabien Potencier
e58be70aca Merge branch '3.2'
* 3.2:
  Revamped the README file
  Fix missing namespace in AddConstraintValidatorPassTest
  [SecurityBundle] simplified code
  [ExpressionLanguage] Registering functions after calling evaluate(), compile() or parse() is not supported
2017-02-24 05:59:04 -08:00
Fabien Potencier
346eacd1a0 Merge branch '2.8' into 3.2
* 2.8:
  Revamped the README file
  Fix missing namespace in AddConstraintValidatorPassTest
  [ExpressionLanguage] Registering functions after calling evaluate(), compile() or parse() is not supported
2017-02-24 05:58:52 -08:00
Fabien Potencier
de95fd5fe5 Merge branch '2.7' into 2.8
* 2.7:
  Revamped the README file
  Fix missing namespace in AddConstraintValidatorPassTest
  [ExpressionLanguage] Registering functions after calling evaluate(), compile() or parse() is not supported
2017-02-24 05:57:05 -08:00
Fabien Potencier
ffe3ab1341 minor #21744 Revamped the README file (javiereguiluz)
This PR was squashed before being merged into the 2.7 branch (closes #21744).

Discussion
----------

Revamped the README file

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

Here is a before/after comparison image:

![before-after-readme](https://cloud.githubusercontent.com/assets/73419/23294444/cb001e9a-fa6b-11e6-88f2-a8449470fb4e.png)

Commits
-------

c7d30ca486 Revamped the README file
2017-02-24 05:55:45 -08:00
Javier Eguiluz
c7d30ca486 Revamped the README file 2017-02-24 05:55:42 -08:00
Nicolas Grekas
18e7681fc5 [DI] Fix ordering of tags inheritance 2017-02-23 23:13:03 +01:00
Nicolas Grekas
fe5a30880e minor #21740 Fix missing namespace in test (chalasr)
This PR was merged into the 2.7 branch.

Discussion
----------

Fix missing namespace in test

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Tests pass?   | yes

Commits
-------

1e9ca7b Fix missing namespace in AddConstraintValidatorPassTest
2017-02-23 23:10:03 +01:00
Robin Chalas
1e9ca7bead Fix missing namespace in AddConstraintValidatorPassTest 2017-02-23 22:30:07 +01:00
Fabien Potencier
518d02d565 fixed typo 2017-02-23 09:15:17 -08:00
Fabien Potencier
5d3561a1fc bug #21736 [Config] fixed glob file loader when there is an exception (fabpot)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Config] fixed glob file loader when there is an exception

| 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

Fixes a typo. When importing a glob, we definitely want to have errors like syntax errors in a YAML file.

Commits
-------

d1b6601612 [Config] fixed glob file loader when there is an exception
2017-02-23 08:39:57 -08:00
Fabien Potencier
d1b6601612 [Config] fixed glob file loader when there is an exception 2017-02-23 08:37:29 -08:00
Nicolas Grekas
71fba9608b minor #21729 [UPGRADE guide] Merged duplicated SecurityBundle section and ordered alphabetically (wouterj)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[UPGRADE guide] Merged duplicated SecurityBundle section and ordered alphabetically

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

Commits
-------

67c3107 Merge duplicated SecurityBundle section and order alphabetically
2017-02-23 13:13:43 +01:00
Wouter J
67c3107afa Merge duplicated SecurityBundle section and order alphabetically 2017-02-23 12:35:33 +01:00