Commit Graph

40704 Commits

Author SHA1 Message Date
Antonio Pauletich
8e6d0df3ec
Add Beanstalkd Messenger bridge 2020-08-13 09:43:16 +02:00
Fabien Potencier
ab3b0c92f2 feature #35967 [VarDumper] Add VAR_DUMPER_FORMAT=server format (ogizanagi)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[VarDumper] Add VAR_DUMPER_FORMAT=server format

| Q             | A
| ------------- | ---
| Branch?       | master<!-- see below -->
| Bug fix?      | no
| New feature?  | yes<!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #35801 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | TODO <!-- required for new features -->

This PR follows discussion in #35801 and adds support for a `server` value for the existing `VAR_DUMPER_FORMAT` env var.

It comes as well with two more things:
- ~~the handler is registered as soon as the `VAR_DUMPER_FORMAT` env var is detected~~ we prevent registering another handler as soon as the `VAR_DUMPER_FORMAT` env var is set, instead of checking if there was a previous handler (which could make this env var useless in some conditions where the handler was already set by another "process")
- the handler registered this way cannot be replaced. This prevents another "process" to takeover dump handling while undesired. E.g: a phpunit functional test booting the kernel to call an endpoint => the handler is replaced. It's (in a sense) a satisfying alternative to #26696

This PR means anyone can use dump with a server in any context, without changing a single line of code in the project by:
- starting the server using `./vendor/bin/var-dump-server --format=html > dumps.html`
- using the env var: `VAR_DUMPER_FORMAT=server [your-cli-command]`

---
Previous related PRs:
- https://github.com/symfony/symfony/pull/26695
- https://github.com/symfony/symfony/pull/26696

Commits
-------

82df6dbcda [VarDumper] Add VAR_DUMPER_FORMAT=server format
2020-08-13 09:36:26 +02:00
Maxime Steinhausser
82df6dbcda [VarDumper] Add VAR_DUMPER_FORMAT=server format 2020-08-13 09:36:20 +02:00
Grégoire Pineau
cfc53ad732 [Workflow] Choose which Workflow events should be dispatched (fix previous commit) 2020-08-13 09:08:45 +02:00
Stewart Malik
d70074753c [Workflow] Choose which Workflow events should be dispatched 2020-08-13 09:00:04 +02:00
Fabien Potencier
da60fbe6cd Merge branch '5.1'
* 5.1:
  [Validator] RangeTest: fix expected deprecation
  Fix bad merge
  [Yaml] Fix for #36624; Allow PHP constant as first key in block
  Use PHPUnit 9.3 on php 8.
  fix mapping errors from unmapped forms
  [Validator] Add target guards for Composite nested constraints
2020-08-13 08:27:49 +02:00
Fabien Potencier
2b0fdc9857 Merge branch '4.4' into 5.1
* 4.4:
  [Validator] RangeTest: fix expected deprecation
  [Yaml] Fix for #36624; Allow PHP constant as first key in block
  Use PHPUnit 9.3 on php 8.
  fix mapping errors from unmapped forms
  [Validator] Add target guards for Composite nested constraints
2020-08-13 08:24:11 +02:00
Fabien Potencier
a379051c82 Merge branch '3.4' into 4.4
* 3.4:
  [Yaml] Fix for #36624; Allow PHP constant as first key in block
  Use PHPUnit 9.3 on php 8.
  fix mapping errors from unmapped forms
  [Validator] Add target guards for Composite nested constraints
2020-08-13 08:22:32 +02:00
Fabien Potencier
a45428c293 feature #20054 [Console] Different approach on merging application definition (ro0NL)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Console] Different approach on merging application definition

| Q | A |
| --- | --- |
| Branch? | "master" |
| Bug fix? | yes |
| New feature? | not really (refactoring) |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | #19181, #17804, #19909, partially #20030 |
| License | MIT |
| Doc PR | reference to the documentation PR, if any |

Before/After:

``` diff
$ bin/console list -h
Usage:
  list [options] [--] [<namespace>]

Arguments:
  namespace            The namespace name

Options:
      --raw            To output raw command list
      --format=FORMAT  The output format (txt, xml, json, or md) [default: "txt"]
+  -h, --help            Display this help message
+  -q, --quiet           Do not output any message
+  -V, --version         Display this application version
+      --ansi            Force ANSI output
+      --no-ansi         Disable ANSI output
+  -n, --no-interaction  Do not ask any interactive question
+  -e, --env=ENV         The environment name [default: "dev"]
+      --no-debug        Switches off debug mode
+  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  The list command lists all commands:

    php bin/console list

  You can also display the commands for a specific namespace:

    php bin/console list test

  You can also output the information in other formats by using the --format option:

    php bin/console list --format=xml

  It's also possible to get raw list of commands (useful for embedding command runner):

    php bin/console list --raw
```

This could deprecate `getNativeDefinition` or make it a feature as right now it's internal and unused.

edit: resolved the BC break.

edit2: question is.. should this target 2.7?

Commits
-------

553b173a30 [Console] Different approach on merging application definition
2020-08-13 08:19:16 +02:00
Fabien Potencier
acda2dc31e feature #36648 [Notifier] Add Mobyt bridge (Deamon)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Notifier] Add Mobyt bridge

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       |  #33687
| License       | MIT
| Doc PR        | symfony/symfony-docs#13606
| recipe PR   | symfony/recipes#768

Add Mobyt notifier bridge.

In this SMS Provider, you can choose a sort of "quality service" to send the message.

I updated `src/Symfony/Component/Notifier/Message/SmsMessage.php` to add the notification in order to be able to use the notification importance when creating options.

Commits
-------

bf594b75d0 Add Mobyt Notifier bridge
2020-08-13 08:02:00 +02:00
Laurent VOULLEMIER
986a0a221e [FrameworkBundle] Allow to leverage autoconfiguration for DataCollectors with template 2020-08-12 20:58:59 +02:00
Deamon
bf594b75d0 Add Mobyt Notifier bridge 2020-08-12 18:10:23 +02:00
Fabien Potencier
31c194f7de feature #37359 [Security] Add event to inspect authenticated token before it becomes effective (scheb)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[Security] Add event to inspect authenticated token before it becomes effective

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| License       | MIT
| Doc PR        | n/a

Hello there, I'm the author of `scheb/two-factor-bundle`, which extends Symfony's security layer with two-factor authentication. I've been closely following the recent changes by @wouterj to rework the security layer with "authenticators" (great work!). While I managed to make my bundle work with authenticators, I see some limitations in the security layer that I'd like to address to make such extensions easier to implement.

This PR adds a new event, which is disapatched right after the authenticated token has been created by the authenticator, to "announce" it to the application *before* it becomes effective to the security system. The event works similar to `ResponseEvent`, but for security token. It allows listeners to inspect the new token before it becomes effective and - most importantly - apply modifications to it. So components other than the authenticator will be able to influence how the security token looks like, that will be set to the security layer on successful authentication.

Why would you want to do this? Of course I'm looking at this from the 2fa perspective. To make 2fa work, it's necessary to prevent a newly created authenticated token from becoming visible to the security system and therefore exposing its privileges/roles. This is done by replacing the authenticated token with a temporary "TwoFactorToken". Currently I'm doing this through dependency injection, getting all the registered authenticators and decorating them with my own token-exchange logic. This is not very clean and overly complicated, but it works. Adding this event as a hook-in point would allow for a much cleaner integration for any component that wants to have a saying in how the security token should look like.

Commits
-------

20309646b7 [Security] Add event to inspect authenticated token before it becomes effective
2020-08-12 18:06:37 +02:00
Christian Scheb
20309646b7 [Security] Add event to inspect authenticated token before it becomes effective 2020-08-12 18:06:29 +02:00
Fabien Potencier
3cd112328c minor #37813 [Workflow] Simplify code + Updated README.md (lyrixx)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Workflow] Simplify code + Updated README.md

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #37539 (cleaning previous PR)
| License       | MIT
| Doc PR        |

Commits
-------

3268bdb90c [Workflow] Simplify code + Updated README.md
2020-08-12 16:53:19 +02:00
Fabien Potencier
684b04bb9c minor #37811 [FrameworkBundle] Fix 7.4 CachePools integration tests (ogizanagi)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[FrameworkBundle] Fix 7.4 CachePools integration tests

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | #36691 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | N/A

Attempt to fix https://github.com/symfony/symfony/runs/975252922#step:11:56 on master.

Commits
-------

d3ef8ba3bd [FrameworkBundle] Fix 7.4 CachePools integration tests
2020-08-12 16:49:52 +02:00
Grégoire Pineau
3268bdb90c [Workflow] Simplify code + Updated README.md 2020-08-12 15:41:55 +02:00
Grégoire Pineau
25095d8908 feature #37539 [Workflow] Added Context to Workflow Event (epitre)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Workflow] Added Context to Workflow Event

There's also a default context for the initial marking event.

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #37421
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/13947

This time, I need context in the events, because, sometimes, the transition is automatic and sometimes, it is manual. I want to be able to make the difference. I figured using the context for that is a good idea. I hope you do too :)

By the way, I believe it also fixes #37421 . I took @pluk77 request to be able to differentiate an initial marking by having a default context in that case

Commits
-------

bfe07dda83 Added Context to Workflow Event There's also a default context for the initial marking event.
2020-08-12 15:17:24 +02:00
Maxime Steinhausser
d3ef8ba3bd [FrameworkBundle] Fix 7.4 CachePools integration tests 2020-08-12 15:07:58 +02:00
Roland Franssen
553b173a30 [Console] Different approach on merging application definition 2020-08-12 14:42:14 +02:00
Maxime Steinhausser
33c8c3a63d [Validator] RangeTest: fix expected deprecation 2020-08-12 11:54:23 +02:00
noniagriconomie
eb067ed58e [Notifier] add doc for free mobile dsn 2020-08-12 11:21:02 +02:00
Fabien Potencier
5afac1df4e Fix bad merge 2020-08-12 11:06:24 +02:00
Fabien Potencier
9b197fe839 Fix bad merge 2020-08-12 11:05:56 +02:00
Fabien Potencier
78f4a9f410 Merge branch '5.1'
* 5.1:
  Fix for issue #37681
  Revert changes to Table->fillCells()
  [Console] Table: support cells with newlines after a cell with colspan >= 2
  Fix redis connect with empty password
  [Validator] Add BC layer for notInRangeMessage when min and max are set
2020-08-12 10:46:31 +02:00
Fabien Potencier
806ef94e98 Merge branch '4.4' into 5.1
* 4.4:
  Fix for issue #37681
  Revert changes to Table->fillCells()
  [Console] Table: support cells with newlines after a cell with colspan >= 2
  Fix redis connect with empty password
  [Validator] Add BC layer for notInRangeMessage when min and max are set
2020-08-12 10:45:47 +02:00
Fabien Potencier
f3753e93d8 bug #36140 [Validator] Add BC layer for notInRangeMessage when min and max are set (l-vo)
This PR was merged into the 4.4 branch.

Discussion
----------

[Validator] Add BC layer for notInRangeMessage when min and max are set

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36133
| License       | MIT
| Doc PR        |

According to #36133, the improvement added in  #32435 may lead to a BC break when the developer pass `min` and `max` options and a custom `minMessage` or `maxMessage`. In this case it's expected to receive a `minMessage`/`maxMessage` in the violation but a `notInRangeMessage` is received instead.

So in the following conditions:
- `min` and `max` options are set
- `minMessage` or `maxMessage` is set

A deprecation is triggered. If a limit is violated and matches to the min/max message passed as option (`minMessage` for `min` violated and `maxMessage` for `max` violated), `minMessage/maxMessage` is used in the violation instead of `notInRangeMessage`.

Commits
-------

092d85c947 [Validator] Add BC layer for notInRangeMessage when min and max are set
2020-08-12 10:39:50 +02:00
Fabien Potencier
92eae57fdb bug #35843 [Validator] Add target guards for Composite nested constraints (ogizanagi)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Add target guards for Composite nested constraints

| Q             | A
| ------------- | ---
| Branch?       | 3.4 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix https://github.com/symfony/symfony/pull/35815#pullrequestreview-362719298 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | N/A

Commits
-------

a08ddf7636 [Validator] Add target guards for Composite nested constraints
2020-08-12 10:12:34 +02:00
Fabien Potencier
7e85a6a6c6 bug #37803 Fix for issue #37681 (Rav)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

Fix for issue #37681

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #37681
| License       | MIT
| Doc PR        |

Allow BOM character and comments before `<!DOCTYPE html>` declaration in DomCrawler while choosing a parser implementation

Commits
-------

9bc249e0b9 Fix for issue #37681
2020-08-12 08:20:48 +02:00
Rav
9bc249e0b9 Fix for issue #37681 2020-08-12 08:20:35 +02:00
Ben Ramsey
0bf89cdf71
[Console] allow multiline responses to console questions 2020-08-11 16:25:31 -05:00
Jelle Raaijmakers
17263ca14d Revert changes to Table->fillCells()
These changes were introduced in https://github.com/symfony/symfony/pull/37731
but no longer contributed to the actual fix, which was to perform a
->copyRow().
2020-08-11 19:02:45 +02:00
Fabien Potencier
c56acfa817 Fix tests 2020-08-11 17:45:15 +02:00
Fabien Potencier
fee38131e1 Fix typo 2020-08-11 17:32:41 +02:00
Christian Flothmann
0e93216322 do not use deprecated mailer.logger_message_listener service 2020-08-11 17:21:52 +02:00
Fabien Bourigault
63cbf0abe8 [Serializer] Add CompiledClassMetadataFactory 2020-08-11 12:10:04 +02:00
Fabien Potencier
a77901d6db bug #37744 [Yaml] Fix for #36624; Allow PHP constant as first key in block (jnye)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Yaml] Fix for #36624; Allow PHP constant as first key in block

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36624
| License       | MIT
| Doc PR        |

When using a PHP constant in the first key of a mapping the parser would throw an exception. However if you used a PHP constant in any other key but the first it was allowed. This fix allows PHP constant as the first key.

I've included a test for this parser error along with the fix.

Commits
-------

46f635c492 [Yaml] Fix for #36624; Allow PHP constant as first key in block
2020-08-11 11:42:46 +02:00
Joshua Nye
46f635c492 [Yaml] Fix for #36624; Allow PHP constant as first key in block 2020-08-11 11:42:40 +02:00
Ahmed Raafat
f2b64ecc6a Add name property to the stopwatchEvent 2020-08-11 11:41:23 +02:00
Fabien Potencier
0e9cd90857 bug #37767 [Form] fix mapping errors from unmapped forms (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] fix mapping errors from unmapped forms

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #10519
| License       | MIT
| Doc PR        |

Commits
-------

235920a388 fix mapping errors from unmapped forms
2020-08-11 11:39:48 +02:00
Fabien Potencier
e7617da03f feature #34704 [Messenger] Add method HandlerFailedException::getNestedExceptionOfClass (tyx)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Messenger] Add method HandlerFailedException::getNestedExceptionOfClass

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| License       | MIT
| Doc PR        | in progress

I have many times use this kind of code on my own development. It helps when dealing with specific exception through a Messenger usage.

Example in an ExceptionListener, the exception you get could be a `HandlerFailedException` but you want a specific treatment when the original exception is different (like a RedirectResponse, or Http error code different).

edit: I finally also added a getNestedExceptionOfClass that could be useful too

Commits
-------

e0dd84b426 [Messenger] Add method HandlerFailedException::getNestedExceptionOfClass
2020-08-11 09:52:28 +02:00
Fabien Potencier
0f92b9a584 bug #37731 [Console] Table: support cells with newlines after a cell with colspan >= 2 (GMTA)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Console] Table: support cells with newlines after a cell with colspan >= 2

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | N/A
| License       | MIT
| Doc PR        | N/A

When rendering a table with a cell containing newlines after a cell with
colspan set to at least 2, every line in the cell with newlines except the
first one fails to render.

This case is fixed by calling `->fillCells()` on the unmerged rows and
implementing support for rows that start with a non-zero index for the columns.

While fixing this, I discovered another issue with colspan: if a cell following a
colspanned cell contains enough newlines to make the contents extend further
than the colspanned cell's contents, the cells become misaligned. This is now
also fixed.

Commits
-------

ca11772e3f [Console] Table: support cells with newlines after a cell with colspan >= 2
2020-08-11 09:29:54 +02:00
Jelle Raaijmakers
ca11772e3f [Console] Table: support cells with newlines after a cell with colspan >= 2 2020-08-11 09:29:48 +02:00
Remon van de Kamp
9731451b5a
Revert "[DependencyInjection] Resolve parameters in tag arguments"
This reverts commit 3dba1fe7bf.
2020-08-10 19:30:39 +02:00
Fabien Potencier
2318170181 Fix typo 2020-08-10 16:14:03 +02:00
Alexander Schranz
9946f7fecf Fix redis connect with empty password 2020-08-10 15:30:06 +02:00
Fabien Potencier
a6c27fdd3d feature #37537 [HttpKernel] Provide status code in fragment handler exception (gonzalovilaseca)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[HttpKernel] Provide status code in fragment handler exception

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

We have a use case where it would be useful to retrieve the status code in an exception listener from the exception thrown by the fragment handler, current solution is to extract it from the exception string which is ugly.
With this change we can get the status code from the exception directly.

Commits
-------

81ca1f00a3 [HttpKernel] Provide status code in fragment handler exception
2020-08-10 13:00:38 +02:00
Jérémy Romey
e138cba8cd [Notifier] Add Infobip bridge 2020-08-10 11:56:29 +02:00
Fabien Potencier
b912af9261 Merge branch '5.1'
* 5.1:
  Fix typo
  Fix deprecated libxml_disable_entity_loader
  Add Tagalog translations for validator messages 94, 95, 96 and 99
  PHPUnit's assertContains() performs strict comparisons now.
  [ClassLoader][Routing] Fix namespace parsing on php 8.
  Fix deprecated libxml_disable_entity_loader
  Made reference to PHPUnit\Util\XML::loadfile php5-compatible.
  [Validator] Add missing translations for german and vietnamese
  Modernized deprecated PHPUnit assertion calls
  [Console] The message of "class not found" errors has changed in php 8.
  The PHPUnit\Util\XML class has been removed in PHPUnit 9.3.
  [Console] Make sure we pass a numeric array of arguments to call_user_func_array().
  Remove outdated references from base_js.html.twig file
  [String] We cannot have a "provides" function in test cases.
  Typo: somes styles fixed
  [Serializer] Fix that it will never reach DOMNode
  [Validator] sync translations
  [VarDumper] Improve previous fix on light array coloration
  [Cache] Fix #37667
2020-08-10 10:10:48 +02:00
Fabien Potencier
c44c606b11 Merge branch '4.4' into 5.1
* 4.4:
  Fix typo
  Fix deprecated libxml_disable_entity_loader
  Add Tagalog translations for validator messages 94, 95, 96 and 99
  PHPUnit's assertContains() performs strict comparisons now.
  [ClassLoader][Routing] Fix namespace parsing on php 8.
  Fix deprecated libxml_disable_entity_loader
  Made reference to PHPUnit\Util\XML::loadfile php5-compatible.
  [Validator] Add missing translations for german and vietnamese
  Modernized deprecated PHPUnit assertion calls
  [Console] The message of "class not found" errors has changed in php 8.
  The PHPUnit\Util\XML class has been removed in PHPUnit 9.3.
  [Console] Make sure we pass a numeric array of arguments to call_user_func_array().
  [Serializer] Fix that it will never reach DOMNode
  [Validator] sync translations
  [VarDumper] Improve previous fix on light array coloration
  [Cache] Fix #37667
2020-08-10 10:03:57 +02:00