Commit Graph

43030 Commits

Author SHA1 Message Date
Fabien Potencier
bb9251a42a bug #32413 [Messenger] fix publishing headers set on AmqpStamp (Tobion)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] fix publishing headers set on AmqpStamp

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets |
| License       | MIT
| Doc PR        |

Dispatching a message using an AmqpStamp and setting extra headers with it didn't work. We need to merge the `$attribute['headers']`, not the attributes itself as that will ignore the stamp headers because it's not recursive.
I also made the AmqpStamp a NonSendableStampInterface because it's pointless to serialize the stamp because the stamp already set's the attributes for publishing.

Commits
-------

50b3ec4dc5 [Messenger] fix publishing headers set on AmqpStamp
2019-07-08 08:20:10 +02:00
Fabien Potencier
6a1be4c3c7 minor #32401 [Intl] Init compile tmp volume (ro0NL)
This PR was merged into the 3.4 branch.

Discussion
----------

[Intl] Init compile tmp volume

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

Fixes

```
Symfony\Component\Filesystem\Exception\IOException: Failed to create "/tmp/icu-data": mkdir(): Permission denied.
```

if the initial volume does not exists docker creates it as root, but the container runs for the current user.

Commits
-------

5e26d96a6b [Intl] Init compile tmp volume
2019-07-08 08:16:38 +02:00
Fabien Potencier
a731c3b410 bug #32384 [Mime] add check for openssl when using SMime (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mime] add check for openssl when using SMime

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

Should also make tests green for the component on Windows.

Commits
-------

f33c67bfc1 [Mime] add check for openssl when using SMime
2019-07-08 08:15:12 +02:00
Fabien Potencier
d92c9b8568 bug #32421 [EventDispatcher] Add tag kernel.rest on 'debug.event_dispatcher' service (lyrixx)
This PR was submitted for the 4.4 branch but it was merged into the 3.4 branch instead (closes #32421).

Discussion
----------

[EventDispatcher] Add tag kernel.rest on 'debug.event_dispatcher' service

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

In CLI, Symfony leaks because it uses the TraceableEventDispatcher.
Let's make this service resetable.

This PR is related to #32418

---

Side note: Forcing user to use the `ServicesResetter` is IMHO bad for
the DX. I prefer to have something that does not leak by default.
More over, the TraceableEventDispatcher stores some informations for the
profiler. But in CLI it does not make sens, since the tooling does not
exist. I have already fixed such issue for monolog in #30339. I think we
should do the same for the TraceableEventDispatcher.

---

Note: When using #32418 + this PR and with the following code, it does not leak **at all**

<details>
<summary>code</summary>

```php
<?php

namespace App\Command;

use Psr\Log\LoggerInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\HttpKernel\DependencyInjection\ServicesResetter;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;

class LeakCommand extends Command
{
    protected static $defaultName = 'leak';

    private $dispatcher;
    private $resetter;
    private $logger;

    public function __construct(EventDispatcherInterface $dispatcher, ServicesResetter $resetter, LoggerInterface $logger)
    {
        $this->dispatcher = $dispatcher;
        $this->resetter = $resetter;
        $this->logger = $logger;

        parent::__construct();
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->dispatcher->addListener(MyEvent::class, function ($e) {

        });
        for ($i=0; $i < INF; $i++) {
            $output->writeln(memory_get_usage());

            $this->dispatcher->dispatch(new MyEvent());
            $this->logger->debug('some log');

            // if ($i > 2000) {
            //     meminfo_dump(fopen('/tmp/my_dump_file.json', 'w'));
            //     die;
            // }

            usleep(100);
            $this->resetter->reset();
        }
    }
}

class MyEvent {}

```
</detail>

Commits
-------

5249eaf9d5 [EventDispatcher] Add tag kernel.rest on 'debug.event_dispatcher' service
2019-07-08 08:06:18 +02:00
Grégoire Pineau
5249eaf9d5 [EventDispatcher] Add tag kernel.rest on 'debug.event_dispatcher' service 2019-07-08 08:06:11 +02:00
Fabien Potencier
c03415d4e5 feature #32402 [Intl] Exclude root language (ro0NL)
This PR was squashed before being merged into the 4.4 branch (closes #32402).

Discussion
----------

 [Intl] Exclude root language

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

Spotted in #32388

Commits
-------

089cc06c3a  [Intl] Exclude root language
2019-07-08 07:53:32 +02:00
Roland Franssen
089cc06c3a [Intl] Exclude root language 2019-07-08 07:53:15 +02:00
Fabien Potencier
f2d7170d1a minor #32416 [Console] Update inherit and add licence (Simperfit)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console] Update inherit and add licence

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

<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - 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.
-->

see https://github.com/symfony/symfony/pull/32318/files#r299561556 it needs to be updated in the lowest branch.

Commits
-------

ff0c14171b [Console] Update to inherit and add licence
2019-07-08 07:42:45 +02:00
Amrouche Hamza
ff0c14171b
[Console] Update to inherit and add licence 2019-07-08 07:40:49 +02:00
Fabien Potencier
330b77c2ea minor #32419 [Workflow] Add missing test for workflow dump description (alexislefebvre)
This PR was submitted for the 4.4 branch but it was merged into the 4.3 branch instead (closes #32419).

Discussion
----------

[Workflow] Add missing test for workflow dump description

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

This PR add a test for a feature added in #29538 but missed a test.

Commits
-------

0c326d0b55 Add missing test for workflow dump description
2019-07-08 07:36:30 +02:00
Alexis Lefebvre
0c326d0b55 Add missing test for workflow dump description 2019-07-08 07:36:18 +02:00
Roland Franssen
8ffc61692d
[Intl] Remove --dev from intl compile autoloader 2019-07-07 09:15:14 +02:00
Tobias Schultze
50b3ec4dc5 [Messenger] fix publishing headers set on AmqpStamp 2019-07-07 01:21:29 +02:00
Tobias Schultze
52e8523f4a bug #32398 [Messenger] Removes deprecated call to ReflectionType::__toString() on MessengerPass (brunowowk)
This PR was merged into the 4.2 branch.

Discussion
----------

[Messenger] Removes deprecated call to ReflectionType::__toString() on MessengerPass

Closes #32397

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

Removes deprecated call to ReflectionType::__toString() for 7.4 support

Commits
-------

0c52a531e2 Remove call to deprecated method
2019-07-06 21:00:30 +02:00
Bruno Nogueira Nascimento Wowk
0c52a531e2 Remove call to deprecated method 2019-07-06 14:57:33 -03:00
Jan Schädlich
ea4817677b [Stopwatch] Deprecate passing null in Section::get() method. 2019-07-06 16:19:02 +02:00
Roland Franssen
5e26d96a6b [Intl] Init compile tmp volume 2019-07-06 10:17:29 +02:00
Tobias Schultze
6811aaa8e0 Merge branch '4.3' into 4.4 2019-07-05 23:02:06 +02:00
Tobias Schultze
d27c5307f0 Merge branch '4.2' into 4.3 2019-07-05 23:01:41 +02:00
Tobias Schultze
6a1bae27d1 fix merge 2019-07-05 22:59:32 +02:00
Tobias Schultze
5cf221707f Merge branch '3.4' into 4.2 2019-07-05 22:53:03 +02:00
Tobias Schultze
42899cdd67 feature #32295 [FrameworkBundle] Add autowiring alias for PSR-14 (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Add autowiring alias for PSR-14

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

Commits
-------

2d5bcda9e7 [FrameworkBundle] Add autowiring alias for PSR-14
2019-07-05 21:50:21 +02:00
Tobias Schultze
8e07e7773f minor #32399 [Messenger] Don't pass objects as class name to ContainerBuilder::register (derrabus)
This PR was merged into the 4.2 branch.

Discussion
----------

[Messenger] Don't pass objects as class name to ContainerBuilder::register

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

Fixed a broken test that was discovered while working on #32390.

Commits
-------

e110603e5e Don't pass objects as class name to ContainerBuilder::register.
2019-07-05 21:49:02 +02:00
Tobias Schultze
ddaf1becf3 minor #32391 [FrameworkBundle] pass default cache lifetime as an integer (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] pass default cache lifetime as an integer

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

Commits
-------

416502df4e pass default cache lifetime as an integer
2019-07-05 21:27:06 +02:00
Tobias Schultze
43c14ddad5 feature #32390 [DependencyInjection] Deprecated passing Parameter instances as class name to Definition (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Deprecated passing Parameter instances as class name to Definition

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

This PR deprecates the undocumented possibility to use a `Parameter` instance instead of a string as class name for a `Definition`. This was discovered while working on #32266.

Commits
-------

edfc9d6f34 Deprecated passing Parameter instances as class name to Definition.
2019-07-05 21:21:12 +02:00
Alexander M. Turek
e110603e5e Don't pass objects as class name to ContainerBuilder::register. 2019-07-05 21:20:21 +02:00
Alexander M. Turek
edfc9d6f34 Deprecated passing Parameter instances as class name to Definition. 2019-07-05 21:06:26 +02:00
Christian Flothmann
416502df4e pass default cache lifetime as an integer 2019-07-05 12:25:01 +02:00
Robin Chalas
7f4368114c bug #32379 [SecurityBundle] conditionally register services (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[SecurityBundle] conditionally register services

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

Commits
-------

8fbcdf250e conditionally register services
2019-07-05 11:26:59 +02:00
Nicolas Grekas
f33c67bfc1 [Mime] add check for openssl when using SMime 2019-07-05 09:42:08 +02:00
Nicolas Grekas
ec5d7346b3 Fix CS regarding nullable arguments 2019-07-05 09:04:50 +02:00
Nicolas Grekas
09e3cef7a0 Merge branch '4.3' into 4.4
* 4.3:
  [PhpUnitBridge] fix running simple-phpunit on Windows
  fixed phpdocs
  [Messenger] fix broken key normalization
2019-07-05 08:35:10 +02:00
Nicolas Grekas
b78816d647 Merge branch '4.2' into 4.3
* 4.2:
  [PhpUnitBridge] fix running simple-phpunit on Windows
  fixed phpdocs
2019-07-05 08:35:01 +02:00
Nicolas Grekas
44e82520ee Merge branch '3.4' into 4.2
* 3.4:
  [PhpUnitBridge] fix running simple-phpunit on Windows
  fixed phpdocs
2019-07-05 08:33:37 +02:00
Nicolas Grekas
d9833ace32 [PhpUnitBridge] fix running simple-phpunit on Windows 2019-07-05 08:33:19 +02:00
Nicolas Grekas
a59e0af24a [HttpClient] Add $response->toStream() to cast responses to regular PHP streams 2019-07-05 07:37:18 +02:00
Fabien Potencier
b515107870 feature #32106 [FrameworkBundle] Use default_locale as default value for translator.fallbacks (dunglas)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Use default_locale as default value for translator.fallbacks

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Simplify translator's config:

Before:

```yaml
    default_locale: fr
    translator:
        default_path: '%kernel.project_dir%/translations'
        fallbacks:
            - fr
```

After:

```yaml
    default_locale: fr
    translator:
        default_path: '%kernel.project_dir%/translations'
```

Commits
-------

e0ef35973d [FrameworkBundle] Use default_locale as default value for translator.fallbacks
2019-07-05 07:36:15 +02:00
Fabien Potencier
a71ee27180 fixed UPGRADE 2019-07-05 07:23:38 +02:00
Fabien Potencier
77747a9472 fixed phpdocs 2019-07-05 06:54:49 +02:00
Fabien Potencier
d292b133a5 minor #32382 Fix phpdocs (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

Fix phpdocs

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Backported from #32286

<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - 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
-------

4acddef91b fixed phpdocs
2019-07-05 06:53:43 +02:00
Fabien Potencier
4acddef91b fixed phpdocs 2019-07-05 06:51:06 +02:00
Fabien Potencier
a672bbc209 feature #32294 [FrameworkBundle] Allow creating chained cache pools by providing several adapters (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Allow creating chained cache pools by providing several adapters

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

Replaces #30984, follows https://github.com/symfony/symfony-docs/pull/11813

This PR allows defining several adapters for one pool. When doing so, this defines a chain pool.
The benefit is that all chained pools get automatic namespace and lifetime, so things are transparent:

```yaml
pools:
    my_chained_pool:
        default_lifetime: 12
        adapters:
          - cache.adapter.array
          - cache.adapter.filesystem
          - {name: cache.adapter.redis, provider: 'redis://foo'}
```

(see fixtures for example of PHP/XML config)

/cc @Nyholm @pborreli FYI

Commits
-------

29ba091898 [FrameworkBundle] Allow creating chained cache pools by providing several adapters
2019-07-05 06:43:41 +02:00
Fabien Potencier
c799fc803d bug #32380 [Messenger] fix broken key normalization (Tobion)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] fix broken key normalization

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets |
| License       | MIT
| Doc PR        |

Disable broken key normalization in messenger config.

If you tried to use `-` in a transport/bus it didn't work and you get a cryptic error (#31613)

```
framework:
    messenger:
        transports:
            my-bus: '...'
        routing:
            Acme\MyMessage: my-bus
```

The default behavior of normalizing keys is really annoying and a waste of time in most cases. I've measured `\Symfony\Component\Config\Definition\ArrayNode::preNormalize` in a project and it takes 4 ms.
As an idea, we could disabling normalizing keys automatically when you call `useAttributeAsKey` because the value is then user-provided and shouldn't be modified (in contrast to children properties of an arrayNode which should get normalized for xml support).

Commits
-------

9931b3e183 [Messenger] fix broken key normalization
2019-07-05 06:27:58 +02:00
Yonel Ceruto
08aa16f729 minor #32369 [ErrorCatcher] Fixed some escaping in error renderers (javiereguiluz)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorCatcher] Fixed some escaping in error renderers

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | -
| License       | MIT
| Doc PR        | not needed

Fixes this: https://github.com/symfony/symfony/pull/32364/files#r300394620

Commits
-------

1413bdc [ErrorCatcher] Fixed some escaping in XML errors
2019-07-04 17:25:02 -04:00
Javier Eguiluz
1413bdcab8 [ErrorCatcher] Fixed some escaping in XML errors 2019-07-04 17:23:09 -04:00
Christian Flothmann
adcdd938a4 PHP 5 compat 2019-07-04 23:04:55 +02:00
Tobias Schultze
9931b3e183 [Messenger] fix broken key normalization 2019-07-04 22:25:02 +02:00
Christian Flothmann
8fbcdf250e conditionally register services 2019-07-04 21:53:41 +02:00
Nicolas Grekas
29ba091898 [FrameworkBundle] Allow creating chained cache pools by providing several adapters 2019-07-04 19:09:10 +02:00
Nicolas Grekas
2f6c7c507f Merge branch '4.3' into 4.4
* 4.3:
  bump phpunit-bridge cache ids
2019-07-04 19:07:39 +02:00