Commit Graph

45091 Commits

Author SHA1 Message Date
dFayet
c4a2f026e0 Add new Form WeekType 2019-11-01 15:48:13 +01:00
Tobias Schultze
3936b78830 feature #34185 [Messenger] extract worker logic to listener and get rid of SendersLocatorInterface::getSenderByAlias (Tobion)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger]  extract worker logic to listener and get rid of SendersLocatorInterface::getSenderByAlias

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #32077 and #31848
| License       | MIT
| Doc PR        |

as discussed with @weaverryan sending messages for retry and failure directly to transport instead of redispatching on the bus makes things much cleaner

Commits
-------

d7e0f98cd0 [Messenger] extract worker logic to listener and sent messages for retry and failure directly to transport instead of redispatching on the bus
2019-11-01 13:36:19 +01:00
Fabien Potencier
ce6332ce71 bumped Symfony version to 4.3.7 2019-11-01 11:04:19 +01:00
Fabien Potencier
7e98605f0e
Merge pull request #34209 from fabpot/release-4.3.6
released v4.3.6
2019-11-01 10:00:21 +00:00
Fabien Potencier
b959f05d98 updated VERSION for 4.3.6 2019-11-01 11:00:03 +01:00
Fabien Potencier
48373ab261 updated CHANGELOG for 4.3.6 2019-11-01 10:59:55 +01:00
Fabien Potencier
36c4c66a60 bumped Symfony version to 3.4.34 2019-11-01 10:59:17 +01:00
Fabien Potencier
4781365269
Merge pull request #34208 from fabpot/release-3.4.33
released v3.4.33
2019-11-01 09:46:51 +00:00
Fabien Potencier
a3ae48695d updated VERSION for 3.4.33 2019-11-01 10:46:31 +01:00
Fabien Potencier
202e420505 update CONTRIBUTORS for 3.4.33 2019-11-01 10:46:18 +01:00
Fabien Potencier
9d81271d9b updated CHANGELOG for 3.4.33 2019-11-01 10:45:21 +01:00
Fabien Potencier
9eedb45b1a feature #34156 Adding DoctrineClearEntityManagerWorkerSubscriber to reset EM in worker (weaverryan)
This PR was merged into the 4.4 branch.

Discussion
----------

Adding DoctrineClearEntityManagerWorkerSubscriber to reset EM in worker

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes & no :)
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #34073
| License       | MIT
| Doc PR        | symfony/symfony-docs#12575
| DoctrineBundle PR | doctrine/DoctrineBundle#1043

Hi!

I've seen a few developers get "bit" by an issue recently: after running `messenger:consume`, the 2nd, 3rd, 4th, etc message that are handled are getting out-of-date data from Doctrine. The reason is simple:

A) Consume the 1st message, it queries for `Foo id=1` to do something
B) 10 minutes go by
C) Consume the 2nd message. It also queries for `Foo id=1`, but because this is already in the identity map, Doctrine re-uses the data that is now *10* minutes old.

Even though one worker process handles many messages, the system should (as much as possible) isolate each handler from each other. This is one very practical place we can help people. Also, checking the code, I don't think clearing the entity manager will cause any issues for an EM whose Connection has not been "connected" yet (i.e. it will not cause a connection to be established).

We would wire this in DoctrineBundle, and could make it disable-able... in case that's something that's needed.

Commits
-------

e7b98880aa Adding DoctrineClearEntityManagerWorkerSubscriber to reset entity manager in worker
2019-10-31 22:43:51 +01:00
Ryan Weaver
e7b98880aa Adding DoctrineClearEntityManagerWorkerSubscriber to reset entity manager in worker 2019-10-31 13:26:56 -04:00
Tobias Schultze
d7e0f98cd0 [Messenger] extract worker logic to listener and sent messages for retry
and failure directly to transport instead of redispatching on the bus
2019-10-31 15:47:36 +01:00
Tobias Schultze
cf10c02765 minor #34155 Revert SyncTransport simplification and fix properly (weaverryan)
This PR was squashed before being merged into the 4.4 branch (closes #34155).

Discussion
----------

Revert SyncTransport simplification and fix properly

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34115 (and also related to #34066)
| License       | MIT
| Doc PR        | Not needed

In #34069, I made `SyncTransport` simpler by removing that transport class and making the whole things a config trick. I felt GREAT about that solution... until i realized two big problems:

1) It kills using env vars for `sync://` because we read the config values at build time - #34115 - that could probably be fixed by adding a factory, but then there is also the next problem

2) If someone routed a message to `[async, sync]` (weird, but allowed), my #34069 config solution basically maps this internally to `[async]`, which actually causes the message to *not* be handled immediately. Basically, my solution only worked if you route a message ONLY to one sync transport, but fails if you route to multiple transports.

So... this fixes things in a less-cool, but sensible way:

A) The first commit reverts #34069 exactly
B) The second commit solves the issue that we need to know if a message is being handled in a "worker" context or not, so middleware can decide if they should reset things before/after handling things. Previously we were using `ReceivedStamp` to know this. But because `SyncTransport` also "receives" the message and adds this stamp, it's not enough. To fix this, I added a new `ConsumedByWorkerStamp` that clearly means: "This message is being handled by a worker" (and so, you might want to "reset" some things before/after handling).

Thanks!

Commits
-------

01a9fefe77 Adding ConsumedByWorkerStamp as way to mark a message in a "worker context"
38f19a960c Revert "[Messenger] Removing "sync" transport and replacing it with much nicer config trick"
2019-10-31 15:10:54 +01:00
Yonel Ceruto
45f1a5ee06 Show generic message in non-debug mode 2019-10-31 09:58:15 -04:00
Nicolas Grekas
06e745847d bug #34198 [HttpClient] Fix perf issue when doing thousands of requests with curl (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] Fix perf issue when doing thousands of requests with curl

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

Performing while scheduling requests was a terrible idea: it makes buffers fill in memory and requires CPU do deal with the pending list, while all this in dealt with much more efficiently by any response-reading code that comes after.

Commits
-------

e388b739ed [HttpClient] Fix perf issue when doing thousands of requests with curl
2019-10-31 14:38:12 +01:00
Nicolas Grekas
e388b739ed [HttpClient] Fix perf issue when doing thousands of requests with curl 2019-10-31 08:19:20 +01:00
Nicolas Grekas
aea43b27b0 minor #34166 [VarDumper] Do not dump the EventDispatcher (lyrixx)
This PR was merged into the 4.4 branch.

Discussion
----------

[VarDumper] Do not dump the EventDispatcher

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

Commits
-------

31c402a003 [VarDumper] Do not dump the EventDispatcher
2019-10-30 22:27:22 +01:00
Antonio Pauletich
16c9bafee4
Fix URL generator instantiation 2019-10-30 20:24:37 +01:00
Nicolas Grekas
38bd52e9be feature #34133 [Cache] add DeflateMarshaller - remove phpredis compression (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] add DeflateMarshaller - remove phpredis compression

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

phpredis compression doesn't play well with lua scripting as used in #33939
Let's remove it and provide a `DeflateMarshaller` instead.

Ppl can use it via decoration:
```yaml
services:
    Symfony\Component\Cache\Marshaller\DeflateMarshaller:
        decorates: cache.default_marshaller
        arguments: ['@Symfony\Component\Cache\Marshaller\DeflateMarshaller.inner']
```

It's not enabled by default because that might break pools that are shared between different apps.

/cc @andrerom FYI

Commits
-------

452c863639 [Cache] add DeflateMarshaller - remove phpredis compression
2019-10-30 17:54:40 +01:00
Nicolas Grekas
8cf0698e85 bug #34163 [DI] fix regexp for anonymous services with no class set (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] fix regexp for anonymous services with no class set

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

Follows #33782

Commits
-------

a302d2050e [DI] fix regexp for anonymous services with no class set
2019-10-30 17:53:52 +01:00
Nicolas Grekas
cc357ad70c [Validator] fix merge 2019-10-30 14:47:18 +01:00
Nicolas Grekas
94beae00b1 Merge branch '4.3' into 4.4
* 4.3:
  [4.3] Remove unused local variables
2019-10-30 14:23:44 +01:00
Nicolas Grekas
e8b31ff608 minor #34176 [4.3] Remove unused local variables (fancyweb)
This PR was merged into the 4.3 branch.

Discussion
----------

[4.3] Remove unused local variables

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

Follow up of https://github.com/symfony/symfony/pull/34105 on 4.3.

Commits
-------

58161b8eec [4.3] Remove unused local variables
2019-10-30 14:18:51 +01:00
Nicolas Grekas
301ec496ea [Lock][HttpFoundation] Hot fix 2019-10-30 14:15:17 +01:00
Timo Bakx
b2b7eab949 [Stopwatch] Fixed a bug in stopwatch event getStartTime 2019-10-30 14:03:57 +01:00
Thomas Calvet
58161b8eec [4.3] Remove unused local variables 2019-10-30 13:58:49 +01:00
Nicolas Grekas
0b5b6fa79f Merge branch '4.3' into 4.4
* 4.3:
  [Config] Disable default alphabet sorting in glob function due of unstable sort
  [HttpClient] always return the empty string when the response cannot have a body
  [TwigBundle][exception] Added missing css variable to highlight line in trace
  [Serializer] Improve messages for unexpected resources values
  [SecurityBundle] correct types for default arguments for firewall configs
2019-10-30 13:55:29 +01:00
Nicolas Grekas
1aaf58b55a Merge branch '3.4' into 4.3
* 3.4:
  [Config] Disable default alphabet sorting in glob function due of unstable sort
  [Serializer] Improve messages for unexpected resources values
  [SecurityBundle] correct types for default arguments for firewall configs
2019-10-30 13:53:54 +01:00
Nicolas Grekas
27b0baa270 bug #33998 [Config] Disable default alphabet sorting in glob function due of unstable sort (hurricane-voronin)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Config] Disable default alphabet sorting in glob function due of unstable sort

…table sort

| 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 #33990  <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | no <!-- required for new features -->

`\Symfony\Component\Config\Resource\GlobResource::getIterator` loads files using `glob` not it the stable sorting, e.g several files: `doctrine.yml` and `doctrine_mongodb.yaml` in `config/packages` folder.
On requests these files come(randomly) in a different order, which leads to reinitialization of symfony kernel in `dev` environment. It's a little bit annoying and takes a lot of time in a common :(

<!--
Additionally (see https://symfony.com/roadmap):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained 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 branch 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

3bed0247c0 [Config] Disable default alphabet sorting in glob function due of unstable sort
2019-10-30 13:46:47 +01:00
Denys Voronin
3bed0247c0 [Config] Disable default alphabet sorting in glob function due of unstable sort 2019-10-30 13:43:22 +01:00
Nicolas Grekas
1a92f44a33 bug #34144 [Serializer] Improve messages for unexpected resources values (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Serializer] Improve messages for unexpected resources values

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

Before: `An unexpected value could not be serialized: NULL` - very misleading

After: `An unexpected value could not be serialized: a "stream" resource`

Commits
-------

ad2ce276c7 [Serializer] Improve messages for unexpected resources values
2019-10-30 13:39:30 +01:00
Nicolas Grekas
c424c5adb7 bug #34186 [HttpClient] always return the empty string when the response cannot have a body (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] always return the empty string when the response cannot have a body

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

This will fix tests on 4.4 also.

Commits
-------

f78e14332e [HttpClient] always return the empty string when the response cannot have a body
2019-10-30 13:01:49 +01:00
Nicolas Grekas
f78e14332e [HttpClient] always return the empty string when the response cannot have a body 2019-10-30 12:53:18 +01:00
Fabien Potencier
6bb7751fc1 feature #34177 [HttpFoundation][FrameworkBundle] allow configuring the session handler with a DSN (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation][FrameworkBundle] allow configuring the session handler with a DSN

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

```yaml
framework:
    session:
        handler_id: 'redis://localhost'
        handler_id: '%env(REDIS_URL)%'
        handler_id: '%env(DATABASE_URL)%'
        handler_id: 'file://%kernel.project_dir%/var/sessions'
```

etc.

the database connection is not shared with the ORM (don't mess with transactions.)
redis/memcached connections are shared between cache and session.
(as a reminder, cache and ORM share the db connection: we're ok with trashing the cache on a rollback)

Lock-related changes are a follow up of #34043.
(fabbot failure is false positive)

Commits
-------

de9c61f423 [HttpFoundation][FrameworkBundle] allow configuring the session handler with a DSN
2019-10-30 11:42:43 +01:00
Nicolas Grekas
de9c61f423 [HttpFoundation][FrameworkBundle] allow configuring the session handler with a DSN 2019-10-30 10:56:04 +01:00
Christian Flothmann
9e7ab8c003 feature #32107 [Validator] Add AutoMapping constraint to enable or disable auto-validation (dunglas)
This PR was squashed before being merged into the 4.4 branch (closes #32107).

Discussion
----------

[Validator] Add AutoMapping constraint to enable or disable auto-validation

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

As discussed in #32070 and #32015, it's sometimes mandatory to prevent some classes or properties to be auto mapped (auto-validated). This PR introduces a new constraint, `@AutoMapping` allowing to do exactly that. Examples:

Class:

```php
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @ORM\Entity
 * @Assert\AutoMapping(false)
 */
class DoctrineLoaderNoAutoMappingEntity
{
    /**
     * @ORM\Id
     * @ORM\Column
     */
    public $id;

    /**
     * @ORM\Column(length=20, unique=true)
     */
    public $maxLength;
}
```

Property:

```php
namespace Symfony\Bridge\Doctrine\Tests\Fixtures;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @ORM\Entity
 */
class DoctrineLoaderEntity extends DoctrineLoaderParentEntity
{
    /**
     * @ORM\Id
     * @ORM\Column
     */
    public $id;

    /**
     * @ORM\Column(length=10)
     * @Assert\AutoMapping(false)
     */
    public $noAutoMapping;
}
```

The rules are the following:

* If the constraint is present on a property, and set to true, auto-mapping is always on, regardless of the config, and of any class level annotation
* If the constraint is present on a property, and set to false, auto-mapping is always off, regardless of the config, and of any class level annotation
* If the constraint is present on a class, and set to true, auto-mapping is always on except if a the annotation has been added to a specific property, and regardless of the config
* If the constraint is present on a class, and set to false, auto-mapping is always off except if a the annotation has been added to a specific property, and regardless of the config

Commits
-------

f6519ce88b [Validator] Add AutoMapping constraint to enable or disable auto-validation
2019-10-30 08:50:31 +01:00
Kévin Dunglas
f6519ce88b [Validator] Add AutoMapping constraint to enable or disable auto-validation 2019-10-30 08:50:22 +01:00
Robin Chalas
8e2bc5fe0a minor #34180 [DI] Fix "!tagged" related upgrade/changelog notes (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] Fix "!tagged" related upgrade/changelog notes

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

Commits
-------

81b9c3c682 [DI] Fix "!tagged" related upgrade/changelog notes
2019-10-30 00:18:42 +01:00
Robin Chalas
81b9c3c682 [DI] Fix "!tagged" related upgrade/changelog notes 2019-10-29 21:21:43 +01:00
Timo Bakx
af00d8deab [Stopwatch] Fixed bug in getDuration when counting multiple ongoing periods 2019-10-29 21:16:34 +01:00
Yonel Ceruto
2b0a5793d1 minor #34174 [TwigBundle][exception] Added missing css variable to highlight line in trace (lyrixx)
This PR was merged into the 4.3 branch.

Discussion
----------

[TwigBundle][exception] Added missing css variable to highlight line in trace

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

---

To get the yellow background
![image](https://user-images.githubusercontent.com/408368/67779323-c331b880-fa64-11e9-9a2f-97730a89a6d6.png)

Commits
-------

5f19501 [TwigBundle][exception] Added missing css variable to highlight line in trace
2019-10-29 11:04:07 -04:00
Grégoire Pineau
5f19501fc4 [TwigBundle][exception] Added missing css variable to highlight line in trace 2019-10-29 15:56:06 +01:00
Nicolas Grekas
d08273236c feature #34170 Re-allow to use "tagged" in service definitions (dunglas)
This PR was merged into the 4.4 branch.

Discussion
----------

Re-allow to use "tagged" in service definitions

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| 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        | n/a

Re-allow to use `tagged` in 4.4 and 5.0. It makes it easier for bundles to support both Symfony 4.3- and Symfony 4.4+.

Needed to make API Platform compatible with Symfony 5 (api-platform/core#3009)

Commits
-------

7b7dc0df9a Re-allow to use "tagged" in service definitions
2019-10-29 15:17:53 +01:00
Kévin Dunglas
7b7dc0df9a
Re-allow to use "tagged" in service definitions 2019-10-29 15:11:25 +01:00
Nicolas Grekas
380e0fc984 feature #34043 [Lock] Add missing lock connection string in FrameworkExtension (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

[Lock] Add missing lock connection string in FrameworkExtension

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

This PR adds support to missing DSN in Lock component

```
framework:
  lock: sqlite:/tmp/db
  lock: mysql:host=localhost;dbname=test
  lock: zookeeper://localhost:2181
```

The PR also removes intermediate "internal" services `.lock_connection.*` in favor of factory `StoreFactory::createStore`. Which remove duplicate code.

This PR also deprecate unused services `lock.store.*` and  `lock.store.*.abstract`

Commits
-------

2db24cf582 Add missing lock connection string in FrameworkExtension
2019-10-29 14:57:27 +01:00
Nicolas Grekas
8ec1f14c47 Merge branch '4.3' into 4.4
* 4.3:
  [HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe()
2019-10-29 14:52:16 +01:00
Nicolas Grekas
2326f2882c bug #34167 [HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe() (dunglas)
This PR was squashed before being merged into the 4.3 branch.

Discussion
----------

[HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe()

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

This parameter was already deprecated in Symfony 4. Allowing to not pass it in Symfony 4.3 without triggering a deprecation allows to support both HttpFoundation 4.3 and 4.4, otherwise it's not possible.

Needed to make API Platform compatible with Symfony 5 (https://github.com/api-platform/core/pull/3009)

Commits
-------

e819256ea0 [HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe()
2019-10-29 14:51:20 +01:00
Kévin Dunglas
e819256ea0 [HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe() 2019-10-29 14:51:13 +01:00