Commit Graph

47448 Commits

Author SHA1 Message Date
Fabien Potencier
c8725bf198 feature #35167 [Notifier] Remove superfluous parameters in *Message::fromNotification() (fancyweb)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Notifier] Remove superfluous parameters in *Message::fromNotification()

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

Those classes are final so I think we don't need those extra arguments.

Commits
-------

d0dacf51e1 [Notifier] Remove superfluous parameters in *Message::fromNotification()
2020-02-04 14:11:37 +01:00
Fabien Potencier
9b69b08062 feature #35415 Extracted code to expand an URI to UriExpander (lyrixx)
This PR was merged into the 5.1-dev branch.

Discussion
----------

Extracted code to expand an URI to `UriExpander`

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

When building a crawler we need to extract and to expand all links on a
web pages.

ATM, we need to create a DomDocument, attach the href, and ask for the
full URL.

This is a bit slow, and unecessary. This is why I extracted the minimal
code to expand the URL to its onw trait for better re-usability.

I benched (a specific part of) my application:

 * before: 2.16ms
 * after: 1.42ms

Commits
-------

0c499c6b35 Extracted code to expand an URI to `UriExpanderTrait`
2020-02-04 14:05:04 +01:00
Grégoire Pineau
0c499c6b35 Extracted code to expand an URI to UriExpanderTrait 2020-02-04 14:03:49 +01:00
Fabien Potencier
ef30ef55d0 Fix CS 2020-02-04 11:45:13 +01:00
Fabien Potencier
e3fa80a514 feature #35485 [Messenger] Add support for PostgreSQL LISTEN/NOTIFY (dunglas)
This PR was squashed before being merged into the 5.1-dev branch (closes #35485).

Discussion
----------

[Messenger] Add support for PostgreSQL LISTEN/NOTIFY

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a
| License       | MIT
| Doc PR        | todo

PostgreSQL comes with a builtin, performant, scalable and transactional pub/sub system called [`LISTEN`/`NOTIFY`](https://www.postgresql.org/docs/current/sql-notify.html).
This PR allows to leverage this mechanism when using the Messenger component with Postgres.

When the Postgres is used, workers are notified in real-time when a message is dispatched.
This reduces the latency, and prevents the worker from executing useless SQL queries. Basically, it allows to switch from a polling-based approach to an event-based one.

This patch can be used with all existing installation of Messenger, as long as the underlying DBMS is Postgres. For many (most ?) projects, it allows to get the benefits of using a queue system such as RabbitMQ or Pulsar without having to introduce new services to monitor, replicate or upgrade.

If PostgreSQL is used, `LISTEN`/`NOTIFY` is used automatically!

That's all!

It's also possible to configure how long the worker must wait for new messages:

```yaml
framework:
    messenger:
        transports:
            async:
                dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
                options:
                    pgsql_get_notify: true
                    pgsql_get_notify_timeout: 500
```

Then you can use start the workers with something like: `php bin/console messenger:consume --sleep=0`

A demo app using this new feature is available in this repository: https://github.com/dunglas/demo-postgres-listen-notify

TODO:

* [ ] Add tests

Commits
-------

01f33c3ab5 [Messenger] Add support for PostgreSQL LISTEN/NOTIFY
2020-02-04 11:44:36 +01:00
Kévin Dunglas
01f33c3ab5 [Messenger] Add support for PostgreSQL LISTEN/NOTIFY 2020-02-04 11:42:42 +01:00
Fabien Potencier
9613f84df5 minor #35589 [Mailer] Fix MandrillHttpTransport::getRecipients()'s call (chalasr)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Mailer] Fix MandrillHttpTransport::getRecipients()'s call

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

Should make the CI green.

Commits
-------

f88d1bb328 [Mailer] Fix MandrillHttpTransport::getRecipients()'s call
2020-02-04 11:37:49 +01:00
Fabien Potencier
cf9f5a071c feature #32039 [Cache] Add couchbase cache adapter (ajcerezo)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Cache] Add couchbase cache adapter

| Q             | A
| ------------- | ---
| Branch?       | 4.4 for features
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/32038
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/11748

Add new cache adapter to be able using Couchbase as cache system.

Commits
-------

1ae7dd5ec7 [Cache] Add couchbase cache adapter
2020-02-04 11:36:41 +01:00
Antonio José Cerezo Aranda
1ae7dd5ec7 [Cache] Add couchbase cache adapter 2020-02-04 11:32:31 +01:00
Nicolas Grekas
1e2b88f43e Merge branch '5.0'
* 5.0:
  cs fix
  Escape variable in Exception Template
2020-02-04 11:31:29 +01:00
Nicolas Grekas
244c347178 Merge branch '4.4' into 5.0
* 4.4:
  Escape variable in Exception Template
2020-02-04 11:31:13 +01:00
Robin Chalas
f88d1bb328 [Mailer] Fix MandrillHttpTransport::getRecipients()'s call 2020-02-04 11:29:55 +01:00
Fabien Potencier
eaec5d67ae bug #35588 [ErrorHandler] Escape variable in Exception template (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] Escape variable in Exception template

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

Commits
-------

629d21b800 Escape variable in Exception Template
2020-02-04 11:28:16 +01:00
Nicolas Grekas
6b18e7007a Merge branch '4.4' into 5.0
* 4.4:
  cs fix
2020-02-04 11:22:37 +01:00
Nicolas Grekas
f312e3cda6 Merge branch '3.4' into 4.4
* 3.4:
  cs fix
2020-02-04 11:21:54 +01:00
Fabien Potencier
f23aa969f4 feature #32433 [Translation] Introduce a way to configure the enabled locales (javiereguiluz)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[Translation] Introduce a way to configure the enabled locales

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

This implements the idea #31563 so we can decide if we want to add this or not. I tested it in the "Symfony Demo" app. Before: 107 catalogs created in cache/dev/translations/. After: 43 catalogs. But that's because the app is translated into lots of languages. In most cases, only 2 catalog files will be generated (vs 107 before).

If this idea is approved, I'll add tests and docs. Thanks.

Commits
-------

765843426e [Translation] Introduce a way to configure the enabled locales
2020-02-04 11:12:18 +01:00
Fabien Potencier
61774e6c07 Fix CS 2020-02-04 11:11:53 +01:00
Fabien Potencier
a416a66416 Fix bad merge 2020-02-04 11:11:20 +01:00
Fabien Potencier
a841a3e52c Fix CS 2020-02-04 11:10:55 +01:00
Fabien Potencier
2f5047ea3d Merge branch '5.0'
* 5.0:
  Fix bad merge
2020-02-04 11:03:49 +01:00
Fabien Potencier
a196d0571d Fix bad merge 2020-02-04 11:03:41 +01:00
Nicolas Grekas
c2e0aab7be cs fix 2020-02-04 10:59:34 +01:00
Javier Eguiluz
765843426e [Translation] Introduce a way to configure the enabled locales 2020-02-04 10:57:06 +01:00
Jérémy Derussé
629d21b800
Escape variable in Exception Template 2020-02-04 10:53:50 +01:00
Fabien Potencier
d5bbdca755 Merge branch '5.0'
* 5.0:
  Fix CS
  Fix CS
  Fix CS
2020-02-04 10:50:54 +01:00
Fabien Potencier
7322985070 minor #35587 Fix CS (fabpot)
This PR was merged into the 5.0 branch.

Discussion
----------

Fix CS

| Q             | A
| ------------- | ---
| Branch?       | 5.0 <!-- 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       | <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | n/a

Commits
-------

f64f59a9c0 Fix CS
2020-02-04 10:50:02 +01:00
Fabien Potencier
f64f59a9c0 Fix CS 2020-02-04 10:47:34 +01:00
Fabien Potencier
bb4e394949 Merge branch '4.4' into 5.0
* 4.4:
  Fix CS
  Fix CS
2020-02-04 10:41:09 +01:00
Fabien Potencier
03181ee843 minor #35586 Fix CS (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

Fix CS

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- 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       | <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        |  n/a

Commits
-------

de8348a033 Fix CS
2020-02-04 10:33:59 +01:00
Fabien Potencier
de8348a033 Fix CS 2020-02-04 10:32:40 +01:00
Fabien Potencier
3ee39e7468 Merge branch '3.4' into 4.4
* 3.4:
  Fix CS
2020-02-04 10:01:01 +01:00
Fabien Potencier
2e27353a19 minor #35584 Fix CS (fabpot)
This PR was merged into the 3.4 branch.

Discussion
----------

Fix CS

| Q             | A
| ------------- | ---
| Branch?       | 3.4 <!-- 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       | n/a <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | n/a

Commits
-------

a3e49f30c7 Fix CS
2020-02-04 09:15:25 +01:00
Fabien Potencier
7784d9fca2 feature #33003 [Filesystem] Add $suffix argument to tempnam() (jdufresne)
This PR was submitted for the 4.4 branch but it was merged into the 5.1-dev branch instead (closes #33003).

Discussion
----------

[Filesystem] Add $suffix argument to tempnam()

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

**Description**

The `tempnam()` interface was previously:

```php
tempnam($dir, $prefix)
```

This adds a third argument, `$suffix`, that is appended to the filename after the random component. This defaults to `''` for backwards compatibility. This is quite useful when the temporary file is consumed for a specific purpose that expects a suffix.

**Example**

```php
$filesystem->tempnam('/tmp', 'prefix_', '.png');
```

Would create a file like: `/tmp/prefix_abcd1234.png`.

Commits
-------

ef1206964e [Filesystem] Add $suffix argument to tempnam()
2020-02-04 09:10:02 +01:00
Jon Dufresne
ef1206964e [Filesystem] Add $suffix argument to tempnam()
Fixes #33002
2020-02-04 09:09:47 +01:00
Fabien Potencier
a3e49f30c7 Fix CS 2020-02-04 09:04:52 +01:00
Nicolas Grekas
8e22719130 feature #35347 [VarDumper] Add a RdKafka caster (romainneutron)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[VarDumper] Add a RdKafka caster

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

Hello,

This is the very beginning of this new feature.
First, I'd like to know if there's a no-go for this feature so I won't waste my time.
Then, if you are a RdKafka expert, I'd take your comments with much pleasure sincer I'm a noob in this technology (and that's why I'm implementing this caster 🤓)
Tests need to be added once the implementation will be a bit more complete.

Commits
-------

6cd1235539 Add a RdKafka caster to Var-Dumper
2020-02-04 09:00:51 +01:00
Romain Neutron
6cd1235539
Add a RdKafka caster to Var-Dumper 2020-02-04 08:53:38 +01:00
Fabien Potencier
c6d0a2a10e Merge branch '5.0'
* 5.0:
  Add missing use statements
  [Translation] Add missing use statement
  [Translation] Add missing use statement
  [Config][XmlReferenceDumper] Prevent potential \TypeError
  [Mailer] Fix broken mandrill http send for recipients with names
  [Translation] prefer intl domain when adding messages to catalogue
  Fix CS
  Fix CS
  Fail on empty password verification (without warning on any implementation)
  [Translation][Debug] Add installation and minimal example to README
  [Validator] try to call __get method if property is uninitialized
  Show both missing packages in the same error message
  Fix handling of empty_data's \Closure value in Date/Time form types
2020-02-04 08:41:44 +01:00
Fabien Potencier
85f793bec6 Merge branch '4.4' into 5.0
* 4.4:
  Add missing use statements
  [Translation] Add missing use statement
  [Translation] Add missing use statement
  [Config][XmlReferenceDumper] Prevent potential \TypeError
  [Mailer] Fix broken mandrill http send for recipients with names
  [Translation] prefer intl domain when adding messages to catalogue
  Fix CS
  Fix CS
  Fail on empty password verification (without warning on any implementation)
  [Translation][Debug] Add installation and minimal example to README
  [Validator] try to call __get method if property is uninitialized
  Show both missing packages in the same error message
  Fix handling of empty_data's \Closure value in Date/Time form types
2020-02-04 08:41:34 +01:00
Fabien Potencier
cb16fe7432 Merge branch '3.4' into 4.4
* 3.4:
  [Translation] Add missing use statement
  [Translation][Debug] Add installation and minimal example to README
  [Validator] try to call __get method if property is uninitialized
  Fix handling of empty_data's \Closure value in Date/Time form types
2020-02-04 08:40:16 +01:00
Fabien Potencier
647a6fe9c6 bug #35583 Add missing use statements (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

Add missing use statements

| Q             | A
| ------------- | ---
| Branch?       | 4.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       | <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | n/a

Commits
-------

cd27b9d06f Add missing use statements
2020-02-04 08:38:29 +01:00
Fabien Potencier
cd27b9d06f Add missing use statements 2020-02-04 08:35:15 +01:00
Fabien Potencier
ce29631cd8 [Translation] Add missing use statement 2020-02-04 08:22:30 +01:00
Fabien Potencier
45f5564906 bug #35582 Missing use statement 4.4 (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

Missing use statement 4.4

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | n/a

Commits
-------

00baa290e8 [Translation] Add missing use statement
2020-02-04 08:19:53 +01:00
Fabien Potencier
00baa290e8 [Translation] Add missing use statement 2020-02-04 08:15:38 +01:00
Fabien Potencier
981a771481 feature #34925 Messenger: validate options for AMQP and Redis Connections (nikophil)
This PR was squashed before being merged into the 5.1-dev branch (closes #34925).

Discussion
----------

Messenger: validate options for AMQP and Redis Connections

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| Ticket | https://github.com/symfony/symfony/issues/32575
| New feature?  | yes
| Deprecations? | yes
| License       | MIT

This PR validates options for AMQP and Redis connections.

Regarding AMQP, I've merged symfony's specific options (`exchange`, `delay`...) with the ones available in the [AMQP Extension](https://github.com/pdezwart/php-amqp/blob/master/amqp_connection.c#L177-L192) and i've enhanced the phpdoc with the one found [here](https://github.com/pdezwart/php-amqp/blob/master/stubs/AMQPConnection.php#L27-L54)

Commits
-------

bc4f7d701f Messenger: validate options for AMQP and Redis Connections
2020-02-04 06:52:56 +01:00
Nicolas PHILIPPE
bc4f7d701f Messenger: validate options for AMQP and Redis Connections 2020-02-04 06:52:48 +01:00
Nicolas Grekas
fc30e610d5 feature #33315 [WebProfiler] Improve HttpClient Panel (ismail1432)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[WebProfiler] Improve HttpClient Panel

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | np    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #33311  <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | ?

Wishlist from issue :

- [x] the panel UI could be improved I suppose, e.g. a tooltip on hover in the toolbar
- [ ] putting requests in the "Performance" tab would be great (all timings are already in the collected "info")
- [ ] ~response bodies are not collected yet~ https://github.com/symfony/symfony/pull/33315#discussion_r317353605
- [ ] when a transport error occurs, (ie the "error" info is populated) we should maybe have a better display too?
- [x] add a copy-as-curl button next to each request

**[EDIT 07 oct 19]**
This PR contains :
- Display a tooltip in Toolbar
- Add a link only for GET Request in profiler panel
![image](https://user-images.githubusercontent.com/13260307/66316799-389be480-e910-11e9-888e-7703c87c7b10.png)

Commits
-------

e2e6bd0f3a [WebProfiler] Improve HttpClient Panel
2020-02-03 18:49:40 +01:00
Smaine Milianni
e2e6bd0f3a [WebProfiler] Improve HttpClient Panel 2020-02-03 18:49:13 +01:00
Fabien Potencier
28eedb8cef bug #34123 [Form] Fix handling of empty_data's \Closure value in Date/Time form types (yceruto)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Fix handling of empty_data's \Closure value in Date/Time form types

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

Basically this would solve the posibility to pass a `\Closure` to the `empty_data` option for Date/Time form types.

> https://symfony.com/doc/current/reference/forms/types/form.html#empty-data
> If a form is compound, you can set empty_data as an array, object or **closure**. See the [How to Configure empty Data](https://symfony.com/doc/current/form/use_empty_data.html) for a Form Class article for more details about these options.

Also related to https://github.com/symfony/symfony/pull/29182

Commits
-------

4939f0e323 Fix handling of empty_data's \Closure value in Date/Time form types
2020-02-03 18:31:42 +01:00