Commit Graph

39991 Commits

Author SHA1 Message Date
c.khedhi@prismamedia.com
8a81abeb6f [FrameworkBundle] Move web configuration to PHP 2020-06-11 15:15:23 +02:00
Fabien Potencier
1b086eefb0 minor #37200 [FrameworkBundle] Convert config/mime_type.xml to .php (GromNaN)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[FrameworkBundle] Convert config/mime_type.xml to .php

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Ref #37186
| License       | MIT

Commits
-------

fa92490fcb Convert config/mime_type.xml into mime_type.php
2020-06-11 10:16:01 +02:00
Jérôme TAMARELLE
fa92490fcb Convert config/mime_type.xml into mime_type.php 2020-06-11 09:59:35 +02:00
Fabien Potencier
8df6380fc7 Fix CHANGELOG 2020-06-11 09:26:22 +02:00
Fabien Potencier
6ab2198fb5 minor #37196 [HttpClient] make DNS resolution lazy with NativeHttpClient (nicolas-grekas)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[HttpClient] make DNS resolution lazy with NativeHttpClient

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

Neither a bug nor a feature but still an improvement. This aligns the behavior of NativeHttpClient with the other adapters.

Commits
-------

d3a450353d [HttpClient] make DNS resolution lazy with NativeHttpClient
2020-06-11 08:10:34 +02:00
Nicolas Grekas
d3a450353d [HttpClient] make DNS resolution lazy with NativeHttpClient 2020-06-11 00:12:57 +02:00
Marcin Szepczyński
9891809d47 [Notifier] Move configuration yo PHP 2020-06-10 15:35:51 +02:00
Marcin Szepczyński
e05e811067 add php loader to FrameworkExtension 2020-06-10 13:43:24 +02:00
Fabien Potencier
d1b014a1cb feature #37165 [Mime] Add DKIM support (fabpot)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Mime] Add DKIM support

| 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 #36014 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | not yet

```php
$dkimSigner = new DkimSigner($pk, 'example.com', 'sf');
$signedEmail = $dkimSigner->sign($email);
```
You can also pass options:

```php
$dkimSigner = new DkimSigner($pk, 'example.com', 'sf');
$signedEmail = $dkimSigner->sign($email, (new DkimOptions())
    ->bodyCanon('relaxed')
    ->headerCanon('relaxed')
    ->headersToIgnore(['Message-ID'])
    ->toArray()
);
```

Commits
-------

6dc533821c [Mime] Add DKIM support
2020-06-10 12:50:38 +02:00
Fabien Potencier
753cac7c62 feature #36778 Use PHP instead of XML as the prefered service/route configuration in core (fabpot)
This PR was merged into the 5.2-dev branch.

Discussion
----------

Use PHP instead of XML as the prefered service/route configuration in core

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes-ish <!-- 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

In Symfony 6, I (we?) would want to promote usage of configuration written in PHP instead of YAML. For third-party bundles and core, we should do the same, replacing XML with PHP. Doing so would remove the need for the XML lib for core.

The biggest advantage is auto-completion with any modern IDE without explicit support for Symfony, and probably one less thing to learn (how to configure things in YAML/XML).

Be warned that it does NOT concern semantic configuration which is much harder.

This PR does the work for the Twig bundle as an example. Once we agreed on the CS, the same should then be done for other core bundles both for service configuration and route configuration.

Embeds #36775 until it is merged.

Commits
-------

0aedd54fc1 [Twig] Move configuration to PHP
2020-06-10 12:49:37 +02:00
Fabien Potencier
6dc533821c [Mime] Add DKIM support 2020-06-10 12:27:43 +02:00
Fabien Potencier
0aedd54fc1 [Twig] Move configuration to PHP 2020-06-10 05:31:24 +02:00
Fabien Potencier
ea956b1956 feature #36802 [Console] Add support for true colors (fabpot)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Console] Add support for true colors

| 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       | Fix #26576, Fix #19844 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | -

This PR adds support for true colors in the Console component.

Instead of adding many ways to add more colors than the current "default" ones, I've opted to only add true color support via Hex CSS colors. If you have something else (RGB, HSV, ...), you need to first convert it to a CSS color. I've also decided to not support the ANSI 256 colors as most terminals support true colors nowadays.

If true colors are not supported by the terminal, we fall back to the "nearest" default color.

`<fg=green;bg=blue>` is now equivalent to `<fg=#00ff00;bg=#00f>`.

The `Color` class is usable outside of the Console framework as well:

```php
$color = new Color('black', 'white');
echo $color->apply("foo");
echo "\n";

$color = new Color('red', 'yellow');
echo $color->apply("foo");
echo "\n";

$color = new Color('#000000', '#ffffff');
echo $color->apply("foo");
$color = new Color('#000', '#fff', ['underscore', 'reverse']);
echo $color->apply("bar");
echo "\n";
```

Rainbow time!

```php
function rainbowColor($i) {
    $h = (int) ($i / 43);
    $f = (int) ($i - 43 * $h);
    $t = (int) ($f * 255 / 43);
    $q = 255 - $t;

    if ($h == 0) {
        return new Color('', sprintf('#FF%02x00', $t));
    } elseif ($h == 1) {
        return new Color('', sprintf('#%02xFF00', $q));
    } elseif ($h == 2) {
        return new Color('', sprintf('#00FF%02x', $t));
    } elseif ($h == 3) {
        return new Color('', sprintf('#00%02xFF', $q));
    } elseif ($h == 4) {
        return new Color('', sprintf('#%02x00FF', $t));
    } elseif ($h == 5) {
        return new Color('', sprintf('#FF00%02x', $q));
    }
}

for ($i = 0; $i < 128; $i++) {
    echo rainbowColor($i)->apply(' ');
}
echo "\n";

for ($i = 255; $i >= 128; $i--) {
    echo rainbowColor($i)->apply(' ');
}
echo "\n";
```

![image](https://user-images.githubusercontent.com/47313/81796170-59af5e00-950d-11ea-8203-18c13ae8a07e.png)

Commits
-------

d066514cf1 [Console] Add support for true colors
2020-06-10 05:08:03 +02:00
Fabien Potencier
d066514cf1 [Console] Add support for true colors 2020-06-10 04:55:06 +02:00
Fabien Potencier
1fd4e8bb60 [DependencyInjection] Add abstract_arg() and param() 2020-06-10 04:11:30 +02:00
Fabien Potencier
bb70cc8c47 minor #37039 [ExpressionLanguage] add details for error messages (mamontovdmitriy)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[ExpressionLanguage] add details for error messages

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

Hello!

This PR contains a more detail error messages for [ExpressionLanguage], which include info about affected node and attribute.

My English is poor. Please, spell check in error texts.

Commits
-------

5852a8cedd [ExpressionLanguage] add details for error messages
2020-06-10 03:51:12 +02:00
Fabien Potencier
dee6d437b6 feature #37040 [PropertyInfo] Support using the SerializerExtractor with no group check (GuilhemN)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[PropertyInfo] Support using the SerializerExtractor with no group check

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

It seems there is no way currently to leverage the new `@Ignore` annotation metadata without using serializer groups in third party code.
Indeed the only way to access the serializer's metadata is through the PropertyInfo component since metadata are marked as `@internal` in the Serializer component itself. However, the PropertyInfo component doesn't allow accessing them without using a groups constraint.

This PR proposes a fix by interpreting `serializer_groups = null` as no groups constraint.

This feature would be useful in NelmioApiDocBundle, see https://github.com/nelmio/NelmioApiDocBundle/issues/1595.

Commits
-------

4190bfaf48 [PropertyInfo] Support using the SerializerExtractor with no group check
2020-06-10 03:48:12 +02:00
Guilhem Niot
4190bfaf48 [PropertyInfo] Support using the SerializerExtractor with no group check 2020-06-10 03:48:06 +02:00
Fabien Potencier
4972ee08ef minor #37147 [DependencyInjection] Display alternatives when a service is not found in CheckExceptionOnInvalidReferenceBehaviorPass (fancyweb)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[DependencyInjection] Display alternatives when a service is not found in CheckExceptionOnInvalidReferenceBehaviorPass

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

I often see the mistake of using `@my_service` instead of `my_service` in bundles configurations in YAML (on entries that are then turned into references). Since we don't currently display alternatives, the message content is just that the service don't exist which is hard to understand for new users of the framework.

Commits
-------

6b8f181f1a [DependencyInjection] Display alternatives when a service is not found in CheckExceptionOnInvalidReferenceBehaviorPass
2020-06-10 03:37:54 +02:00
Fabien Potencier
6e28fdaa57 [Mime] Deprecate Address::fromString() 2020-06-09 17:54:11 +02:00
Fabien Potencier
61d79e19a9 Merge branch '5.1'
* 5.1:
  [Mime] use fromString when creating a new Adress
2020-06-09 17:07:48 +02:00
Fabien Potencier
d08db0f3f5 Merge branch '5.0' into 5.1
* 5.0:
  [Mime] use fromString when creating a new Adress
2020-06-09 17:07:35 +02:00
Fabien Potencier
748854bad1 Merge branch '4.4' into 5.0
* 4.4:
  [Mime] use fromString when creating a new Adress
2020-06-09 17:07:20 +02:00
Fabien Potencier
5b719d1ee4 bug #37167 [Mime] use fromString when creating a new Address (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mime] use fromString when creating a new Address

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

When creating an Address, there are two ways right now in 4.4: `Address::create()` which takes an email or an instance of Address and `Address::fromString()` which takes an email or an email+name.

In 4.4, I propose to make `create` supports everything possible. And in 5.2, I will probably propose to deprecate `fromString()`.

Commits
-------

de68787693 [Mime] use fromString when creating a new Adress
2020-06-09 17:06:27 +02:00
Nicolas Grekas
284f6f2b0f Merge branch '5.1'
* 5.1:
  [Messenger] fix typo
2020-06-09 16:24:57 +02:00
Nicolas Grekas
7da0ffd062 Merge branch '5.0' into 5.1
* 5.0:
  [Messenger] fix typo
2020-06-09 16:24:29 +02:00
Nicolas Grekas
bd4a238fb2 Merge branch '4.4' into 5.0
* 4.4:
  [Messenger] fix typo
2020-06-09 16:23:46 +02:00
Nicolas Grekas
749380a399 [Messenger] fix typo 2020-06-09 16:23:13 +02:00
Nicolas Grekas
7e6ff0d47e Merge branch '5.1'
* 5.1:
  Correctly use doctrine/dbal v3+
  Correctly use doctrine/dbal v3+
2020-06-09 16:16:45 +02:00
Nicolas Grekas
374e23b967 Merge branch '5.0' into 5.1
* 5.0:
  Correctly use doctrine/dbal v3+
  Correctly use doctrine/dbal v3+
2020-06-09 16:15:34 +02:00
Nicolas Grekas
9bfe5065b7 Merge branch '4.4' into 5.0
* 4.4:
  Correctly use doctrine/dbal v3+
  Correctly use doctrine/dbal v3+
2020-06-09 16:10:15 +02:00
Nicolas Grekas
2ebb63a883 Merge branch '3.4' into 4.4
* 3.4:
  Correctly use doctrine/dbal v3+
2020-06-09 16:07:49 +02:00
Nicolas Grekas
909931d9a4 Correctly use doctrine/dbal v3+ 2020-06-09 16:07:03 +02:00
Nicolas Grekas
4a51827b6d Correctly use doctrine/dbal v3+ 2020-06-09 16:02:17 +02:00
Nicolas Grekas
880142ac40 Merge branch '5.1'
* 5.1:
  [Cache] fix parse error on PHP 5.5
  [Cache] fix compat with doctrine/dbal v3
  [Lock] fix compat with doctrine/dbal v3
2020-06-09 14:11:52 +02:00
Nicolas Grekas
d5ff9e7d81 Merge branch '5.0' into 5.1
* 5.0:
  [Cache] fix parse error on PHP 5.5
  [Cache] fix compat with doctrine/dbal v3
  [Lock] fix compat with doctrine/dbal v3
2020-06-09 14:11:32 +02:00
Nicolas Grekas
d0a11c7911 Merge branch '4.4' into 5.0
* 4.4:
  [Cache] fix parse error on PHP 5.5
2020-06-09 14:09:45 +02:00
Nicolas Grekas
e1050c9373 Merge branch '3.4' into 4.4
* 3.4:
  [Cache] fix parse error on PHP 5.5
2020-06-09 14:08:55 +02:00
Nicolas Grekas
ef6fc09260 [Cache] fix parse error on PHP 5.5 2020-06-09 14:06:18 +02:00
Nicolas Grekas
e8f4ca1c6d Merge branch '4.4' into 5.0
* 4.4:
  [Cache] fix compat with doctrine/dbal v3
  [Lock] fix compat with doctrine/dbal v3
2020-06-09 13:54:45 +02:00
Nicolas Grekas
1c328c64ad Merge branch '3.4' into 4.4
* 3.4:
  [Cache] fix compat with doctrine/dbal v3
2020-06-09 13:52:05 +02:00
Nicolas Grekas
0f76308929 [Cache] fix compat with doctrine/dbal v3 2020-06-09 13:48:38 +02:00
Nicolas Grekas
7bbbd3dd0d [Lock] fix compat with doctrine/dbal v3 2020-06-09 13:46:03 +02:00
Nicolas Grekas
ddcb795484 Merge branch '5.1'
* 5.1:
  minor #37141 [Messenger] fix forward compatibility with Doctrine DBAL 2.11+ (xabbuh)
  fix forward compatibility with Doctrine DBAL 3
  [WebProfilerBundle] Set NullLogger for functional tests
  [Mailer] Fixed generator bug when creating multiple transports using Transport::fromDsn
  [FrameworkBundle] Fix XSD definition
  Update welcome.html.php
  [FrameworkBundle] Remove reference to APP_SECRET in MicroKernelTrait
  [travis] add nightly to allowed failures
2020-06-09 13:33:42 +02:00
Nicolas Grekas
afefcfd078 Merge branch '5.0' into 5.1
* 5.0:
  minor #37141 [Messenger] fix forward compatibility with Doctrine DBAL 2.11+ (xabbuh)
  fix forward compatibility with Doctrine DBAL 3
  [WebProfilerBundle] Set NullLogger for functional tests
  [Mailer] Fixed generator bug when creating multiple transports using Transport::fromDsn
  [FrameworkBundle] Fix XSD definition
  Update welcome.html.php
  [travis] add nightly to allowed failures
2020-06-09 13:33:28 +02:00
Nicolas Grekas
19228e6740 Merge branch '4.4' into 5.0
* 4.4:
  minor #37141 [Messenger] fix forward compatibility with Doctrine DBAL 2.11+ (xabbuh)
  fix forward compatibility with Doctrine DBAL 3
  [WebProfilerBundle] Set NullLogger for functional tests
  [Mailer] Fixed generator bug when creating multiple transports using Transport::fromDsn
  [FrameworkBundle] Fix XSD definition
  Update welcome.html.php
  [travis] add nightly to allowed failures
2020-06-09 13:33:14 +02:00
Fabien Potencier
5a0645974f minor #37141 [Messenger] fix forward compatibility with Doctrine DBAL 2.11+ (xabbuh)
This PR was merged into the 5.1 branch.

Discussion
----------

[Messenger] fix forward compatibility with Doctrine DBAL 2.11+

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

The methods will be deprecated in 2.11 (see doctrine/dbal#4019), but the forward compatibility layer is only present in 3.0 (see doctrine/dbal#4007).

Commits
-------

bca4f9970b fix forward compatibility with Doctrine DBAL 2.11+
2020-06-09 13:31:06 +02:00
Nicolas Grekas
ae6894c3ed Merge branch '3.4' into 4.4
* 3.4:
  fix forward compatibility with Doctrine DBAL 3
  [WebProfilerBundle] Set NullLogger for functional tests
  [travis] add nightly to allowed failures
2020-06-09 13:29:11 +02:00
Fabien Potencier
691b604972 feature #37114 Provides a way to override cache and log folders from the ENV (Plopix)
This PR was merged into the 5.2-dev branch.

Discussion
----------

Provides a way to override cache and log folders from the ENV

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| License       | MIT

When using Docker and especially on Mac OS X, performances are terrible when using a "mount" on the host inside the container. (which happens by default)

To optimize the performances, one of the tricks is to change where the application is going to write the cache and the logs.

This PR provides a new env variables `APP_CACHE_DIR` and `APP_LOG_DIR` which can be set to change where will be saved the caches and the logs.

I know we can do it per project BUT:
- I think that is a good addition to Symfony
- it would allow project like eZ Platform and eZ Launchpad to automate that optimization
https://github.com/ezsystems/ezplatform/pull/543

Let me know

Commits
-------

5fa5d36153 Provides a way to override cache and log folders form the ENV
2020-06-09 13:19:08 +02:00
Christian Flothmann
316efef8b8 fix forward compatibility with Doctrine DBAL 3 2020-06-09 13:16:53 +02:00