Commit Graph

45586 Commits

Author SHA1 Message Date
Pierre du Plessis
b4de582c18
Add note about deprecating the XmlEncoder::TYPE_CASE_ATTRIBUTES constant in the upgrade guide 2019-10-02 11:08:22 +02:00
Nicolas Grekas
e490db8834 fix merge 2019-10-02 11:05:24 +02:00
Nicolas Grekas
d4f3b685df Merge branch '4.3' into 4.4
* 4.3:
  Sync Twig templateExists behaviors
  Fix the :only-of-type pseudo class selector
  [Serializer] Add CsvEncoder tests for PHP 7.4
  Copy phpunit.xsd to a predictable path
  [Security/Http] fix parsing X509 emailAddress
  [Serializer] fix denormalization of string-arrays with only one element #33731
  [Cache] fix known tag versions ttl check
2019-10-02 10:48:21 +02:00
Nicolas Grekas
b628210df7 Merge branch '3.4' into 4.3
* 3.4:
  Sync Twig templateExists behaviors
  Fix the :only-of-type pseudo class selector
  [Serializer] Add CsvEncoder tests for PHP 7.4
  Copy phpunit.xsd to a predictable path
  [Security/Http] fix parsing X509 emailAddress
  [Serializer] fix denormalization of string-arrays with only one element #33731
  [Cache] fix known tag versions ttl check
2019-10-02 10:36:26 +02:00
Nicolas Grekas
ff194d9844 minor #33792 Sync Twig templateExists behaviors (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

Sync Twig templateExists behaviors

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

There are 5 places in the code that does the same check, but they are not consistent. The difficulty here is to support Twig 1, 2 & 3. I think relying on `Environment::MAJOR_VERSION` is OK. `method_exists` are useless IMO. The proof is that they are currenty missing in some of them.

Basically if Twig >= 2 -> the method `exists` exists on the loader so just call it.

For Twig 1, check `ExistsLoaderInterface`, then check for `SourceContextLoaderInterface`, then call `getSource()`.

Commits
-------

d7682fee6c Sync Twig templateExists behaviors
2019-10-02 10:32:14 +02:00
Fabien Potencier
7020f2602b bug #33797 [Cache] Fixed Redis Sentinel usage when only one Sentinel specified (Rohaq)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] Fixed Redis Sentinel usage when only one Sentinel specified

Added check for $params['redis_sentinel'] to line 274, as by converting the array of hosts to a single host configuration (as you might in a test environment), this causes the class to initialise incorrectly.

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

As from Issue #33796
In a Redis Sentinel setup, if only a single Redis Sentinel, or multiple Sentinels with the same host/port are specified (as we're currently doing in a test environment), then the call to `setSentinelTimeout` in `RedisTrait.php` throws an exception, as the wrong interface appears to be initialised as a result.

Adding a check for the `redis_sentinel` parameter, as was done with a check for the `redis_cluster` parameter, avoids this, and the Redis Client is initialised correctly.

Commits
-------

13233fcd8e Fixed Redis Sentinel usage when only one Sentinel specified
2019-10-02 10:31:34 +02:00
Nicolas Grekas
564a65732a bug #33798 [String] fix beforeLast/afterLast (gharlan)
This PR was merged into the 5.0-dev branch.

Discussion
----------

[String] fix beforeLast/afterLast

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

```php
echo b('hello world')->beforeLast('hello', true);
// current result: ''
// expected result: 'hello'

echo b('hello world')->afterLast('hello');
// current result: ''
// expected result: ' world'
```

Commits
-------

80b4f81ebf [String] fix beforeLast/afterLast
2019-10-02 10:13:56 +02:00
Fabien Potencier
526fd9fc44 feature #33701 [HttpKernel] wrap compilation of the container in an opportunistic lock (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] wrap compilation of the container in an opportunistic lock

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

https://github.com/symfony/symfony/pull/32764#issuecomment-516924305

This PR adds a lock around the compilation of the container. When two or more concurrent requests want to compile the container, the first one runs the computation and the others wait for its completion. If for any reasons the lock doesn't work, compilation happens as usual.

The effect is visible when developing locally:

Here is what all concurrent requests consume now:
![image](https://user-images.githubusercontent.com/243674/65603626-4e231d00-dfa6-11e9-8b6c-62dbd5eb30fe.png)

And here is what they will consume with this PR (they wait but reuse the just compiled container):
![image](https://user-images.githubusercontent.com/243674/65603733-7f9be880-dfa6-11e9-930b-ce793c3e280c.png)

Commits
-------

0b5b3ed7f9 [HttpKernel] wrap compilation of the container in an opportunistic lock
2019-10-02 10:09:14 +02:00
Nicolas Grekas
9a48def0c0 [DI] add tests loading calls with returns-clone 2019-10-02 10:03:02 +02:00
Nicolas Grekas
a2665d17cd [DI] dont mandate a class on inline services with a factory 2019-10-02 09:19:13 +02:00
Gregor Harlan
80b4f81ebf
[String] fix beforeLast/afterLast 2019-10-01 20:07:29 +02:00
Richard Hodgson
13233fcd8e
Fixed Redis Sentinel usage when only one Sentinel specified
Added check for $params['redis_sentinel'] to line 274, as by converting the array of hosts to a single host configuration (as you might in a test environment), this causes the class to initialise incorrectly.
2019-10-01 18:57:36 +01:00
Alexander M. Turek
8e8a6ed99b [EventDispatcher] Added tests for aliased events. 2019-10-01 18:40:32 +02:00
Fabien Potencier
5b7848c8ff feature #33789 [Serializer] Deprecate the XmlEncoder::TYPE_CASE_ATTRIBUTES constant (pierredup)
This PR was merged into the 4.4 branch.

Discussion
----------

[Serializer] Deprecate the XmlEncoder::TYPE_CASE_ATTRIBUTES constant

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

Deprecate the `XmlEncoder::TYPE_CASE_ATTRIBUTES` constant in favour of `XmlEncoder::TYPE_CAST_ATTRIBUTES`

Commits
-------

9f51cf4a77 Deprecate the XmlEncoder::TYPE_CASE_ATTRIBUTES constant
2019-10-01 18:26:56 +02:00
Thomas Calvet
d7682fee6c Sync Twig templateExists behaviors 2019-10-01 17:13:36 +02:00
Robin Chalas
c75098ed37 minor #33790 [Console] remove abbreviation support for hidden commands (xabbuh)
This PR was merged into the 5.0-dev branch.

Discussion
----------

[Console] remove abbreviation support for hidden commands

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

Commits
-------

6623ec2131 remove abbreviation support for hidden commands
2019-10-01 15:09:46 +02:00
Fabien Potencier
d2b66ff592 bug #33777 Fix the :only-of-type pseudo class selector (jakzal)
This PR was squashed before being merged into the 3.4 branch (closes #33777).

Discussion
----------

Fix the :only-of-type pseudo class selector

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

Commits
-------

c2a9bf08f1 Fix the :only-of-type pseudo class selector
2019-10-01 13:57:42 +02:00
Jakub Zalas
c2a9bf08f1 Fix the :only-of-type pseudo class selector 2019-10-01 13:57:37 +02:00
Fabien Potencier
11da6f6eea minor #33787 [Mailer] Tweak some code (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Tweak some code

| 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       | n/a
| License       | MIT
| Doc PR        | n/a

Tweaks from the Notifier PR.

Commits
-------

ab094c02eb [Mailer] Tweak some code
2019-10-01 13:38:59 +02:00
Pierre du Plessis
9f51cf4a77
Deprecate the XmlEncoder::TYPE_CASE_ATTRIBUTES constant 2019-10-01 12:51:09 +02:00
Fabien Potencier
ab094c02eb [Mailer] Tweak some code 2019-10-01 12:10:05 +02:00
Fabien Potencier
3a1d36102f bug #33772 [WebserverBundle] Remove duplicated deprecation message (jschaedl)
This PR was merged into the 4.4 branch.

Discussion
----------

[WebserverBundle] Remove duplicated deprecation message

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

Commits
-------

77534aa45d [WebserverBundle] Remove duplicated deprecation message
2019-10-01 01:14:25 +02:00
Fabien Potencier
871e8e9158 bug #32051 [Serializer] Add CsvEncoder tests for PHP 7.4 (ro0NL)
This PR was squashed before being merged into the 3.4 branch (closes #32051).

Discussion
----------

[Serializer] Add CsvEncoder tests for PHP 7.4

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| 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 -->

Some CSV encoder tests to show the broken behavior of a trailing slash. Spotted in #31867, not sure what to do with it :)

Commits
-------

760354d533 [Serializer] Add CsvEncoder tests for PHP 7.4
2019-10-01 01:11:46 +02:00
Roland Franssen
760354d533 [Serializer] Add CsvEncoder tests for PHP 7.4 2019-10-01 01:11:32 +02:00
Fabien Potencier
befa5c69c2 feature #33776 Copy phpunit.xsd to a predictable path (julienfalque)
This PR was merged into the 3.4 branch.

Discussion
----------

Copy phpunit.xsd to a predictable path

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | yes-ish
| Deprecations? | no
| Tickets       | https://github.com/symfony/recipes/pull/652#discussion_r329446277
| License       | MIT
| Doc PR        | -

In symfony/recipes#652 I would like to make Flex create the `phpunit.xml.dist` file with a local URI for the `phpunit.xsd`. This is doable when using `phpunit/phpunit` standalone because the path to the XSD file is known. This PR aims to allow doing this when using the PHPUnit Bridge, which installs PHPUnit in a path that might change.

Is is simple `@copy()` call ok? Should I add some error handling?

Commits
-------

233dcb4b75 Copy phpunit.xsd to a predictable path
2019-10-01 01:07:55 +02:00
Fabien Potencier
f4af6d2273 minor #33762 [Console] remove duplicated test (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] remove duplicated test

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

Commits
-------

4c1b66c6de remove duplicated test
2019-10-01 01:04:49 +02:00
Fabien Potencier
a824e08314 bug #33759 [Security/Http] fix parsing X509 emailAddress (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security/Http] fix parsing X509 emailAddress

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

Commits
-------

fceb86bde6 [Security/Http] fix parsing X509 emailAddress
2019-10-01 01:01:20 +02:00
Julien Falque
233dcb4b75
Copy phpunit.xsd to a predictable path 2019-09-30 22:33:19 +02:00
Jan Schädlich
77534aa45d [WebserverBundle] Remove duplicated deprecation message 2019-09-30 20:56:12 +02:00
Nicolas Grekas
a2cd56c12f bug #33733 [Serializer] fix denormalization of string-arrays with only one element (mkrauser)
This PR was merged into the 3.4 branch.

Discussion
----------

[Serializer] fix denormalization of string-arrays with only one element

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

This PR does almost the same as ac70edf8cd, just not only for arrays of objects.

Commits
-------

8814751b96 [Serializer] fix denormalization of string-arrays with only one element #33731
2019-09-30 16:55:04 +02:00
Christian Flothmann
5e48c39f79 minor #33760 [HttpKernel] drop support for retrieving container from non-booted kernels (xabbuh)
This PR was merged into the 5.0-dev branch.

Discussion
----------

[HttpKernel] drop support for retrieving container from non-booted kernels

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

Commits
-------

81ae635100 drop support for retrieving container from non-booted kernels
2019-09-30 16:37:48 +02:00
Christian Flothmann
4c1b66c6de remove duplicated test 2019-09-30 16:33:22 +02:00
Christian Flothmann
6623ec2131 remove abbreviation support for hidden commands 2019-09-30 16:19:32 +02:00
Christian Flothmann
81ae635100 drop support for retrieving container from non-booted kernels 2019-09-30 15:58:09 +02:00
Christian Flothmann
001777ac07 minor #33757 [FrameworkBundle] conflict with VarDumper < 4.4 (dmaicher)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] conflict with VarDumper < 4.4

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

While trying FrameworkBundle 4.4.x-dev I noticed that I was still using VarDumper 4.3 which leads to this error:

```
> app/console cache:clear

Fatal error: Uncaught Symfony\Component\ErrorHandler\Exception\ClassNotFoundException: Attempted to load class "ContextualizedDumper" from namespace "Symfony\Component\VarDumper\Dumper".
Did you forget a "use" statement for another namespace? in /var/www/x/symfony/app/cache/dev/ContainerB7mbdCh/getDebug_DumpListenerService.php:13
Stack trace:
#0 /var/www/x/symfony/app/cache/dev/ContainerB7mbdCh/appAppKernelDevDebugContainer.php(1357): require()
#1 /var/www/x/symfony/app/cache/dev/ContainerB7mbdCh/appAppKernelDevDebugContainer.php(2282): ContainerB7mbdCh\appAppKernelDevDebugContainer->load('getDebug_DumpLi...')
#2 /var/www/x/symfony/vendor/symfony/event-dispatcher/EventDispatcher.php(275): ContainerB7mbdCh\appAppKernelDevDebugContainer->ContainerB7mbdCh\{closure}()
#3 /var/www/x/symfony/vendor/symfony/event-dispatcher/EventDispatcher.php(90): Symfony\Component\EventDispatcher\EventDispatcher->sortListeners('console.command')
#4 /var/www/x in /var/www/x/symfony/app/cache/dev/ContainerB7mbdCh/getDebug_DumpListenerService.php on line 13
PHP Fatal error:  Uncaught Symfony\Component\ErrorHandler\Exception\ClassNotFoundException: Attempted to load class "ContextualizedDumper" from namespace "Symfony\Component\VarDumper\Dumper".
Did you forget a "use" statement for another namespace? in /var/www/x/symfony/app/cache/dev/ContainerB7mbdCh/getDebug_DumpListenerService.php:13
Stack trace:
#0 /var/www/x/symfony/app/cache/dev/ContainerB7mbdCh/appAppKernelDevDebugContainer.php(1357): require()
#1 /var/www/x/symfony/app/cache/dev/ContainerB7mbdCh/appAppKernelDevDebugContainer.php(2282): ContainerB7mbdCh\appAppKernelDevDebugContainer->load('getDebug_DumpLi...')
#2 /var/www/x/symfony/vendor/symfony/event-dispatcher/EventDispatcher.php(275): ContainerB7mbdCh\appAppKernelDevDebugContainer->ContainerB7mbdCh\{closure}()
#3 /var/www/x/symfony/vendor/symfony/event-dispatcher/EventDispatcher.php(90): Symfony\Component\EventDispatcher\EventDispatcher->sortListeners('console.command')
#4 /var/www/x in /var/www/x/symfony/app/cache/dev/ContainerB7mbdCh/getDebug_DumpListenerService.php on line 13
Script app/console cache:clear handling the post-update-cmd event returned with error code 255
```
So we need to use `symfony/var-dumper >= 4.4`

Commits
-------

9b512c6d5d [FrameworkBundle] conflict with VarDumper < 4.4
2019-09-30 15:16:52 +02:00
Nicolas Grekas
fceb86bde6 [Security/Http] fix parsing X509 emailAddress 2019-09-30 14:24:32 +02:00
Thomas Calvet
aaa0cdf523 [ErrorHandler] Rework fatal error handlers 2019-09-30 14:01:42 +02:00
David Maicher
9b512c6d5d [FrameworkBundle] conflict with VarDumper < 4.4 2019-09-30 13:00:46 +02:00
Nicolas Grekas
b15ae9c5e0 Merge branch '4.4'
* 4.4:
  [4.4] Fix some leftovers
  [VarDumper] Output the location of calls to dump()
2019-09-30 12:48:47 +02:00
Matthias Krauser
8814751b96 [Serializer] fix denormalization of string-arrays with only one element #33731 2019-09-30 12:45:58 +02:00
Nicolas Grekas
2b71c6f221 bug #33752 [4.4] Fix some leftovers (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[4.4] Fix some leftovers

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

Found while running console commands with the Symfony Demo.

Commits
-------

b416c12d29 [4.4] Fix some leftovers
2019-09-30 12:04:15 +02:00
Nicolas Grekas
03f2adcb4e bug #33754 [Cache] fix known tag versions ttl check (SwenVanZanten)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] fix known tag versions ttl check

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

The introduced changes from PR #27007 came with a knownTagVersionTtl property defaulted to 0.15 microseconds. The if statement defined on line 353 checks if the ttl is higher then the already known tag versions. This results in the opposite of the wanted behavior. Instead of waiting for the ttl to expire the if statement is only true if the known versions are lower than the version ttl.

So if this Adapter stays in memory the tag versions are never checked again if the ttl is already lower then the passed time.

The unit test I've added tests once if the version is changed and another time it doesn't get checked cause the ttl hasn't been expired yet.

Commits
-------

205abf3435 [Cache] fix known tag versions ttl check
2019-09-30 12:02:01 +02:00
Nicolas Grekas
b416c12d29 [4.4] Fix some leftovers 2019-09-30 11:07:05 +02:00
Swen van Zanten
205abf3435
[Cache] fix known tag versions ttl check 2019-09-29 23:19:44 +02:00
Nicolas Grekas
8649f43009 minor #33746 [String] improve AbstractUnicodeString::ascii() fallback logic (nicolas-grekas)
This PR was merged into the 5.0-dev branch.

Discussion
----------

[String] improve AbstractUnicodeString::ascii() fallback logic

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

`any-latin/bgn` is a better default when available, and accepting `\Transliterator` instances allows the consumer code to decide how they are instantiated.

Commits
-------

59069626fd [String] improve AbstractUnicodeString::ascii() fallback logic
2019-09-29 21:33:53 +02:00
Nicolas Grekas
e96add4787 [Crawler] document $default as string|null 2019-09-28 23:25:05 +02:00
Nicolas Grekas
5440d671ca feature #31446 [VarDumper] Output the location of calls to dump() (ktherage)
This PR was merged into the 4.4 branch.

Discussion
----------

[VarDumper] Output the location of calls to dump()

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

see #30830

Commits
-------

f0a59d3eab [VarDumper] Output the location of calls to dump()
2019-09-28 18:21:11 +02:00
THERAGE Kévin
f0a59d3eab [VarDumper] Output the location of calls to dump() 2019-09-28 18:20:13 +02:00
Nicolas Grekas
10be999069 Merge branch '4.4'
* 4.4:
  sync phpunit script with master
  [HttpFoundation] allow additinal characters in not raw cookies
  [Console] Deprecate abbreviating hidden command names using  Application->find()
  Do not include hidden commands in suggested alternatives
  [Messenger] Improve error message when routing to an invalid transport (closes #31613)
  [DependencyInjection] Fix wrong exception when service is synthetic
  [Security] add "anonymous: lazy" mode to firewalls
2019-09-28 18:14:00 +02:00
Nicolas Grekas
55843f2de6 Merge branch '4.3' into 4.4
* 4.3:
  sync phpunit script with master
  [HttpFoundation] allow additinal characters in not raw cookies
2019-09-28 18:13:05 +02:00