Commit Graph

37336 Commits

Author SHA1 Message Date
Ryan Weaver
2c0ac93e25 Fix bad method call with guard authentication + session migration 2018-06-12 15:17:58 +02:00
Christophe Coevoet
a0f78a5e0b Avoid calling eval when there is no script embedded in the toolbar 2018-06-12 14:15:08 +02:00
Nicolas Grekas
5c338cc7ab Merge branch '4.1'
* 4.1:
  fix typo
2018-06-11 16:42:15 +02:00
Nicolas Grekas
413af69e1d fix typo 2018-06-11 16:41:45 +02:00
Nicolas Grekas
c997026c91 Merge branch '4.1'
* 4.1:
  fix typo
2018-06-11 16:29:18 +02:00
Nicolas Grekas
fc666f0d80 fix typo 2018-06-11 16:29:01 +02:00
Nicolas Grekas
dca80ff177 Merge branch '4.1'
* 4.1:
  [Serializer] fix CS
  [Cache] Fix expiry comparisons in array-based pools
2018-06-11 16:10:14 +02:00
Nicolas Grekas
c1ba38ed47 Merge branch '4.0' into 4.1
* 4.0:
  [Serializer] fix CS
  [Cache] Fix expiry comparisons in array-based pools
2018-06-11 16:09:24 +02:00
Nicolas Grekas
b7d04a8f59 Merge branch '3.4' into 4.0
* 3.4:
  [Cache] Fix expiry comparisons in array-based pools
2018-06-11 16:09:09 +02:00
Nicolas Grekas
e564c70772 bug #27576 [Cache] Fix expiry comparisons in array-based pools (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] Fix expiry comparisons in array-based pools

| 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
-------

68729cc68a [Cache] Fix expiry comparisons in array-based pools
2018-06-11 16:08:45 +02:00
Nicolas Grekas
f470afacd8 Merge branch '3.4' into 4.0
* 3.4:
  [Serializer] fix CS
2018-06-11 15:58:06 +02:00
Nicolas Grekas
24b6848ea7 [Serializer] fix CS 2018-06-11 15:57:31 +02:00
Nicolas Grekas
90afbf73ac Merge branch '4.1'
* 4.1:
  fix deps
  fixed CS
  [FrameworkBundle] fix for allowing single colon controller notation
2018-06-11 15:22:42 +02:00
Nicolas Grekas
66601613b2 Merge branch '4.0' into 4.1
* 4.0:
  fix deps
2018-06-11 15:22:23 +02:00
Nicolas Grekas
9dc1875780 Merge branch '3.4' into 4.0
* 3.4:
  fix deps
2018-06-11 15:21:24 +02:00
Nicolas Grekas
14bbcdb496 fix deps 2018-06-11 15:18:57 +02:00
Fabien Potencier
205d161c00 feature #27031 [Cache] Use sub-second accuracy for internal expiry calculations (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Cache] Use sub-second accuracy for internal expiry calculations

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

Embeds #26929, #27009 and #27028, let's focus on the 4th commit for now.

This is my last significant PR in the Cache series :)

By using integer expiries internally, our current implementations are sensitive to abrupt transitions when time() goes to next second: `$s = time(); sleep(1); echo time() - $s;` *can* display 2 from time to time.
This means that we do expire items earlier than required by the expiration settings on items.
This also means that there is no way to have a sub-second expiry. For remote backends, that's fine, but for ArrayAdapter, that's a limitation we can remove.

This PR replaces calls to `time()` by `microtime(true)`, providing more accurate timing measurements internally.

Commits
-------

08554ea18c [Cache] Use sub-second accuracy for internal expiry calculations
2018-06-11 15:14:37 +02:00
Fabien Potencier
8b72a6cb20 fixed CS 2018-06-11 15:11:40 +02:00
Fabien Potencier
cfb1ffb869 bug #27566 [FrameworkBundle] fix for allowing single colon controller notation (dmaicher)
This PR was merged into the 4.1 branch.

Discussion
----------

[FrameworkBundle] fix for allowing single colon controller notation

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

This fixes a BC break introduced in https://github.com/symfony/symfony/pull/26085#pullrequestreview-126370222.

ping @Tobion

Commits
-------

1680674174 [FrameworkBundle] fix for allowing single colon controller notation
2018-06-11 15:11:00 +02:00
Nicolas Grekas
68729cc68a [Cache] Fix expiry comparisons in array-based pools 2018-06-11 15:10:52 +02:00
Nicolas Grekas
169b13c348 Merge branch '4.1'
* 4.1:
  fixed CS
  Avoiding session migration for stateless firewall UsernamePasswordJsonAuthenticationListener
  fixed CS
  Avoid migration on stateless firewalls
  [Serializer] deserialize from xml: Fix a collection that contains the only one element
  [HttpKernel] Log/Collect exceptions at prio 0
  [PhpUnitBridge] Fix error on some Windows OS
  [DI] Deduplicate generated proxy classes
  [Routing] fix matching host patterns, utf8 prefixes and non-capturing groups
2018-06-11 14:56:48 +02:00
Nicolas Grekas
8bbda2c82b Merge branch '4.0' into 4.1
* 4.0:
  fixed CS
  Avoiding session migration for stateless firewall UsernamePasswordJsonAuthenticationListener
  fixed CS
  Avoid migration on stateless firewalls
  [Serializer] deserialize from xml: Fix a collection that contains the only one element
  [PhpUnitBridge] Fix error on some Windows OS
  [DI] Deduplicate generated proxy classes
2018-06-11 14:56:28 +02:00
Nicolas Grekas
e540a16f24 Merge branch '3.4' into 4.0
* 3.4:
  fixed CS
  Avoiding session migration for stateless firewall UsernamePasswordJsonAuthenticationListener
  fixed CS
  Avoid migration on stateless firewalls
  [Serializer] deserialize from xml: Fix a collection that contains the only one element
  [PhpUnitBridge] Fix error on some Windows OS
  [DI] Deduplicate generated proxy classes
2018-06-11 14:55:40 +02:00
Nicolas Grekas
873abdad12 Merge branch '2.8' into 3.4
* 2.8:
  fixed CS
  Avoid migration on stateless firewalls
2018-06-11 14:53:53 +02:00
Nicolas Grekas
08554ea18c [Cache] Use sub-second accuracy for internal expiry calculations 2018-06-11 14:32:29 +02:00
Fabien Potencier
d4f5d46b13 feature #27549 [Cache] Unconditionally use PhpFilesAdapter for system pools (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Cache] Unconditionally use PhpFilesAdapter for system pools

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

Now that we're about to leverage OPCache shared memory even for objects (see #27543), there's no reason anymore to use APCu for system caches. Let's remove some complexity here.

As a bonus, this makes system caches pruneable using the `cache:pool:prune` command.

Commits
-------

51381e530a [Cache] Unconditionally use PhpFilesAdapter for system pools
2018-06-11 10:37:54 +02:00
Nicolas Grekas
51381e530a [Cache] Unconditionally use PhpFilesAdapter for system pools 2018-06-11 09:57:54 +02:00
Fabien Potencier
7e3b7b0b50 feature #27009 [Cache] Add stampede protection via probabilistic early expiration (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Cache] Add stampede protection via probabilistic early expiration

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

This PR implements [probabilistic early expiration](https://en.wikipedia.org/wiki/Cache_stampede#Probabilistic_early_expiration) on top of `$cache->get($key, $callback);`

It adds a 3rd arg to `CacheInterface::get`:
> float $beta A float that controls the likelyness of triggering early expiration. 0 disables it, INF forces immediate expiration. The default is implementation dependend but should typically be 1.0, which should provide optimal stampede protection.

Commits
-------

13523ad985 [Cache] Add stampede protection via probabilistic early expiration
2018-06-11 09:05:59 +02:00
Nicolas Grekas
13523ad985 [Cache] Add stampede protection via probabilistic early expiration 2018-06-10 18:44:41 +02:00
Fabien Potencier
697a6a0ae4 fixed CS 2018-06-10 12:33:24 +02:00
Fabien Potencier
f96f4c5ab5 bug #27556 Avoiding session migration for stateless firewall UsernamePasswordJsonAuthenticationListener (weaverryan)
This PR was squashed before being merged into the 3.4 branch (closes #27556).

Discussion
----------

Avoiding session migration for stateless firewall UsernamePasswordJsonAuthenticationListener

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | Related to #27395
| License       | MIT
| Doc PR        | symfony/symfony-docs#9860

This is the sister PR to #27452, which covered all the other authentication listeners.

Commits
-------

c06f3229de Avoiding session migration for stateless firewall UsernamePasswordJsonAuthenticationListener
2018-06-10 12:32:37 +02:00
Ryan Weaver
c06f3229de Avoiding session migration for stateless firewall UsernamePasswordJsonAuthenticationListener 2018-06-10 12:32:26 +02:00
Fabien Potencier
5c2b2bb2ce fixed CS 2018-06-10 12:30:11 +02:00
Fabien Potencier
d2757de3b9 bug #27452 Avoid migration on stateless firewalls (weaverryan)
This PR was squashed before being merged into the 2.8 branch (closes #27452).

Discussion
----------

Avoid migration on stateless firewalls

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | Related to #27395
| License       | MIT
| Doc PR        | symfony/symfony-docs#9860

This is a proof-of-concept. Once we agree / are happy, I need to add this to all of the other authentication mechanisms that recently got the session migration code & add tests.

Basically, this avoids migrating the session if the firewall is stateless. There were 2 options to do this:

A) Make the `SessionAuthenticationStrategy` aware of all stateless firewalls. **This is the current approach**
or
B) Make each individual authentication listener aware whether or not *its* firewall is stateless.

Commits
-------

cca73bb564 Avoid migration on stateless firewalls
2018-06-10 12:27:47 +02:00
Ryan Weaver
cca73bb564 Avoid migration on stateless firewalls 2018-06-10 12:27:33 +02:00
Fabien Potencier
f36930f21e bug #27568 [DI] Deduplicate generated proxy classes (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Deduplicate generated proxy classes

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

Commits
-------

322f58b334 [DI] Deduplicate generated proxy classes
2018-06-10 12:04:52 +02:00
Fabien Potencier
836f1216a3 bug #27511 [Routing] fix matching host patterns, utf8 prefixes and non-capturing groups (nicolas-grekas)
This PR was merged into the 4.1 branch.

Discussion
----------

[Routing] fix matching host patterns, utf8 prefixes and non-capturing groups

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27448, #27461, #27504, #27512
| License       | MIT
| Doc PR        | -

Commits
-------

465b15caa8 [Routing] fix matching host patterns, utf8 prefixes and non-capturing groups
2018-06-10 11:55:51 +02:00
Fabien Potencier
ac70edf8cd bug #27326 [Serializer] deserialize from xml: Fix a collection that contains the only one element (webnet-fr)
This PR was squashed before being merged into the 3.4 branch (closes #27326).

Discussion
----------

[Serializer] deserialize from xml: Fix a collection that contains the only one element

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

In xml when parent node (`restaurants`) contains several children nodes with the same tag (`restaurant`) it is clear that the children form a collection:

```
restaurants = {array} [1]
 restaurant = {array} [2]
  0 = {array} [2]
   name = "Some restaurant name"
   type = "Chinese"
  1 = {array} [2]
   name = "Another restaurant name"
   type = "Italian"
```

Afterwards the object denormalizer has no problem to create a collection of restaurants.

But when there is only one child (`restaurant`) the decoded normalized array will not contain a collection:

```
restaurants = {array} [1]
 restaurant = {array} [2]
  name = "Some restaurant name"
  type = "Chinese"
```

In this situation the object denormalizer threw unexpected exception. This PR modifies `AbstractObjectNormalizer` that is it will fill a collection containing the sole element properly.

Commits
-------

1f346f446d [Serializer] deserialize from xml: Fix a collection that contains the only one element
2018-06-10 11:53:47 +02:00
Webnet team
1f346f446d [Serializer] deserialize from xml: Fix a collection that contains the only one element 2018-06-10 11:53:40 +02:00
Fabien Potencier
28623ba35e bug #27562 [HttpKernel] Log/Collect exceptions at prio 0 (ro0NL)
This PR was squashed before being merged into the 4.1 branch (closes #27562).

Discussion
----------

[HttpKernel] Log/Collect exceptions at prio 0

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no, fixes one
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #27440
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

So that it runs after the security exception listener, which runs at prio 1.

Im not sure what to do with the (wrong) changelog entry for 4.1.0 at this point.. should we add a new entry for 4.1.1?

Commits
-------

85b832bcc9 [HttpKernel] Log/Collect exceptions at prio 0
2018-06-10 11:25:21 +02:00
Roland Franssen
85b832bcc9 [HttpKernel] Log/Collect exceptions at prio 0 2018-06-10 11:25:14 +02:00
Fabien Potencier
d9d6ed58cd bug #27567 [PhpUnitBridge] Fix error on some Windows OS (Nsbx)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #27567).

Discussion
----------

[PhpUnitBridge] Fix error on some Windows OS

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27439
| License       | MIT

Bug Fix on PHPUnit Bridge

Commits
-------

50979b5ea4 [PhpUnitBridge] Fix error on some Windows OS
2018-06-10 09:25:11 +02:00
nsbx
50979b5ea4 [PhpUnitBridge] Fix error on some Windows OS 2018-06-10 09:25:02 +02:00
Nicolas Grekas
322f58b334 [DI] Deduplicate generated proxy classes 2018-06-09 21:22:19 +02:00
David Maicher
1680674174 [FrameworkBundle] fix for allowing single colon controller notation 2018-06-09 14:38:46 +02:00
Nicolas Grekas
84ada0c0c1 Merge branch '4.1'
* 4.1:
  [FrameworkBundle] decouple some cache-warmer's test from internal details
  bug #27405 [Cache] TagAwareAdapter should not corrupt memcached connection in ascii mode
  Remove released semaphore
2018-06-09 00:51:43 +02:00
Nicolas Grekas
28af1a62d1 Merge branch '4.0' into 4.1
* 4.0:
  [FrameworkBundle] decouple some cache-warmer's test from internal details
  bug #27405 [Cache] TagAwareAdapter should not corrupt memcached connection in ascii mode
  Remove released semaphore
2018-06-09 00:51:37 +02:00
Nicolas Grekas
a250e67097 Merge branch '3.4' into 4.0
* 3.4:
  [FrameworkBundle] decouple some cache-warmer's test from internal details
  bug #27405 [Cache] TagAwareAdapter should not corrupt memcached connection in ascii mode
  Remove released semaphore
2018-06-09 00:51:16 +02:00
Nicolas Grekas
7f2cb7361a bug #27357 [Lock] Remove released semaphore (jderusse)
This PR was merged into the 3.4 branch.

Discussion
----------

[Lock] Remove released semaphore

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

This PR remove the semaphore with `sem_remove`. By removing without releasing the semaphore, all pending blocking acquiring will fail that's why the acquire method has also been update to handle such case

Commits
-------

77b9f90a32 Remove released semaphore
2018-06-09 00:46:17 +02:00
Nicolas Grekas
88098f3cba bug #27416 TagAwareAdapter over non-binary memcached connections corrupts memcache (Aleksey Prilipko)
This PR was merged into the 3.4 branch.

Discussion
----------

TagAwareAdapter over non-binary memcached connections corrupts memcache

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

TagAwareAdapter uses non-ascii symbols in key names. It breaks memcached connections in non-binary mode.

Commits
-------

67d4e6dd29 bug #27405 [Cache] TagAwareAdapter should not corrupt memcached connection in ascii mode
2018-06-09 00:45:16 +02:00