Commit Graph

29920 Commits

Author SHA1 Message Date
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
Hugo Hamon
9c97496b5f [DependencyInjection] make the service container builder register the definition of its related service container service (and aliases) in order to make compiler passes be able to reference the special service_container service. 2017-02-27 17:26:21 +01:00
Hugo Hamon
838d9ca6c0 [DependencyInjection] add missing dumped private services list in a container frozen constructor. 2017-02-27 16:48:04 +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=""
```

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
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
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
Yonel Ceruto
34e360ade3 Add full route definition to invokable class 2017-02-23 11:32:28 -05: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
Fabien Potencier
a7db2bbe6c minor #21709 [SecurityBundle] simplified code (fabpot)
This PR was merged into the 3.2 branch.

Discussion
----------

[SecurityBundle] simplified code

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

Simplified code for 3.2 (followup to #21679)

Commits
-------

512742be52 [SecurityBundle] simplified code
2017-02-22 18:45:41 -08:00
Fabien Potencier
512742be52 [SecurityBundle] simplified code 2017-02-22 17:31:21 -08:00
Fabien Potencier
d69bb30400 feature #21718 [SecurityBundle] Don't normalize username of in-memory users (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[SecurityBundle] Don't normalize username of in-memory users

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

It's common to have e.g. emails as keys in `security.providers.in_memory.users` since keys are username. Actually they are normalized so `foo-bar@gmail.com` becomes `foo_bar@gmail.com` and authentication fails unexpectedly.

Commits
-------

8d03332726 [SecurityBundle] Don't normalize keys of in-memory users
2017-02-22 14:26:24 -08:00
Fabien Potencier
fcb83a8ad0 bug #21722 [ExpressionLanguage] Registering functions after calling evaluate(), compile() or parse() is not supported (maidmaid)
This PR was squashed before being merged into the 2.7 branch (closes #21722).

Discussion
----------

[ExpressionLanguage] Registering functions after calling evaluate(), compile() or parse() is not supported

| 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 we add expr. function after first eval/compile like this:

```php
$el = new ExpressionLanguage();
$el->evaluate('1 + 1');
$el->addFunction(new ExpressionFunction('fn', function () {}, function () {}));
$el->evaluate('fn()');
```
A ``SyntaxError`` is thrown that says ``The function "fn" does not exist around position 1.``. It's the same bug with ``$el->compile('fn()')``.

This PR fixes this (duplicate of #21098 that was closed).

Commits
-------

e305369f98 [ExpressionLanguage] Registering functions after calling evaluate(), compile() or parse() is not supported
2017-02-22 14:24:24 -08:00
Dany Maillard
e305369f98 [ExpressionLanguage] Registering functions after calling evaluate(), compile() or parse() is not supported 2017-02-22 14:24:23 -08:00
Robin Chalas
8d03332726 [SecurityBundle] Don't normalize keys of in-memory users 2017-02-22 18:37:26 +01:00
Fabien Potencier
99f60dcbd7 feature #20107 Added a build method to the kernel to replace Bundle::build() (iltar)
This PR was merged into the 3.3-dev branch.

Discussion
----------

Added a build method to the kernel to replace Bundle::build()

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

Adds a DX method to make it easier to omit using an AppBundle in your application.

**Old situation**

``` php
// src/AppBundle.php
class AppBundle extends Bundle
{
    public function build(ContainerBuilder $container)
    {
        $container->addCompilerPass(new SomeCompilerPass());
        $container->addCompilerPass(new AnotherCompilerPass());
        $container->addCompilerPass(new YetAnotherCompilerPass());
    }
}

// src/DependencyInjection/AppExtension.php
class AppExtension extends Extension
{
    public function load(array $config, ContainerBuilder $container)
    {
        $binary = ExecutableResolver::getPath($container->getParameter('kernel.root_dir').'/../');
        $snappyConfig = ['pdf' => ['binary' => realpath($binary)]];

        $container->prependExtensionConfig('knp_snappy', $snappyConfig);
    }
}
```

**New situation**

``` php
// rm src/AppBundle.php
// rm src/DependencyInjection/AppExtension.php

// app/AppKernel.php
class AppKernel extends Kernel
{
    protected function build(ContainerBuilder $container)
    {
        $binary = ExecutableResolver::getPath($container->getParameter('kernel.root_dir').'/../');
        $snappyConfig = ['pdf' => ['binary' => realpath($binary)]];

        $container->prependExtensionConfig('knp_snappy', $snappyConfig);
        $container->addCompilerPass(new SomeCompilerPass());
        $container->addCompilerPass(new AnotherCompilerPass());
        $container->addCompilerPass(new YetAnotherCompilerPass());
    }
}
```

Still missing tests, wondering if worth adding in this state first.

Commits
-------

62e80fc0af Added build and class cache to kernel
2017-02-22 09:07:08 -08:00
Iltar van der Berg
62e80fc0af Added build and class cache to kernel 2017-02-22 09:57:32 +01:00
Iltar van der Berg
b4464dcea1 Added the SessionValueResolver 2017-02-22 09:50:54 +01:00
Fabien Potencier
0e92e0a7ba Merge branch '3.2'
* 3.2:
  fixed bad merge
2017-02-21 18:38:51 -08:00
Fabien Potencier
677df7b57b fixed bad merge 2017-02-21 18:38:39 -08:00
Fabien Potencier
f2378c1ffa Merge branch '3.2'
* 3.2:
  fix priority ordering of security voters
2017-02-21 18:36:24 -08:00
Fabien Potencier
d3b1363ff1 Merge branch '2.8' into 3.2
* 2.8:
  fix priority ordering of security voters
2017-02-21 18:35:49 -08:00
Fabien Potencier
8201e47e9f Merge branch '2.7' into 2.8
* 2.7:
  fix priority ordering of security voters
2017-02-21 18:34:30 -08:00
Fabien Potencier
b675d0518c bug #21679 [SecurityBundle] fix priority ordering of security voters (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[SecurityBundle] fix priority ordering of security voters

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

Could be updated in the `3.2` branch to make use of the `PriorityTaggedServiceTrait `.

Commits
-------

dcd19f3cf9 fix priority ordering of security voters
2017-02-21 18:27:23 -08:00
Grégoire Paris
61fd043dd5
Introduce weak vendors mode
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. In
this mode, deprecations coming from the vendors are segregated from
other deprecations.
2017-02-21 23:18:35 +01:00
Nicolas Grekas
1d50688580 Merge branch '3.2'
* 3.2:
  fix phpunit bridge tests
2017-02-21 18:56:14 +01:00
Nicolas Grekas
2ee37c7dc3 fix phpunit bridge tests 2017-02-21 18:53:16 +01:00