Commit Graph

29446 Commits

Author SHA1 Message Date
Grégoire Pineau
ca1352d7ab Fixed CHANGELOG 2018-04-02 13:40:05 +02:00
alexpozzi
baec431fd9 [Workflow][Registry] Added the 'all' method which returns all the workflows associated to a specific object #26618 2018-04-02 13:40:05 +02:00
Fabien Potencier
d39e86796a updated VERSION for 2.8.37 2018-04-02 13:38:22 +02:00
Fabien Potencier
8f8d06718e fixed tests 2018-04-02 13:35:51 +02:00
Fabien Potencier
3758a3b1b3 bumped Symfony version to 2.7.45 2018-04-02 13:31:07 +02:00
Nicolas Grekas
6e95c2ad27 Merge branch '4.0'
* 4.0: (24 commits)
  moved Twig runtime to proper class
  fixed deprecated messages in tests
  add PHP errors options to XML schema definition
  [HttpCache] Unlink tmp file on error
  Added LB translation for #26327 (Errors sign for people that do not see colors)
  [TwigBridge] Fix rendering of currency by MoneyType
  Import InvalidArgumentException in PdoAdapter
  [DI] Do not suggest writing an implementation when multiple exist
  [Intl] Update ICU data to 61.1
  Use 3rd person verb form in command description
  [Validator] Add Japanese translation
  Support phpdbg SAPI in Debug::enable()
  [HttpKernel] DumpDataCollector: do not flush when a dumper is provided
  [DI] Fix hardcoded cache dir for warmups
  [Routing] fix tests
  [Routing] Fixed the importing of files using glob patterns that match multiple resources
  [Ldap] cast to string when checking empty passwords
  [Validator] sync validator translation id
  [WebProfilerBundle] use the router to resolve file links
  no type errors with invalid submitted data types
  ...
2018-04-02 12:08:33 +02:00
Fabien Potencier
f33d3fd1e3 Merge branch '3.4' into 4.0
* 3.4:
  fixed missing use statement
  fixed deprecated messages in tests
2018-04-02 12:05:09 +02:00
Fabien Potencier
38968efce6 fixed missing use statement 2018-04-02 12:03:31 +02:00
Fabien Potencier
ef8a14154a updated VERSION for 2.7.44 2018-04-02 11:53:22 +02:00
Nicolas Grekas
a5a44472c9 Merge branch '3.4' into 4.0
* 3.4: (24 commits)
  moved Twig runtime to proper class
  fixed deprecated messages in tests
  add PHP errors options to XML schema definition
  [HttpCache] Unlink tmp file on error
  Added LB translation for #26327 (Errors sign for people that do not see colors)
  [TwigBridge] Fix rendering of currency by MoneyType
  Import InvalidArgumentException in PdoAdapter
  [DI] Do not suggest writing an implementation when multiple exist
  [Intl] Update ICU data to 61.1
  Use 3rd person verb form in command description
  [Validator] Add Japanese translation
  Support phpdbg SAPI in Debug::enable()
  [HttpKernel] DumpDataCollector: do not flush when a dumper is provided
  [DI] Fix hardcoded cache dir for warmups
  [Routing] fix tests
  [Routing] Fixed the importing of files using glob patterns that match multiple resources
  [Ldap] cast to string when checking empty passwords
  [Validator] sync validator translation id
  [WebProfilerBundle] use the router to resolve file links
  no type errors with invalid submitted data types
  ...
2018-04-02 11:52:41 +02:00
Fabien Potencier
367a7a77f5 Merge branch '2.8' into 3.4
* 2.8:
  fixed deprecated messages in tests
2018-04-02 11:45:26 +02:00
Fabien Potencier
79d491cee1 fixed deprecated messages in tests 2018-04-02 11:45:16 +02:00
Fabien Potencier
500b6794eb moved Twig runtime to proper class 2018-04-02 11:40:46 +02:00
Fabien Potencier
62eebd7d50 Merge branch '2.8' into 3.4
* 2.8:
  fixed deprecated messages in tests
  [HttpCache] Unlink tmp file on error
  Added LB translation for #26327 (Errors sign for people that do not see colors)
  [TwigBridge] Fix rendering of currency by MoneyType
  [HttpKernel] DumpDataCollector: do not flush when a dumper is provided
2018-04-02 11:38:44 +02:00
Fabien Potencier
92322f1be0 fixed deprecated messages in tests 2018-04-02 11:33:07 +02:00
Fabien Potencier
72501cd311 Merge branch '2.7' into 2.8
* 2.7:
  [HttpCache] Unlink tmp file on error
  Added LB translation for #26327 (Errors sign for people that do not see colors)
  [TwigBridge] Fix rendering of currency by MoneyType
  [HttpKernel] DumpDataCollector: do not flush when a dumper is provided
2018-04-02 11:31:53 +02:00
Christian Flothmann
2ee6bb4897 fix log level support config handling 2018-04-02 11:08:46 +02:00
Christian Flothmann
ad8c8d00aa add PHP errors options to XML schema definition 2018-04-02 10:42:40 +02:00
Christian Flothmann
7d39bac2dc add PHP errors options to XML schema definition 2018-04-02 10:41:14 +02:00
Fabien Potencier
b3fc3b5690 minor #26728 [VarDumper] Server dumper feature tweaks (ogizanagi)
This PR was squashed before being merged into the 4.1-dev branch (closes #26728).

Discussion
----------

[VarDumper] Server dumper feature tweaks

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | N/A   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

This contains the following fixes & enhancements:

- Remove the `ServerDumper::isServerListening()` method which is not required anymore by core (forgotten on original PR after fixing reviews). Unless this is shown really useful for someone, we probably don't want to support it now that the core doesn't use it anymore.
- Provide the unserialize `allowed_classes` option for security reasons
- Add ServerDumper HTML output max-width (value chosen based on bootstrap 4 container `max-width` for reference)

Commits
-------

c148e06b12 [VarDumper] Add ServerDumper HTML output max-width
4e98fc4cf0 [VarDumper] DumpServer: provide the unserialize "allowed_classes" options
4611314a49 [VarDumper] Remove ServerDumper::isServerListening
2018-04-01 10:34:34 +02:00
Fabien Potencier
46c9842a4c Revert "feature #26698 [Console] Use UTF-8 bullet for listing (ro0NL)"
This reverts commit 6bfc082b87, reversing
changes made to 9b25573e73.
2018-04-01 10:27:13 +02:00
Maxime Steinhausser
c148e06b12 [VarDumper] Add ServerDumper HTML output max-width 2018-03-31 18:16:41 +02:00
Maxime Steinhausser
4e98fc4cf0 [VarDumper] DumpServer: provide the unserialize "allowed_classes" options
Otherwise, could theoretically lead to security vulnerabilities (remote code execution/injection)
2018-03-31 17:59:40 +02:00
Maxime Steinhausser
4611314a49 [VarDumper] Remove ServerDumper::isServerListening
which is not required anymore by core
2018-03-31 17:45:59 +02:00
Chansig
c9a0355883 [HttpCache] Unlink tmp file on error 2018-03-31 09:59:49 +02:00
mweimerskirch
c1fae9ea4e Added LB translation for #26327 (Errors sign for people that do not see colors) 2018-03-31 07:18:09 +02:00
Gabriel Ostrolucký
b2d8792908 Mark ExceptionInterfaces throwable 2018-03-30 17:58:13 +02:00
Fabien Potencier
40fbaa22b1 feature #26693 [Console] Add box-double table style (maidmaid)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Console] Add box-double table style

| 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/25456#pullrequestreview-82765645
| License       | MIT
| Doc PR        | /

In https://github.com/symfony/symfony/pull/25456#pullrequestreview-82765645 @javiereguiluz suggested to have a complete configuration for style table. It was a nice idea, but not yet implemented. The box-drawing characters allow to combine different styles (like double/single lines). This PR give the possibility to use them.

The previous https://github.com/symfony/symfony/pull/25456 introduced the box-drawing characters; this PR exploits all their strength.

![image](https://user-images.githubusercontent.com/4578773/38136596-d8f4f46c-3462-11e8-9a0d-dcfae6039d18.png)

See https://gist.github.com/maidmaid/3eb55afc4f2857cae89d7ac43d7943ae for some examples.

Commits
-------

463f986c28 Add box-double table style
2018-03-30 16:57:15 +02:00
Dany Maillard
463f986c28 Add box-double table style 2018-03-30 21:44:02 +10:00
Fabien Potencier
6bfc082b87 feature #26698 [Console] Use UTF-8 bullet for listing (ro0NL)
This PR was squashed before being merged into the 4.1-dev branch (closes #26698).

Discussion
----------

[Console] Use UTF-8 bullet for listing

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

Inspired by the new table style, this updates the listing style.

before

![image](https://user-images.githubusercontent.com/1047696/38031214-019c79f4-329b-11e8-8352-9453c7ccc129.png)

after

![image](https://user-images.githubusercontent.com/1047696/38031186-ed8b1e66-329a-11e8-8538-2256a0e24a42.png)

Commits
-------

d1e4acb02e [Console] Use UTF-8 bullet for listing
2018-03-30 10:44:22 +02:00
Roland Franssen
d1e4acb02e [Console] Use UTF-8 bullet for listing 2018-03-30 10:44:16 +02:00
Fabien Potencier
9b25573e73 bug #26661 [Translation] XLIFF2: Make sure to trim source if it is too long for "name" (Nyholm)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Translation] XLIFF2: Make sure to trim source if it is too long for "name"

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

This PR is a follow-up on @javiereguiluz's comment here: https://github.com/symfony/symfony-docs/pull/9302

This feature was introduced in https://github.com/symfony/symfony/pull/26149

Commits
-------

ca41fecfd9 Make sure to trim source if it is too long
2018-03-30 10:43:09 +02:00
Fabien Potencier
f568271238 feature #26682 Improved the lint:xliff command (javiereguiluz)
This PR was squashed before being merged into the 4.1-dev branch (closes #26682).

Discussion
----------

Improved the lint:xliff command

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

This is how it looks:

![lint-xliff-output](https://user-images.githubusercontent.com/73419/37958502-fd8732e0-31b0-11e8-8688-8644ca930daf.png)

Commits
-------

6bbcc45d96 Improved the lint:xliff command
2018-03-30 10:39:14 +02:00
Javier Eguiluz
6bbcc45d96 Improved the lint:xliff command 2018-03-30 10:39:04 +02:00
Fabien Potencier
f62a6d7e88 feature #26681 Allow to easily ask Symfony not to set a response to private automatically (Toflar)
This PR was squashed before being merged into the 4.1-dev branch (closes #26681).

Discussion
----------

Allow to easily ask Symfony not to set a response to private automatically

| 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 is related to the many discussions going on about the latest (Symfony 3.4+) changes regarding the way Symfony handles the session. I think we're almost there now, Symfony 4.1 automatically turns responses into `private` responses once the session is started and it's all done in the `AbstractSessionListener` where the session is also saved.
In other issues/PRs (https://github.com/symfony/symfony/pull/25583, https://github.com/symfony/symfony/pull/25699, https://github.com/symfony/symfony/issues/24988) it was agreed that setting the response to `private` if the session is started is a good default for Symfony. It was also agreed that setting it to `private` does not always make sense because you **can share a response** across sessions, it just requires a more complex caching setup with shared user context etc.
So there must be an easy way to disable this behaviour. Right now it's very hard to do so because what you end up doing is basically decorating the `session_listener` which is very hard because you have to keep track on that over different Symfony versions as the base listener might get additional features etc.

The [FOSCacheBundle](https://github.com/FriendsOfSymfony/FOSHttpCacheBundle/pull/438) is already having this problem, [Contao](https://github.com/contao/core-bundle/pull/1388) has the same issue and there will be probably more. Basically everyone that wants to share a response cache across the session will have to decorate the default listener. That's just too hard, so I came up with this solution. The header is easy. Every project can add that easily. It does not require any extension, configuration or adjustment of any service. It's clean, transparent and has absolutely no impact on "default" Symfony setups.

Would be happy to have some feedback before 4.1 freeze.

Commits
-------

0f36710708 Allow to easily ask Symfony not to set a response to private automatically
2018-03-30 10:02:28 +02:00
Yanick Witschi
0f36710708 Allow to easily ask Symfony not to set a response to private automatically 2018-03-30 10:02:23 +02:00
Fabien Potencier
6f15386b89 minor #26706 [Messenger] Make NoHandlerForMessageException a logic exception (ogizanagi)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Messenger] Make NoHandlerForMessageException a logic exception

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | no
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | https://github.com/symfony/symfony/pull/26648#discussion_r178049882   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A <!-- required for new features -->

To me, a missing handler for a message is a program logic exception (or misconfiguration). Even if it's only detected at runtime here.
It's the same as `ServiceNotFoundException` which even is an `\InvalidArgumentException`. Could eventually also be the case here.

Commits
-------

0489bbd948 [Messenger] Make NoHandlerForMessageException a logic exception
2018-03-30 09:58:18 +02:00
Fabien Potencier
98ee8ab800 bug #26675 [HttpKernel] DumpDataCollector: do not flush when a dumper is provided (ogizanagi)
This PR was merged into the 2.7 branch.

Discussion
----------

[HttpKernel] DumpDataCollector: do not flush when a dumper is provided

| Q             | A
| ------------- | ---
| Branch?       | 2.7 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | 3db14045d4/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php (L208-L209)   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

This explains [the workaround I initially used](3db14045d4/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php (L208-L209)) in the server dumper PR original code.

I might be wrong on the intent, but as soon as a dumper is provided (e.g by setting  `debug.dump_destination: php://stderr`), I think there is no need to set the `DumpDataCollector::$isCollected` flag to `false` as we explicitly ask for the dump to be output directly somewhere. So ne need to output again on `__destruct`.

Spotted by running tests on the `symfony/demo` with the server dumper enabled: dumps were output twice. Once on the server, once at the end of the tests.

But this can be easily seen as well by using `debug.dump_destination: php://stderr` on `test` env:

```diff
diff --git a/src/Controller/BlogController.php b/src/Controller/BlogController.php
index e3e30aa..bf9744e 100644
--- a/src/Controller/BlogController.php
+++ b/src/Controller/BlogController.php
@@ -50,6 +50,7 @@ class BlogController extends AbstractController
      */
     public function index(int $page, string $_format, PostRepository $posts): Response
     {
+        dump(get_class($posts));
         $latestPosts = $posts->findLatest($page);

         // Every template name also has two extensions that specify the format and
```

### Before

```sh
vendor/bin/simple-phpunit --filter=BlogControllerTest::testIndex
PHPUnit 6.5.7 by Sebastian Bergmann and contributors.

Testing Project Test Suite
BlogController.php on line 53:
"App\Repository\PostRepository"
.                                                                   1 / 1 (100%)

Time: 3.34 seconds, Memory: 44.25MB

OK (1 test, 1 assertion)
BlogController.php on line 53:
"App\Repository\PostRepository"
```

### After

```sh
vendor/bin/simple-phpunit --filter=BlogControllerTest::testIndex
PHPUnit 6.5.7 by Sebastian Bergmann and contributors.

Testing Project Test Suite
BlogController.php on line 53:
"App\Repository\PostRepository"
.                                                                   1 / 1 (100%)

Time: 731 ms, Memory: 28.00MB

OK (1 test, 1 assertion)
```

Commits
-------

11a0392516 [HttpKernel] DumpDataCollector: do not flush when a dumper is provided
2018-03-30 09:47:09 +02:00
Fabien Potencier
4243db5c87 bug #26663 [TwigBridge] Fix rendering of currency by MoneyType (ro0NL)
This PR was squashed before being merged into the 2.7 branch (closes #26663).

Discussion
----------

[TwigBridge] Fix rendering of currency by MoneyType

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

Split from #25167 as suggested by @nicolas-grekas to see if this can be reasonably fixed on 2.7, the right way using this itsy-bitsy new feature.

#25167 still contains some valuable changes regarding tests. Ill continue either one PR depending on the target branch / proposed fix.

Commits
-------

a3a2ff0c74 [TwigBridge] Fix rendering of currency by MoneyType
2018-03-29 15:55:16 +02:00
Roland Franssen
a3a2ff0c74 [TwigBridge] Fix rendering of currency by MoneyType 2018-03-29 15:55:10 +02:00
Fabien Potencier
ecb629a245 minor #26672 [Messenger] Compile-time errors fixes and tweaks (chalasr)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Messenger] Compile-time errors fixes and tweaks

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

Commits
-------

2889acf7f5 [Messenger] Compile time errors fixes and tweaks
2018-03-29 15:46:58 +02:00
Maxime Steinhausser
0489bbd948 [Messenger] Make NoHandlerForMessageException a logic exception 2018-03-29 15:15:19 +02:00
Konstantin Scheumann
b678f7f839 Import InvalidArgumentException in PdoAdapter 2018-03-29 15:02:00 +02:00
Robin Chalas
1ffdb50341 [DI] Do not suggest writing an implementation when multiple exist 2018-03-29 13:25:31 +02:00
Robin Chalas
9b6ed69a71 minor #26703 [Messenger] Fix messenger profiler name (sroze)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Messenger] Fix messenger profiler name

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #26674
| License       | MIT
| Doc PR        | ø

In #26674, the profiler name was not renamed properly, which means it wasn't displayed anymore.

Commits
-------

bd234ff Fix messenger profiler name
2018-03-29 10:09:35 +02:00
Samuel ROZE
bd234ff7f8 Fix messenger profiler name 2018-03-29 00:50:07 +02:00
Fabien Potencier
3d5f04cce3 Merge branch '2.8' into 3.4
* 2.8:
  [Intl] Update ICU data to 61.1
  [Validator] Add Japanese translation
  Support phpdbg SAPI in Debug::enable()
  [Ldap] cast to string when checking empty passwords
  [Validator] sync validator translation id
  no type errors with invalid submitted data types
  [FrameworkBundle] Partially revert HttpCache is not longer abstract (4d075da)
  [Finder] Fixed leading/trailing / in filename
  allow html5 compatible rendering of forms with null names
  Change datetime input to datetime-local
2018-03-28 20:23:39 +02:00
Fabien Potencier
e3201b8f37 Merge branch '2.7' into 2.8
* 2.7:
  [Intl] Update ICU data to 61.1
  [Validator] Add Japanese translation
  Support phpdbg SAPI in Debug::enable()
  [Validator] sync validator translation id
  no type errors with invalid submitted data types
  [FrameworkBundle] Partially revert HttpCache is not longer abstract (4d075da)
  [Finder] Fixed leading/trailing / in filename
  allow html5 compatible rendering of forms with null names
  Change datetime input to datetime-local
2018-03-28 20:22:50 +02:00
Fabien Potencier
e3f964f923 bug #26670 [FrameworkBundle] Remove double cache generation by detecting fresh kernels on cache:clear (nicolas-grekas)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[FrameworkBundle] Remove double cache generation by detecting fresh kernels on cache:clear

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

The `cache:clear` command currently runs non-optional cache warmers twice or more.
It also clears + warms up just created caches (when var/cache/dev doens't exist yet, eg on 1st `composer install`.)

This PR fixes both behaviors. To run only what's needed once.
Best reviewed [ignoring whitespaces](https://github.com/symfony/symfony/pull/26670/files?w=1).

Commits
-------

9d8eac213a [FrameworkBundle] Remove double cache generation by detecting fresh kernels on cache:clear
2018-03-28 20:12:22 +02:00
Fabien Potencier
820b728a33 feature #26627 [DI] Add runtime service exceptions to improve the error message when controller arguments cannot be injected (nicolas-grekas)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[DI] Add runtime service exceptions to improve the error message when controller arguments cannot be injected

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

![image](https://user-images.githubusercontent.com/243674/37775694-e5c9814c-2de3-11e8-8290-8fd05086da28.png)

Commits
-------

9e8e0630a9 [DI] Add ContainerInterface::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE
2018-03-28 20:04:39 +02:00
Fabien Potencier
02e59d4610 bug #26662 [DI] Fix hardcoded cache dir for warmups (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Fix hardcoded cache dir for warmups

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

Commits
-------

599dbca3cd [DI] Fix hardcoded cache dir for warmups
2018-03-28 19:58:14 +02:00
Nicolas Grekas
ba055887be [HttpKernel] Fix comment from stof 2018-03-28 19:24:13 +02:00
Nicolas Grekas
9d8eac213a [FrameworkBundle] Remove double cache generation by detecting fresh kernels on cache:clear 2018-03-28 19:19:11 +02:00
Jakub Zalas
f73d378f9c
[Intl] Update ICU data to 61.1 2018-03-28 19:31:17 +11:00
Marco Petersen
e467e4cc6e Use 3rd person verb form in command description 2018-03-27 23:06:51 +02:00
Fabien Potencier
44a6f60fdb feature #26504 [FrameworkBundle] framework.php_errors.log now accept a log level (Simperfit)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[FrameworkBundle] framework.php_errors.log now accept a log level

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #26267   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        |  todo <!-- required for new features -->

We are testing that `framework.php_errors.log` is either a bool or an int (set the value of the log level you want).
This fixes #26267, so it gives a way to not log some level on production.

Commits
-------

664f821895 [FrameworkBundle] framework.php_errors.log now accept a log level
2018-03-27 20:27:43 +02:00
Amrouche Hamza
664f821895
[FrameworkBundle] framework.php_errors.log now accept a log level 2018-03-27 16:39:44 +02:00
Robin Chalas
2889acf7f5 [Messenger] Compile time errors fixes and tweaks 2018-03-27 14:18:30 +02:00
Fabien Potencier
2e47edc4a5 feature #26498 Allow "json:" env var processor to accept null value (mcfedr)
This PR was merged into the 4.1-dev branch.

Discussion
----------

Allow "json:" env var processor to accept null value

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

Edits the EnvVarProcessor so that it allows any type of variable in JSON encoded vars.

Previously it was only possible to use `%env(json:ENV)%` for array types, but this seems to be an arbitrary restriction, when I could have any other data type in that JSON.

Valid JSON that was previously rejected:
- `1`
- `null`
- `"string"`

Commits
-------

abc7480828 Allow "json:" env var processor to parse null values
2018-03-27 14:13:01 +02:00
Fabien Potencier
3424cc7ee6 feature #25928 [DI] Allow binary values in parameters. (bburnichon)
This PR was squashed before being merged into the 4.1-dev branch (closes #25928).

Discussion
----------

[DI] Allow binary values in parameters.

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

This adds `binary` type in container xsd definition file

Commits
-------

cb2313422b [DI] Allow binary values in parameters.
2018-03-27 14:07:18 +02:00
Benoît Burnichon
cb2313422b [DI] Allow binary values in parameters. 2018-03-27 14:07:16 +02:00
Issei.M
360298df29 [Validator] Add Japanese translation 2018-03-27 13:45:04 +02:00
Samuel ROZE
ea6d8618ff feature #26647 [Messenger] Add a middleware that wraps all handlers in one Doctrine transaction. (Nyholm)
This PR was squashed before being merged into the 4.1-dev branch (closes #26647).

Discussion
----------

[Messenger] Add a middleware that wraps all handlers in one Doctrine transaction.

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

This is greatly inspired by SimpleBus. This middleware will rollback a transaction if the message handler throws an exception.

Commits
-------

623dc5fb16 [Messenger] Add a middleware that wraps all handlers in one Doctrine transaction.
2018-03-27 11:43:33 +01:00
Tobias Nyholm
623dc5fb16 [Messenger] Add a middleware that wraps all handlers in one Doctrine transaction. 2018-03-27 11:43:30 +01:00
Gabriel Ostrolucký
eb6974d14c [WebProfilerBundle] Live duration of AJAX request 2018-03-27 11:02:44 +02:00
Tobias Nyholm
ca41fecfd9
Make sure to trim source if it is too long 2018-03-27 09:49:02 +02:00
Fabien Potencier
5b27c2f61f feature #26650 [Messenger] Clone messages to show in profiler (Nyholm)
This PR was squashed before being merged into the 4.1-dev branch (closes #26650).

Discussion
----------

[Messenger] Clone messages to show in profiler

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

We should make the profiler page more pretty by using the cloner.

![screen shot 2018-03-23 at 11 08 02](https://user-images.githubusercontent.com/1275206/37823687-816a373a-2e8a-11e8-824e-ac7f96a51e3b.png)

Commits
-------

4d1be87b70 [Messenger] Clone messages to show in profiler
2018-03-27 09:46:52 +02:00
Tobias Nyholm
4d1be87b70 [Messenger] Clone messages to show in profiler 2018-03-27 09:46:50 +02:00
Fabien Potencier
7b20b8cf3e feature #26281 [FrameworkBundle] keep query in redirect (Simperfit)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[FrameworkBundle] keep query in redirect

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | no
| New feature?  | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #26256   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | #9314

<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
 - 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.
-->

Commits
-------

406bfc9896 [FrameworkBundle] keep query params in redirection
2018-03-27 09:45:03 +02:00
Fabien Potencier
a9494840f2 feature #26665 Improved the Ajax profiler panel when there are exceptions (javiereguiluz)
This PR was merged into the 4.1-dev branch.

Discussion
----------

Improved the Ajax profiler panel when there are exceptions

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

This makes the following changes in the Ajax panel:

* The `Profiler` column is now the first one.
* When the response status code is `400` or higher, the profiler link points to the exception panel instead of the default request/response panel

![ajax-panel](https://user-images.githubusercontent.com/73419/37874477-52cf3888-3030-11e8-8042-23351f2e7a0f.png)

Commits
-------

074d68d67f Improved the Ajax profiler panel when there are exceptions
2018-03-27 09:38:41 +02:00
Fabien Potencier
be1b55b104 feature #26654 [VarDumper] Provide binary, allowing to start a server at any time (ogizanagi)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[VarDumper] Provide binary, allowing to start a server at any time

as soon as the "symfony/var-dumper" & "symfony/console" components are available.

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | no
| New feature?  | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | N/A   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | TODO https://github.com/symfony/symfony-docs/issues/9474

Now that https://github.com/symfony/symfony/pull/23831 is merged, there is still room for improvements we can bring during the stabilization months.

Here is a first one: providing a simple CLI binary allows to easily start a server from any project (or even globally), just by having the var dumper & console packages in your deps.

Commits
-------

eef10b19c6 [VarDumper] Provide binary, allowing to start a server at any time
2018-03-27 09:37:14 +02:00
Fabien Potencier
9dd89e014b feature #26332 Add a data_help method in Form (mpiot, Nyholm)
This PR was merged into the 4.1-dev branch.

Discussion
----------

Add a data_help method in Form

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

Add a form_help method in twig to display a help message in form. A `help` keyword is added to all FormType to define the message.

Commits
-------

585ca28b8a Add return type hint
859ee03785 Revert: remove comment line from twig templates
d723756331 Fix some mistakes
c74e0dc2da Use spaceless balises in Twig templates
8b937ff43f Try without try/catch
32bf1f68ad Test the renderHelp method in all Tests about help to skip them if necessary.
437b77e81a Skip renderHelp test as skipped if not override
d84be700b2 Update composer files
075fcfd07c [FrameworkBundle] Add widgetAtt to formTable/form_row
f1d13a860c Fix Fabpot.io
69ded67643 Added form_help on horizontal design and removed special variable
fd53bc579a Enable aria-described in row for all Templates
98065d38b5 fabpot.io fix
edb95f8e44 Use array long syntax
aada72c5d4 Set help option on nul as default
f948147e38 Rename help id (snake_case)
77fa3178bd Fix Test
30deaa9b28 PSR fix
bf4d08c5ae Add aria-describedBy on input
1f3a15e33b Rename id
058489d7df Add an id to the help
6ea7a2054b Remove vars option from form_help
ba798dfdf4 FrameworkBundle Tests
4f2581d7da Use array long syntax
f15bc79df1 Fix coding standards
c934e496d2 Add test without help set
8094804522 Add Tests
067c681580 Template for table, Foundation and Bootstrap 3
d3e3e492df Fix: check translation domain
2c2c04549f Adapt existant tests
831693ad45 Add trans filter
e311838aed Remove raw filter for help
8b97c1b516 Use a shortcut to acces help var in Twig template
1b89f9d9dd Add a template fot div_layout
c8914f591e Add a data_help method in Form
2018-03-27 09:25:04 +02:00
Fabien Potencier
d329a7a755 minor #26674 Updated the Messenger profiler panel (javiereguiluz)
This PR was squashed before being merged into the 4.1-dev branch (closes #26674).

Discussion
----------

Updated the Messenger profiler panel

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

The profiler icon of the new Messenger component was still pending. After talking with @sroze, we settled on two possible ideas for the icon: 1) focus on "messages"; 2) focus on "bus" / "message bus".

These are the icons for the two proposals:

| "Messages" | "Message Bus"
| --- | ---
| ![icon-1](https://user-images.githubusercontent.com/73419/37912058-da8aabb8-3111-11e8-972c-e3535ab9e1e8.png) | ![icon-2](https://user-images.githubusercontent.com/73419/37912063-dc2df556-3111-11e8-9fe8-c52a2ea0e008.png)

This is how they look inside the profiler:

"Messages"

![icon-1-profiler](https://user-images.githubusercontent.com/73419/37912208-43c402f0-3112-11e8-9a33-4e45ceb44b8b.png)

"Message Bus"

![icon-2-profiler](https://user-images.githubusercontent.com/73419/37912106-f3912f10-3111-11e8-827b-c8cc06c71ebe.png)

-----

My opinion:

* "Messages" look like "forum messages" or "chat messages". It looks wrong to me.
* Inside the profiler, "Messages" looks similar to "Translation" and we already have another "messages" icon for the "Mailer".
* For these reasons, I'd use "Message Bus".

Now, let's hear the community opinion. Thanks!

-----

If you want to test then on your computer:

"Messages"

```svg
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" height="24" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve"><path fill="#aaa" d="M11.32 9.06h-8a3.07 3.07 0 0 0-3.35 3v5a3.09 3.09 0 0 0 3.35 3h2.75l4 3.69c.42.35.89.21.89-.34v-3c2 0 4-1.5 4-3.35v-5c.04-1.85-1.79-3-3.64-3zM11 16.5H4a.5.5 0 1 1 0-1h7a.5.5 0 0 1 0 1zm0-2.63H4a.5.5 0 0 1-.5-.5.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5.5.5 0 0 1-.5.5zM21.29.06h-6.46A2.83 2.83 0 0 0 12 2.89v5.33c3.31 0 4 2.28 4 4.72 0 .44.46.56.8.28l3.31-3.16h1.21A2.71 2.71 0 0 0 24 7.35V2.77A2.71 2.71 0 0 0 21.29.06zm-.81 6.66h-5a.5.5 0 0 1-.5-.5.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5.5.5 0 0 1-.5.5zm0-2.63h-5a.5.5 0 0 1-.5-.5.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5.5.5 0 0 1-.5.5z"/></svg>
```

"Message Bus"

```svg
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" height="24" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve"><path fill="#aaa" d="M16 9a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2h-3V4a1 1 0 0 0-1-1H8a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2h3v6H8a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2h3v9a1 1 0 0 0 2 0v-5h3a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-2a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2h-3V9zm2.52-2.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zm0 1.63h3a.5.5 0 0 1 .5.5.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5.5.5 0 0 1 .5-.52zm-13-2.82h-3a.5.5 0 0 1-.5-.5.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5.5.5 0 0 1-.54.48zm0-1.62h-3a.5.5 0 0 1-.5-.5.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5.5.5 0 0 1-.54.48zm0 9.62h-3a.5.5 0 0 1-.5-.5.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5.5.5 0 0 1-.54.48zm0-1.62h-3a.5.5 0 0 1-.5-.5.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5.5.5 0 0 1-.54.48zm13 2.81h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zm0 1.63h3a.5.5 0 0 1 .5.5.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5.5.5 0 0 1 .5-.52z"/></svg>
```

Commits
-------

92a041c074 Updated the Messenger profiler panel
2018-03-27 09:13:34 +02:00
Javier Eguiluz
92a041c074 Updated the Messenger profiler panel 2018-03-27 09:13:31 +02:00
Fabien Potencier
6806f664f3 minor #26676 [Messenger] Uses the messenger.message_handler tag instead of message.handler (sroze)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Messenger] Uses the `messenger.message_handler` tag instead of `message.handler`

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no (technically, it's not even in 4.1)
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ø
| License       | MIT

After a few days using it, it feels weird to have the `messenger.receiver` and `messenger.sender` tags while the one for message handlers is `message_handler`. I believe that for consistency, this would make sense to rename this tag `messenger.message_handler`.

As we don't have tests for this pass yet (will be added in https://github.com/symfony/symfony/pull/26672) there is nothing else to change (but the documentation).

Commits
-------

bddebc47b8 Uses the `messenger.message_handler` tag instead of `message.handler`
2018-03-27 09:12:41 +02:00
Fabien Potencier
05b9f648ee feature #26671 More compact display of vendor code in exception pages (javiereguiluz)
This PR was squashed before being merged into the 4.1-dev branch (closes #26671).

Discussion
----------

More compact display of vendor code in exception pages

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

I like the general idea proposed in #23152 ... but I don't like the implementation ... so this PR is an alternative implementation.

**UPDATE**: the proposed feature has been completely redesigned. See https://github.com/symfony/symfony/pull/26671#issuecomment-376157869

~~The idea is to **hide by default all information that comes from "vendors"** (`vendor/` or `var/cache/` dir) because that code is out of your reach and you can't change it to fix your error.~~

~~In practice, each exception trace now would display a `Hide vendors` option enabled by default:~~

<details>
<summary>Click here to view the outdated images</summary>

![hide-vendors](https://user-images.githubusercontent.com/73419/37895113-a9d942bc-30e0-11e8-9ff4-191dcb057d60.png)

It works like a toggle ... and it's compatible with the overall toggle of each trace header:

![hide-vendors](https://user-images.githubusercontent.com/73419/37895137-b9e8d406-30e0-11e8-82bd-5729d32aaa63.gif)

When exceptions are complex, the amount of noise removed is massive:

## Before

![before](https://user-images.githubusercontent.com/73419/37895233-f9170eea-30e0-11e8-8c21-c514007d44d2.png)

## After

![after](https://user-images.githubusercontent.com/73419/37895240-fc2e50c0-30e0-11e8-9e5a-b7a73ba57b47.png)

</details>

Commits
-------

510b05fb74 More compact display of vendor code in exception pages
2018-03-27 09:07:13 +02:00
Javier Eguiluz
510b05fb74 More compact display of vendor code in exception pages 2018-03-27 09:07:12 +02:00
Fabien Potencier
209b32fa88 feature #26502 [Form] Add Bootstrap 4 style for field FileType (zenmate)
This PR was squashed before being merged into the 4.1-dev branch (closes #26502).

Discussion
----------

[Form] Add Bootstrap 4 style for field FileType

| Q             | A
| ------------- | ---
| Branch?       | master<!-- see below -->
| Bug fix?      | no
| New feature?  | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #26464   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
 - 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.
-->

Commits
-------

df577180e7 [Form] Add Bootstrap 4 style for field FileType
2018-03-27 09:05:23 +02:00
zenmate
df577180e7 [Form] Add Bootstrap 4 style for field FileType 2018-03-27 09:05:22 +02:00
Haralan Dobrev
49a144f28c Support phpdbg SAPI in Debug::enable() 2018-03-27 09:04:21 +02:00
Maxime Steinhausser
11a0392516 [HttpKernel] DumpDataCollector: do not flush when a dumper is provided 2018-03-27 08:12:08 +02:00
Nicolas Grekas
c2a67aa5a7 feature #23888 [DI] Validate env vars in config (ro0NL)
This PR was squashed before being merged into the 4.1-dev branch (closes #23888).

Discussion
----------

[DI] Validate env vars in config

| Q             | A
| ------------- | ---
| Branch?       | 4.1/master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #22151, #25868
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/issues/8382

This PR registers the env placeholders in `Config\BaseNode` with its default value or an empty string. It doesnt request real env vars during compilation,

What it does is if a config value exactly matches a env placeholder, we validate/normalize the default value/empty string but we keep returning the env placeholder as usual. If a placeholder occurs in the middle of a string it also proceeds as usual.

The latter to me is OK as you need to expect any string value during runtime anyway,  including the empty string.

Commits
-------

2c74fbc [DI] Validate env vars in config
2018-03-27 08:02:10 +02:00
Roland Franssen
2c74fbc3c5 [DI] Validate env vars in config 2018-03-27 08:02:00 +02:00
Samuel ROZE
bddebc47b8 Uses the messenger.message_handler tag instead of message.handler 2018-03-26 21:48:21 +01:00
Samuel ROZE
5acc51f5f7 bug #26649 [Messenger] Remove the default transport if no serializer service (sroze)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Messenger] Remove the default transport if no `serializer` service

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

If the `serializer` service does not exist, we remove the default transport services as they rely on it.

Commits
-------

2bcf93db2d Remove the default transport if no serializer
2018-03-26 20:58:57 +01:00
Amrouche Hamza
406bfc9896
[FrameworkBundle] keep query params in redirection 2018-03-26 16:59:39 +02:00
Nicolas Grekas
599dbca3cd [DI] Fix hardcoded cache dir for warmups 2018-03-26 13:32:25 +02:00
Maxime Steinhausser
eef10b19c6 [VarDumper] Provide binary, allowing to start a server at any time
as soon as the "symfony/var-dumper" & "symfony/console" components are available.
2018-03-25 20:38:27 +02:00
Javier Eguiluz
074d68d67f Improved the Ajax profiler panel when there are exceptions 2018-03-25 13:25:04 +02:00
Fabien Potencier
4a602ca652 feature #26658 Adding support to bind scalar values to controller arguments (weaverryan)
This PR was merged into the 4.1-dev branch.

Discussion
----------

Adding support to bind scalar values to controller arguments

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

Hi guys!

This fixes (I think) the last rough edge with autowiring & error messages. 100% credit to @nicolas-grekas for this implementation - he has generously allowed me to steal his code in return for writing the test. I did test this on a real project.

Cheers!

Commits
-------

2c7198cdd0 Adding support to bind scalar values to controller arguments
2018-03-25 10:41:36 +02:00
Nicolas Grekas
9e8e0630a9 [DI] Add ContainerInterface::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE 2018-03-24 17:54:13 +01:00
Grégoire Pineau
ce66ef028f bug #26657 [Workflow] Fixed default parameters (lyrixx)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Workflow] Fixed default parameters

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

Commits
-------

fc303a8 [Workflow] Fixed default parameters
2018-03-23 17:00:48 +01:00
Ryan Weaver
2c7198cdd0 Adding support to bind scalar values to controller arguments 2018-03-23 11:48:06 -04:00
Mathieu Piot
585ca28b8a Add return type hint 2018-03-23 15:53:02 +01:00
Mathieu Piot
859ee03785 Revert: remove comment line from twig templates 2018-03-23 15:53:02 +01:00
Mathieu Piot
d723756331 Fix some mistakes 2018-03-23 15:53:02 +01:00
Mathieu Piot
c74e0dc2da Use spaceless balises in Twig templates 2018-03-23 15:53:02 +01:00
Mathieu Piot
8b937ff43f Try without try/catch 2018-03-23 15:53:02 +01:00
Mathieu Piot
32bf1f68ad Test the renderHelp method in all Tests about help to skip them if necessary. 2018-03-23 15:53:02 +01:00
Mathieu Piot
437b77e81a Skip renderHelp test as skipped if not override 2018-03-23 15:53:02 +01:00
Mathieu Piot
d84be700b2 Update composer files 2018-03-23 15:53:02 +01:00
Mathieu Piot
075fcfd07c [FrameworkBundle] Add widgetAtt to formTable/form_row 2018-03-23 15:53:02 +01:00
Mathieu Piot
f1d13a860c Fix Fabpot.io 2018-03-23 15:53:02 +01:00
Nyholm
69ded67643 Added form_help on horizontal design and removed special variable 2018-03-23 15:53:02 +01:00
Mathieu Piot
fd53bc579a Enable aria-described in row for all Templates 2018-03-23 15:53:02 +01:00
Mathieu Piot
98065d38b5 fabpot.io fix 2018-03-23 15:53:02 +01:00
Mathieu Piot
edb95f8e44 Use array long syntax 2018-03-23 15:53:02 +01:00
Mathieu Piot
aada72c5d4 Set help option on nul as default 2018-03-23 15:53:02 +01:00
Mathieu Piot
f948147e38 Rename help id (snake_case) 2018-03-23 15:53:02 +01:00
Mathieu Piot
77fa3178bd Fix Test 2018-03-23 15:53:02 +01:00
Mathieu Piot
30deaa9b28 PSR fix 2018-03-23 15:53:02 +01:00
Mathieu Piot
bf4d08c5ae Add aria-describedBy on input 2018-03-23 15:53:02 +01:00
Mathieu Piot
1f3a15e33b Rename id 2018-03-23 15:53:02 +01:00
Mathieu Piot
058489d7df Add an id to the help 2018-03-23 15:53:02 +01:00
Mathieu Piot
6ea7a2054b Remove vars option from form_help 2018-03-23 15:53:02 +01:00
Mathieu Piot
ba798dfdf4 FrameworkBundle Tests 2018-03-23 15:53:02 +01:00
Mathieu Piot
4f2581d7da Use array long syntax 2018-03-23 15:53:02 +01:00
Mathieu Piot
f15bc79df1 Fix coding standards 2018-03-23 15:53:02 +01:00
Mathieu Piot
c934e496d2 Add test without help set 2018-03-23 15:53:02 +01:00
Mathieu Piot
8094804522 Add Tests 2018-03-23 15:53:02 +01:00
Mathieu Piot
067c681580 Template for table, Foundation and Bootstrap 3 2018-03-23 15:53:02 +01:00
Mathieu Piot
d3e3e492df Fix: check translation domain 2018-03-23 15:53:02 +01:00
Mathieu Piot
2c2c04549f Adapt existant tests 2018-03-23 15:53:02 +01:00
Mathieu Piot
831693ad45 Add trans filter 2018-03-23 15:53:01 +01:00
Mathieu Piot
e311838aed Remove raw filter for help 2018-03-23 15:53:01 +01:00
Mathieu Piot
8b97c1b516 Use a shortcut to acces help var in Twig template 2018-03-23 15:53:01 +01:00
Mathieu Piot
1b89f9d9dd Add a template fot div_layout 2018-03-23 15:53:01 +01:00
Mathieu Piot
c8914f591e Add a data_help method in Form 2018-03-23 15:53:01 +01:00
Grégoire Pineau
fc303a8d9f [Workflow] Fixed default parameters 2018-03-23 15:16:51 +01:00
Grégoire Pineau
838548c54f Finished implementation of TransitionException 2018-03-23 11:28:40 +01:00
Andrew Tch
9fa4f794b0 implemented TransitionException to be thrown instead of Logic exception 2018-03-23 11:17:24 +01:00
Samuel ROZE
2bcf93db2d Remove the default transport if no serializer 2018-03-23 09:57:11 +00:00
Fabien Potencier
4bbdf06c10 feature #23831 [VarDumper] Introduce a new way to collect dumps through a server dumper (ogizanagi, nicolas-grekas)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[VarDumper] Introduce a new way to collect dumps through a server dumper

| Q             | A
| ------------- | ---
| Branch?       | 4.1 <!-- see comment below -->
| Bug fix?      | no
| New feature?  | yes <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | #22987 <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | todo <!--highly recommended for new features-->

Could also be interesting as alternate solution for #23442.

Inspired by the [`ServerLogHandler`](https://github.com/symfony/symfony/pull/21080) and @nicolas-grekas's [comment](https://github.com/symfony/symfony/pull/22987#issuecomment-305791102) in #22987.

---

## Description

This PR introduces a new `server:dump` command available in the `VarDumper` component.
Conjointly with a new `ServerDumper` data dumper, it allows to send serialized `Data` clones to a single centralized server, in charge of dumping them on CLI output, or in an file in HTML format.

## Showcase

### HTTP calls

For instance, when working on an API and dumping something, you might end up with a mix of your response and the CLI dumped version of the data you asked:

```php
class HelloController extends AbstractController
{
    /**
     * @Route("/hello")
     */
    public function hello(Request $request, UserInterface $user)
    {
        dump($request->attributes, $user);

        return JsonResponse::create([
            'status' => 'OK',
            'message' => "Hello {$user->getUsername()}"
        ]);
    }
}
```

<img width="732" alt="screenshot 2017-08-08 a 16 44 24" src="https://user-images.githubusercontent.com/2211145/29077731-0b2152d6-7c59-11e7-99dd-2d060a906d48.PNG">

You might even get the HTML dump version [under some conditions](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php#L146-L157).

Dumping to a server allows collecting dumps in a separate place:

<!--![server-dumper-http-to-cli-output](https://user-images.githubusercontent.com/2211145/29077977-8ace19ce-7c59-11e7-998e-ee9c49e67958.gif)-->

![server-dump-http-to-cli](https://user-images.githubusercontent.com/2211145/29226044-dcc95f12-7ed0-11e7-8343-40aeb7b18dd5.gif)

~⚠️ By swallowing the previous dumpers output, the dump data collector is not active when running the dump server. Disable swallowing if you want both.~ ➜ Dumps are still collected in the profiler thanks to f24712effc9fab1163c0053e2a0a0d5cc4f6473e

### CLI calls

The best probably is (to me) that you can also debug CLI applications...

![server-dump-cli](https://user-images.githubusercontent.com/2211145/29225951-84e29098-7ed0-11e7-8067-abaa9c50d169.gif)

<!--![server-dumper-cli-to-cli-output](https://user-images.githubusercontent.com/2211145/29078261-1eb950ea-7c5a-11e7-94ee-aa3ae3bf7fb0.gif)-->

...and get HTML formatted dumps:

![server-dumper-cli-to-html-output](https://user-images.githubusercontent.com/2211145/30784609-d7dc19b8-a158-11e7-9b11-88ae819cfcca.gif)

<!--![server-dump-cli-to-html](https://user-images.githubusercontent.com/2211145/29225866-2b5675e4-7ed0-11e7-98eb-339611bd94a7.gif)-->

<!--![server-dumper-cli-to-html-output](https://user-images.githubusercontent.com/2211145/29078247-17e33e5c-7c5a-11e7-94f7-47de6774e0e8.gif)-->

hence, benefit from all the features of this format (collapse, search, ...)

### HTML output at a glance

<img width="831" alt="screenshot 2017-08-11 a 19 28 25" src="https://user-images.githubusercontent.com/2211145/29225513-eae349f2-7ece-11e7-9861-8cda9e80ba7f.PNG">

The HTML output benefits from all the `HtmlDumper` features and contains extra informations about the context (sources, requests, command line, ...). It doesn't aim to replace the profiler for HTTP calls with the framework, but is really handy for CLI apps or by wiring it in your own web app, out of the framework usage.

### CLI output at a glance

<img width="829" alt="screenshot 2017-08-11 a 19 52 57" src="https://user-images.githubusercontent.com/2211145/29225482-c24afe18-7ece-11e7-8e83-d019b0d8303e.PNG">

## Usage within the framework

### Config

For instance, in your `config_dev.yml`:

```yml
#config_dev.yml
debug:
    server_dump: true
```

or in your `config.yml`:

```yml
#config.yml
debug:
    server_dump: '%kernel.debug%'
```

~~The configuration also allows to set a `host` option, but there is already a sensible default value (`tcp://0.0.0.0:9912`) so you don't have to deal with it.~~ Since b002175, in case you want to change the default host value used, simply use the `VAR_DUMPER_SERVER` env var.

When the server is running, all dumps are collected by the server and previous dumpers ones are "swallowed" ~~by default. If you want both to collect dumps on the server AND keep previous dumpers on regular outputs, you can disable swallowing:~~

<!--
```yml
debug:
    server_dump:
        swallow: false
```
-->

When the server isn't running or in case of failure to send the data clones to the server, the server dumper will delegates to the configured wrapped dumper, so dumps are displayed and collected as usual.

### Running the server

```bash
bin/console server:dump [--format=cli|html]
```

#### Options

- ~~The `output` option defaults to `null` which will display dumps on CLI. It accepts a file path in which dumps will be collected in HTML format.~~
- The `format` option allows to switch format to use. For instance, use the `html` format and redirect the output to a file in order to open it in your browser and inspect dumps in HTML format.
- ~~The default `host` value is the same as the one configured under the `debug.server_dump.host` config option, so you don't have to deal with it in most cases.~~
    Since b002175, in case you want to change the default host value used, simply use the `VAR_DUMPER_SERVER` env var:

    ```bash
    VAR_DUMPER_SERVER=0.0.0.0:9204 bin/console server:dump
    ```

## Manual wiring

If you want to wire it yourself in your own project or using it to inspect dumps as html before the kernel is even boot for instance:

```php
$host = 'tcp://0.0.0.0:9912'; // use null to read from the VAR_DUMPER_SERVER env var
$cloner = new VarCloner();
$dumper = new ServerDumper($host, new CliDumper());

VarDumper::setHandler(function ($var) use ($dumper, $cloner) {
    $dumper->dump($cloner->cloneVar($var));
});
```

## Create your own server app

The component already provides a default server app by means of the `ServerDumpCommand`, but
 you could also build your own by using the `DumpServer`:

```php
$host = 'tcp://0.0.0.0:9912'; // use null to read from the VAR_DUMPER_SERVER env var

$server = new DumpServer($host);

$server->start();

$server->listen(function (Data $data, array $context, $clientId) {
    // do something
});
```

Commits
-------

138dad6440 [VarDumper] Some tweaks after Nicolas' commit & ServerDumperPlaceholderCommand
088c52ed70 [VarDumper] Review config to use debug.dump_destination & tweak data collector
3db14045d4 [VarDumper] Introduce a new way to collect dumps through a server dumper
2018-03-23 10:18:50 +01:00
Maxime Steinhausser
138dad6440 [VarDumper] Some tweaks after Nicolas' commit & ServerDumperPlaceholderCommand 2018-03-23 10:12:13 +01:00
Nicolas Grekas
088c52ed70 [VarDumper] Review config to use debug.dump_destination & tweak data collector
(cherry picked from commit 602b9a8)
2018-03-23 10:11:10 +01:00
Maxime Steinhausser
3db14045d4 [VarDumper] Introduce a new way to collect dumps through a server dumper 2018-03-23 10:11:09 +01:00
Christian Flothmann
7fd4d74493 [Routing] fix tests 2018-03-23 09:14:09 +01:00
Fabien Potencier
54305d669e feature #26220 [HttpFoundation] Use parse_str() for query strings normalization (nicolas-grekas)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[HttpFoundation] Use parse_str() for query strings normalization

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

Follow up of #26214 and #26202

The current normalization logic is both too loose and too broad: it changes the order of recursive data structures, while not normalizing keys.
Since the normalization logic varies by query string parser, I'd like to propose a logic that exactly matches the native PHP one, which is exposed to userland via `parse_str()`. Using this, we accurately remove all useless information, while preserving all the meaningful one.

(The change in `overrideGlobals()` is a bug fix to me btw, the current logic breaks the interpretation of legitimate query strings.)

Commits
-------

513353644b [HttpFoundation] Use parse_str() for query strings normalization
2018-03-23 09:03:49 +01:00
Fabien Potencier
e157dedc6a feature #24411 [Messenger] Add a new Messenger component (sroze)
This PR was squashed before being merged into the 4.1-dev branch (closes #24411).

Discussion
----------

[Messenger] Add a new Messenger component

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

As discussed in #24326. This PR is to help going forward with the discussions of having a Message component.

# Resources

| What | Where
| --- | ---
| Documentation | [In the PR](https://github.com/sroze/symfony/blob/add-message-component/src/Symfony/Component/Message/README.md)
| Demo | [In `sroze/symfony-demo:message-component-demo`](https://github.com/sroze/symfony-demo/compare/message-component-demo)
| [php-enqueue](https://github.com/php-enqueue/enqueue-dev) adapter | 1. Source: [In `sroze/enqueue-bridge`](https://github.com/sroze/enqueue-bridge) _(to be moved as `symfony/enqueue-bridge` I guess)_<br/>2. Demo: [In `sroze/symfony-demo:message-component-demo-with-enqueue`](https://github.com/sroze/symfony-demo/compare/message-component-demo...sroze:message-component-demo-with-enqueue)
| [Swarrot](https://github.com/swarrot/swarrot) adapter | **Outdated adapter, waiting for stabilization** 1. Source: [In `sroze/swarrot-bridge`](https://github.com/sroze/swarrot-bridge) _(to be moved as `symfony/swarrot-bridge` I guess)_<br/>2. Demo: [In `sroze/symfony-demo:message-component-demo-with-swarrot`](https://github.com/sroze/symfony-demo/compare/message-component-demo...sroze:message-component-demo-with-swarrot)
| [HTTP](https://github.com/sroze/message-http-adapter) adapter | **Outdated adapter, waiting for stabilization** 1. Source: [In `sroze/message-http-adapter`](https://github.com/sroze/message-http-adapter) <br/>2. Demo: [In `sroze/symfony-demo:message-component-demo-with-http-adapter`](https://github.com/sroze/symfony-demo/compare/message-component-demo...sroze:message-component-demo-with-http-adapter)
| Web profiler integration | _In the pull-request_

# Important points

1. **Tests are not in the PR as they were written in PhpSpec & Behat.** If we decide to go forward with this approach, I'll translate them to PHPUnit.
2. The aim is not to solve all the message/queuing problems but provide a good, simple and extensible message bus for developers.
3. The communication with the actual AMQP/API brokers is down to the adapters for now. Not sure if we need to ship some by default or not 🤔

I guess that this would replace #23842 & #23315.

# Changes from the proposals

Based on the comments, a few changes have been made from the proposal.

1. `MessageProducer`s have been renamed to `MessageSender`s
2. `MessageConsumer`s have been renamed to `MessageReceiver`s

Commits
-------

c9cfda990b [Messenger] Add a new Messenger component
2018-03-23 09:01:57 +01:00
Samuel ROZE
c9cfda990b [Messenger] Add a new Messenger component 2018-03-23 09:01:52 +01:00
Fabien Potencier
acf49e9d85 feature #22150 [Serializer] Added a ConstraintViolationListNormalizer (lyrixx)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[Serializer] Added a ConstraintViolationListNormalizer

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

---

It seems logical to me that Symfony is able to serialise natively some very common Symfony data structure. (and requested by @nicolas-grekas & @javiereguiluz )

Usage example (from symfony/symfony-demo):

```php
    /**
     * @Route("", name="api_blog_new")
     * @Method("POST")
     * @Security("is_granted('ROLE_ADMIN')")
     */
    public function newAction(Request $request)
    {
        $data = $request->getContent();

        $post = $this->get('serializer')->deserialize($data, Post::class, 'json', ['groups' => ['post_write']]);

        $post->setAuthor($this->getUser());

        $violations = $this->get('validator')->validate($post);

        $post->setSlug($this->get('slugger')->slugify($post->getTitle()));

        if (count($violations) > 0) {
            $repr = $this->get('serializer')->serialize($violations, 'json');

            return JsonResponse::fromJsonString($repr, 400);
        }

        $this->getDoctrine()->getManager()->persist($post);
        $this->getDoctrine()->getManager()->flush();

        $repr = $this->get('serializer')->serialize($post, 'json', ['groups' => ['post_read']]);

        return JsonResponse::fromJsonString($repr);
    }
```

Commits
-------

2a35d09f53 [Serializer] Added a ConstraintViolationListNormalizer
2018-03-23 08:59:18 +01:00
Robin Chalas
7eae6afe49 feature #26639 [SecurityBundle] Added an alias from RoleHierarchyInterface to security.role_hierarchy (lyrixx)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[SecurityBundle] Added an alias from RoleHierarchyInterface to security.role_hierarchy

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

It's needed for autowirering

---

Note: I'm not sure if this is a bug fix or a new feature.

Commits
-------

886b8a6 [SecurityBundle] Added an alias from RoleHierarchyInterface to security.role_hierarchy
2018-03-23 02:03:39 +01:00
Grégoire Pineau
886b8a6e29 [SecurityBundle] Added an alias from RoleHierarchyInterface to security.role_hierarchy 2018-03-22 17:50:26 +01:00
Nicolas Grekas
1ad45962df bug #26600 [Routing] Fixed the importing of files using glob patterns that match multiple resources (skalpa)
This PR was squashed before being merged into the 3.4 branch (closes #26600).

Discussion
----------

[Routing] Fixed the importing of files using glob patterns that match multiple resources

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

This fixes the import of resources specified using glob patterns in `XmlFileLoader` and `YamlFileLoader`.

@nicolas-grekas This supersedes #25633 that's been in limbo since December despite your comments, so I decided to take care of it as I need this to work. I took care of the two loaders that are affected, and added tests.

Commits
-------

948b4cf [Routing] Fixed the importing of files using glob patterns that match multiple resources
2018-03-22 16:22:13 +01:00
Pascal Luna
948b4cfe3e [Routing] Fixed the importing of files using glob patterns that match multiple resources 2018-03-22 16:22:11 +01:00
ismail1432
f276989b48 [Ldap] cast to string when checking empty passwords 2018-03-22 16:20:30 +01:00
Nicolas Grekas
2faaf11e03 bug #26626 [WebProfilerBundle] use the router to resolve file links (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[WebProfilerBundle] use the router to resolve file links

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

Commits
-------

2cfc573 [WebProfilerBundle] use the router to resolve file links
2018-03-22 16:03:55 +01:00
Nicolas Grekas
95fd81b5d8 [DI] deprecate TypedReference::canBeAutoregistered() and getRequiringClass() 2018-03-22 15:55:20 +01:00
Nicolas Grekas
9131bd1c4b Merge branch '4.0'
* 4.0:
  [DI] Dont tell about autoregistration in strict autowiring mode
  [DI] Cleanup remainings from autoregistration
  [Process] Remove a useless cast
  [PHPunit] suite variable should be used
2018-03-22 14:45:58 +01:00
Nicolas Grekas
0c8ca6acdb Merge branch '3.4' into 4.0
* 3.4:
  [DI] Dont tell about autoregistration in strict autowiring mode
  [PHPunit] suite variable should be used
2018-03-22 14:42:36 +01:00