Commit Graph

30377 Commits

Author SHA1 Message Date
Fabien Potencier
1b634746ed fixed bad merge 2017-03-26 08:53:54 -07:00
Fabien Potencier
811a6bf5eb Merge branch '3.2'
* 3.2:
  [Bridge\Doctrine] Fix change breaking doctrine-bundle test suite
  [WebProfilerBundle] Include badge status in translation tabs
  [FrameworkBundle] Cache pool clear command requires at least 1 pool
  [HttpFoundation][bugfix]  should always be initialized
  MockArraySessionStorage: updated phpdoc for $bags so that IDE autocompletion would work
  normalize paths before making them relative
  removed test that does not test anything
  fixed tests
  #21809 [SecurityBundle] bugfix: if security provider's name contains upper cases then container didn't compile
  [WebProfilerBundle] Fix for CSS attribute at Profiler Translation Page
  Set Date header in Response constructor already
  [Validator] fix URL validator to detect non supported chars according to RFC 3986
  [Security] Fixed roles serialization on token from user object
2017-03-26 08:50:20 -07:00
Fabien Potencier
dc66960f84 Merge branch '2.8' into 3.2
* 2.8:
  [Bridge\Doctrine] Fix change breaking doctrine-bundle test suite
  [HttpFoundation][bugfix]  should always be initialized
  MockArraySessionStorage: updated phpdoc for $bags so that IDE autocompletion would work
  normalize paths before making them relative
2017-03-26 08:47:15 -07:00
Fabien Potencier
d175340777 Merge branch '2.7' into 2.8
* 2.7:
  [Bridge\Doctrine] Fix change breaking doctrine-bundle test suite
  [HttpFoundation][bugfix]  should always be initialized
  MockArraySessionStorage: updated phpdoc for $bags so that IDE autocompletion would work
  normalize paths before making them relative
2017-03-26 08:40:40 -07:00
Fabien Potencier
359a0638a4 bug #22164 [Bridge\Doctrine] Fix change breaking doctrine-bundle test suite (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Bridge\Doctrine] Fix change breaking doctrine-bundle test suite

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

Doctrine Bundle's test suite [is currently broken](https://travis-ci.org/doctrine/DoctrineBundle/jobs/215222182) with `2.8@dev` because the tests expect `addEventListener` to be called with an array as first arg, but #22001 optimized them away as string. Since internally strings are turned back into arrays, let's tweak that change and make Doctrine Bundle green again.

Commits
-------

0577c7b089 [Bridge\Doctrine] Fix change breaking doctrine-bundle test suite
2017-03-26 08:40:16 -07:00
Nicolas Grekas
0577c7b089 [Bridge\Doctrine] Fix change breaking doctrine-bundle test suite 2017-03-26 17:09:07 +02:00
Fabien Potencier
3526d23414 minor #22163 [WebProfilerBundle] Include badge status in translation tabs (ro0NL)
This PR was merged into the 3.2 branch.

Discussion
----------

[WebProfilerBundle] Include badge status in translation tabs

| Q             | A
| ------------- | ---
| Branch?       | 3.2
| Bug fix?      | yes-ish
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->

Minor consistency fix for the translation panel. Tab badges should indicate a certain status (at least the logs panel does as of 3.2). But for the missing translations (being the last tab) i think this is a good signal. And we could argue _defined_ fallback messages should really indicate a warning..

Before

![image](https://cloud.githubusercontent.com/assets/1047696/24331093/8d9b1210-122d-11e7-9403-a5a86548b214.png)

After

![image](https://cloud.githubusercontent.com/assets/1047696/24331104/bf2800b8-122d-11e7-92ea-57b2664e869f.png)

Funny sidenote; the log warning is about a missing translation 😅

Commits
-------

543ac435b8 [WebProfilerBundle] Include badge status in translation tabs
2017-03-26 08:02:38 -07:00
Roland Franssen
543ac435b8 [WebProfilerBundle] Include badge status in translation tabs 2017-03-26 14:00:52 +02:00
Fabien Potencier
6cc9dc7586 feature #22060 [DI] Add "by-id" autowiring: a side-effect free variant of it based on the class<>id convention (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Add "by-id" autowiring: a side-effect free variant of it based on the class<>id convention

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

This PR adds a new autowiring mode, based only on the class <> id convention.
This way of autowiring is free from any conflicting behavior, which is what I was looking for to begin with.

The expected DX is a bit more involving than the current way we do autowiring. But it's worth it to me, because it's plain predictable - a lot less "magic" imho.

So in this mode, for each `App\Foo` type hint, a reference to an "App\Foo" service will be created. If no such service exists, an exception will be thrown. To me, this opens a nice DX: when type hinting interfaces (which is the best practice), this will tell you when you need to create the explicit interface <> id mapping that is missing - thus encourage things to be made explicit, but only when required, and gradually, in a way that will favor discoverability by devs.

Of course, this is opt-in, and BC. You'd need to do eg in yaml: `autowire: by_id`.
For consistency, the current mode (`autowire: true`) can be configured using `autowire: by_type`.

Commits
-------

c298f2a90c [DI] Add "by-id" autowiring: a side-effect free variant of it based on the class<>id convention
2017-03-25 13:18:59 -07:00
Fabien Potencier
9896f86743 feature #22158 Revert "feature #20973 [DI] Add getter injection (nicolas-grekas)" (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

Revert "feature #20973 [DI] Add getter injection (nicolas-grekas)"

This reverts commit 2183f98f54, reversing
changes made to b465634a55.

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

Let's remove getter injection, we now have enough alternative mechanisms to achieve almost the same results (e.g. `ServiceSubscriberInterface`, see #21708)., and I'm tired being called by names because of it.

The only use case in core is `ControllerTrait`, but this should be gone if #22157 is merged.

Commits
-------

23fa3a09bf Revert "feature #20973 [DI] Add getter injection (nicolas-grekas)"
2017-03-25 12:45:22 -07:00
Fabien Potencier
3306dc2c13 feature #22157 [FrameworkBundle] Introduce AbstractController, replacing ControllerTrait (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle] Introduce AbstractController, replacing ControllerTrait

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

Basically reverts and replaces #18193.

Instead of using getter injection to provide our controller helpers, let's leverage the new `ServiceSubscriberInterface` (see #21708).
This is what the proposed `AbstractController` class provides.

So, instead of extending `Controller`, this would encourage extending `AbstractController`.
This provides almost the same experience, but makes the container private, thus not usable by userland (this safeguard was already provided by `ControllerTrait`).

I did not deprecate `Controller`, but I think we should. Now that we also have "controller.service_arguments" (see #21771), we have everything in place to encourage *not* using the container in controllers directly anymore.

My target in doing so is removing getter injection, which won't have any use case in core anymore.

The wiring for this could be:

```yaml
services:
    _instanceof:
        Symfony\Bundle\FrameworkBundle\Controller\AbstractController:
            calls: [ [ setContainer, [ '@container' ] ] ]
            tags: [ container.service_subscriber ]
````

But this is optional, because we don't really need to inject a scoped service locator: injecting the real container is fine also, since everything is private. And this is done automatically on ControllerResolver.

Commits
-------

a93f059878 [FrameworkBundle] Introduce AbstractController, replacing ControllerTrait
2017-03-25 12:41:56 -07:00
Nicolas Grekas
a93f059878 [FrameworkBundle] Introduce AbstractController, replacing ControllerTrait 2017-03-25 18:18:01 +01:00
Fabien Potencier
8901c7eaa6 feature #22046 [Asset] Adding a new version strategy that reads from a manifest JSON file (weaverryan)
This PR was squashed before being merged into the 3.3-dev branch (closes #22046).

Discussion
----------

[Asset] Adding a new version strategy that reads from a manifest JSON file

| 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        | https://github.com/symfony/symfony-docs/issues/7659

Hi guys!

Often, when using a frontend task manager or bundler (e.g. webpack of gulp), the final assets are dumped with a version or content hash in the filename itself (e.g. main.123abc.css). To know what the correct, current hashed filename is, you'll dump a `manifest.json` file - e.g.

```json
{
  "main.js": "main.123abc.js",
  "css/styles.css": "css/styles.555def.css"
}
```

Examples: [gulp-rev](https://github.com/sindresorhus/gulp-rev) and [webpack-manifest-plugin](https://www.npmjs.com/package/webpack-manifest-plugin).

This PR adds a new version strategy that will look up the asset path (e.g. `main.css`) in that file and return the final, versioned path. Some people may dump manifest files in other formats, but I think this catches the most common use-case (and you can always still create your own version strategy). I've written this to be "forgiving" - if a path doesn't exist in the manifest, the path is simply returned, unaltered.

Another implementation *could* have been to add a new Twig filter (e.g. `{{ asset('main.css|manifest_path) }}`) - but I thought I'd try first using the existing versioning system.

## Usage

```yml
# app/config/config.yml
framework:
    # ...
    assets:
       # added validation prevents you from setting json_manifest_path AND version, for example
        json_manifest_path: '%kernel.root_dir%/../web/manifest.json'
```

```twig
{# someTemplate.html.twig #}

{# use asset() just like normal #}
<script src="{{ asset('js/main.js') }}"></script>
```

## TODO
* fabbot hates my invalid json syntax file... even though I tried to be clever and not give it a `.json` suffix :)

Commits
-------

07fec2bbad [Asset] Adding a new version strategy that reads from a manifest JSON file
2017-03-25 09:22:52 -07:00
Ryan Weaver
07fec2bbad [Asset] Adding a new version strategy that reads from a manifest JSON file 2017-03-25 09:22:50 -07:00
Fabien Potencier
b1bfbcc04b bug #22159 [FrameworkBundle] Cache pool clear command requires at least 1 pool (ro0NL)
This PR was submitted for the master branch but it was merged into the 3.2 branch instead (closes #22159).

Discussion
----------

[FrameworkBundle] Cache pool clear command requires at least 1 pool

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes/no
| Fixed tickets | #22047
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->

The commands help description already states this should be required.

```
The cache:pool:clear command clears the given cache pools or cache pool clearers.

    bin/console cache:pool:clear <cache pool or clearer 1> [...<cache pool or clearer N>]
```

So this could also be qualified a bugfix.

Commits
-------

a61797f850 [FrameworkBundle] Cache pool clear command requires at least 1 pool
2017-03-25 08:48:16 -07:00
Roland Franssen
a61797f850 [FrameworkBundle] Cache pool clear command requires at least 1 pool 2017-03-25 08:48:15 -07:00
Fabien Potencier
869e68dd1f bug #22144 [Console] Fixed fatal error when the command is not defined (lyrixx)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Console] Fixed fatal error when the command is not defined

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

Commits
-------

d5b41b6b0a [Console] Fixed fatal error when the command is not defined
2017-03-25 08:31:41 -07:00
Nicolas Grekas
23fa3a09bf Revert "feature #20973 [DI] Add getter injection (nicolas-grekas)"
This reverts commit 2183f98f54, reversing
changes made to b465634a55.
2017-03-25 15:07:47 +01:00
Fabien Potencier
eda821a87a feature #22129 [WebProfilerBundle] Improve cache panel (ro0NL)
This PR was squashed before being merged into the 3.3-dev branch (closes #22129).

Discussion
----------

[WebProfilerBundle] Improve cache panel

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->

An attempt to improve the page a bit. Personally i think all elements on a single page is too much info.

Before

![image](https://cloud.githubusercontent.com/assets/1047696/24272477/d4d96a44-101d-11e7-9cc5-1646fc2c0603.png)

![image](https://cloud.githubusercontent.com/assets/1047696/24272500/e51318a6-101d-11e7-8875-c270016f11a2.png)

After

![image](https://cloud.githubusercontent.com/assets/1047696/24311179/530dcc6a-10d3-11e7-9c39-7c73ee2775f1.png)

![image](https://cloud.githubusercontent.com/assets/1047696/24311215/82c48566-10d3-11e7-82ff-6d79c3040a25.png)

Commits
-------

3592d0de6a [WebProfilerBundle] Improve cache panel
2017-03-24 15:59:01 -07:00
Roland Franssen
3592d0de6a [WebProfilerBundle] Improve cache panel 2017-03-24 15:58:51 -07:00
Fabien Potencier
da0b520a50 bug #22133 [Filesystem] normalize paths before making them relative (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Filesystem] normalize paths before making them relative

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

Commits
-------

d50ffa1de7 normalize paths before making them relative
2017-03-24 15:53:44 -07:00
Fabien Potencier
be3d2d2389 minor #22139 [HttpFoundation][DX] MockArraySessionStorage: phpdocs update (MacDada)
This PR was merged into the 2.7 branch.

Discussion
----------

[HttpFoundation][DX] MockArraySessionStorage: phpdocs update

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

Commits
-------

967f7a7add MockArraySessionStorage: updated phpdoc for $bags so that IDE autocompletion would work
2017-03-24 15:51:36 -07:00
Nicolas Grekas
c298f2a90c [DI] Add "by-id" autowiring: a side-effect free variant of it based on the class<>id convention 2017-03-24 15:54:23 +01:00
Fabien Potencier
2606c48f69 bug #22138 [HttpFoundation][bugfix] $bags should always be initialized (MacDada)
This PR was squashed before being merged into the 2.7 branch (closes #22138).

Discussion
----------

[HttpFoundation][bugfix] $bags should always be initialized

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

Commits
-------

d984c73e66 [HttpFoundation][bugfix]  should always be initialized
2017-03-24 07:50:56 -07:00
Dawid Nowak
d984c73e66 [HttpFoundation][bugfix] should always be initialized 2017-03-24 07:50:55 -07:00
Fabien Potencier
2dfd136da6 minor #22135 [DI] Add hints to exceptions thrown by AutowiringPass (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Add hints to exceptions thrown by AutowiringPass

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

As spotted while working on #22060

Commits
-------

d7557cf975 [DI] Add hints to exceptions thrown by AutowiringPass
2017-03-24 07:49:36 -07:00
Dawid Nowak
967f7a7add MockArraySessionStorage: updated phpdoc for $bags so that IDE autocompletion would work 2017-03-24 15:14:19 +01:00
Grégoire Pineau
d5b41b6b0a [Console] Fixed fatal error when the command is not defined 2017-03-24 11:19:00 +01:00
Nicolas Grekas
d7557cf975 [DI] Add hints to exceptions thrown by AutowiringPass 2017-03-24 10:50:03 +01:00
Christian Flothmann
d50ffa1de7 normalize paths before making them relative 2017-03-24 08:21:37 +01:00
Fabien Potencier
2ad59231c6 remvoed dead code 2017-03-23 11:14:29 -07:00
Fabien Potencier
fb56bcce98 Merge branch '2.8' into 3.2
* 2.8:
  removed test that does not test anything
  fixed tests
  #21809 [SecurityBundle] bugfix: if security provider's name contains upper cases then container didn't compile
  [WebProfilerBundle] Fix for CSS attribute at Profiler Translation Page
  Set Date header in Response constructor already
  [Validator] fix URL validator to detect non supported chars according to RFC 3986
  [Security] Fixed roles serialization on token from user object
2017-03-23 09:09:32 -07:00
Fabien Potencier
f971f4f5f2 Merge branch '2.7' into 2.8
* 2.7:
  removed test that does not test anything
  fixed tests
  #21809 [SecurityBundle] bugfix: if security provider's name contains upper cases then container didn't compile
  [Validator] fix URL validator to detect non supported chars according to RFC 3986
  [Security] Fixed roles serialization on token from user object
2017-03-23 09:08:03 -07:00
Fabien Potencier
80af0838f5 removed test that does not test anything 2017-03-23 09:07:35 -07:00
Fabien Potencier
e31d3461ea fixed tests 2017-03-23 09:02:44 -07:00
Fabien Potencier
ac01aadbd6 bug #21810 #21809 [SecurityBundle] bugfix: if security provider's name contains upper cases then container didn't compile (Antanas Arvasevicius)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #21810).

Discussion
----------

#21809 [SecurityBundle] bugfix: if security provider's name contains upper cases then container didn't compile

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

then security.yml  providers was with upper case, on container compile error was thrown:
````
[04:39:32][Ant output]      [exec]      [exec] > Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
[04:39:32][Ant output]      [exec]      [exec]
[04:39:32][Ant output]      [exec]      [exec]
[04:39:32][Ant output]      [exec]      [exec]   [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
[04:39:32][Ant output]      [exec]      [exec]   The service "security.authentication.provider.simple_form.default" has a de
[04:39:32][Ant output]      [exec]      [exec]   pendency on a non-existent service "security.user.provider.concrete.carrier
[04:39:32][Ant output]      [exec]      [exec]   User".

`````

Problem has occurred with this commit line:
fbd9f88e31 (diff-2be909961a57bf75fbb600c1f5fc46e3R320)

Issue fixes with this PR.

Commits
-------

6d23c8c41c #21809 [SecurityBundle] bugfix: if security provider's name contains upper cases then container didn't compile
2017-03-23 08:57:18 -07:00
Antanas Arvasevicius
6d23c8c41c #21809 [SecurityBundle] bugfix: if security provider's name contains upper cases then container didn't compile 2017-03-23 08:57:18 -07:00
Fabien Potencier
db8d87dce2 feature #21819 [Twig Bridge] A simpler way to retrieve flash messages (javiereguiluz)
This PR was squashed before being merged into the 3.3-dev branch (closes #21819).

Discussion
----------

[Twig Bridge] A simpler way to retrieve flash messages

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

Getting flash messages in templates is more complex than it could be. Main problems:

1. It's too low level: you need to get the "flash bag" (and first, learn what a "flash bag" is) and then you need to call the internal method: `all()`, `get()`, etc.
2. You need to be careful because the session will start automatically when you ask for flashes (even if there are no flashes). You can prevent this with the `{% if app.session is not null and app.session.started %}` code, but it's boring to always use that.

So, I propose to add a new `app.flashes` helper that works as follows.

---

## Get all the flash messages

### Before

```twig
{% if app.session is not null and app.session.started %}
    {% for label, messages in app.session.flashbag.all %}
        {% for message in messages %}
            <div class="alert alert-{{ label }}">
                {{ message }}
            </div>
        {% endfor %}
    {% endfor %}
{% endif %}
```

### After

```twig
{% for label, messages in app.flashes %}
    {% for message in messages %}
        <div class="alert alert-{{ label }}">
            {{ message }}
        </div>
    {% endfor %}
{% endfor %}
```

---

## Get only the flashes of type `notice`

```twig
{% if app.session is not null and app.session.started %}
    {% for message in app.session.flashbag.get('notice') %}
        <div class="alert alert-notice">
            {{ message }}
        </div>
    {% endfor %}
{% endif %}
```

### After

```twig
{% for message in app.flashes('notice') %}
    <div class="alert alert-notice">
        {{ message }}
    </div>
{% endfor %}
```

---

As an added bonus, you can get any number of flash messages because the method allows to pass an array of flash types:

```twig
{% for label, messages in app.flashes(['warning', 'error']) %}
    {% for message in messages %}
        <div class="alert alert-{{ label }}">
            {{ message }}
        </div>
    {% endfor %}
{% endfor %}
```

Commits
-------

5a56b23327 [Twig Bridge] A simpler way to retrieve flash messages
2017-03-23 08:48:12 -07:00
Javier Eguiluz
5a56b23327 [Twig Bridge] A simpler way to retrieve flash messages 2017-03-23 08:48:05 -07:00
Nicolas Grekas
3de0d9b33f minor #22122 Fix tests (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

Fix tests

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

ea84aa1 Fix tests
2017-03-23 13:32:01 +01:00
Javier Eguiluz
f354a47450 bug #22123 [WebProfilerBundle] Fix for CSS attribute at Profiler Translation Page (e-moe)
This PR was merged into the 2.8 branch.

Discussion
----------

[WebProfilerBundle] Fix for CSS attribute at Profiler Translation Page

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

Commits
-------

d980e70 [WebProfilerBundle] Fix for CSS attribute at Profiler Translation Page
2017-03-23 12:38:07 +01:00
Nikolay Labinskiy
d980e706ad [WebProfilerBundle] Fix for CSS attribute at Profiler Translation Page 2017-03-23 11:48:03 +02:00
Robin Chalas
ea84aa1868 Fix tests 2017-03-23 10:34:23 +01:00
Fabien Potencier
bafa8e29e0 feature #19026 [Security] Strengthen comparison of target_url vs login_path (mrzard)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Security] Strengthen comparison of target_url vs login_path

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

Commits
-------

ac9d75a09e [Security] Strengthen comparison of target_url vs login_path
2017-03-22 16:29:02 -07:00
Fabien Potencier
6f998375ff updated CHANGELOG 2017-03-22 16:26:17 -07:00
Fabien Potencier
ce067a3844 feature #19496 [DX][Form][Validator] Add ability check if cocrete constraint fails. (Koc)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DX][Form][Validator] Add ability check if cocrete constraint fails.

| Q | A |
| --- | --- |
| Branch? | master |
| Bug fix? | no |
| New feature? | yes |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | wait for travis |
| Fixed tickets | #15154 |
| License | MIT |
| Doc PR | should open |

Sometimes for big forms with multiple constraints we should handle some errors separately.

``` php
// when using validator
$constraintViolations = $validator->validate(...);
if (count($constraintViolations->findByCodes(UniqueEntity::NOT_UNIQUE_ERROR))) {
  // display some message or send email or etc
}

// when using forms
if (count($form->getErrors()->findByCodes(UniqueEntity::NOT_UNIQUE_ERROR))) {
  // display some message or send email or etc
}
```

This PR add some useful methods to handle this. Before we should iterate all failed constraints using foreach.

Feel free to suggest better names for new methods.

Commits
-------

29a3a7e0d6 Add ability retrieve errors by their code.
2017-03-22 16:25:22 -07:00
Fabien Potencier
b59660c23d minor #22119 [Lock] Adjust lock delay to avoid false error tests (jderusse)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Lock] Adjust lock delay to avoid false error tests

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

Adjust the clockDelay to fix tests
This test is here to:

T0.
* Fork A, B, C

T1.
* A acquire Lock then start sleeping for 3*clockDelay
* B start sleeping for 1*clockDelay
* C start sleeping for 1*clockDelay

T2
* B wakeup AND try to acquire lock in wait mode
* C wakeup AND try to acquire lock in non wait mode (lock should be till acquired by A)

T4
* A release Lock
* B acquire lock and release it

At the end, this tests assert than:
* A acquire and delete the lock
* B acquire and delete the lock
* C failed to acquire the lock

The point is, this test is time sensitive, and if the fork is too slow, A, B and C are not synchronized and C is able to acquire Lock.

This PR adjuste clock delay to reduce false failures

Commits
-------

33f2a9a6f7 Adjust lock delay to avoid false error tests
2017-03-22 16:13:19 -07:00
Fabien Potencier
ba4d6bce29 feature #18140 [Console] Add console.ERROR event and deprecate console.EXCEPTION (wouterj)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Console] Add console.ERROR event and deprecate console.EXCEPTION

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

The current `console.EXCEPTION` event is only dispatched for exceptions during the execution of `Command#execute()`. All other exceptions (e.g. the ones thrown by listeners to events) are catched by the `try ... catch` loop in `Application#doRunCommand()`. This means that there is _no way to override exception handling_.
## The Solution

This PR adds a `console.ERROR` event which has the same scope as the default `try ... catch` loop. This allows to customize all exception handling.

In order to keep BC, a new event was created and `console.EXCEPTION` was deprecated.

Commits
-------

c02a4c9857 Added a console.ERROR event
2017-03-22 16:10:45 -07:00
Fabien Potencier
42e5b4e10d feature #22120 [FrameworkBundle] Multiple services on one Command class (SenseException)
This PR was squashed before being merged into the 3.3-dev branch (closes #22120).

Discussion
----------

[FrameworkBundle] Multiple services on one Command class

rebased version of #19305

Commits
-------

2b82fcb437 [FrameworkBundle] Multiple services on one Command class
2017-03-22 16:05:06 -07:00
Claudio Zizza
2b82fcb437 [FrameworkBundle] Multiple services on one Command class 2017-03-22 16:05:04 -07:00