Commit Graph

37253 Commits

Author SHA1 Message Date
Nicolas Grekas
866420e2eb [Cache] serialize objects using native arrays when possible 2018-06-18 10:20:36 +02:00
Nicolas Grekas
3ccbec3497 Merge branch '4.1'
* 4.1:
  fix merge
2018-06-15 10:20:40 +02:00
Nicolas Grekas
6e0818db16 fix merge 2018-06-15 10:15:34 +02:00
Nicolas Grekas
719b429655 fix merge 2018-06-15 10:13:37 +02:00
Nicolas Grekas
a687119e10 Merge branch '4.1'
* 4.1:
  remove HHVM code
  [VarDumper] Fix dumping ArrayObject and ArrayIterator instances
  [ProxyManagerBridge] Fixed support of private services
  [Cache] Fix typo in comment.
  [FrameworkBundle] give access to non-shared services when using test.service_container
  Fix bad method call with guard authentication + session migration
  Avoid calling eval when there is no script embedded in the toolbar
2018-06-15 09:52:48 +02:00
Nicolas Grekas
f658ed6d17 Merge branch '4.0' into 4.1
* 4.0:
  remove HHVM code
  [VarDumper] Fix dumping ArrayObject and ArrayIterator instances
  [ProxyManagerBridge] Fixed support of private services
  [Cache] Fix typo in comment.
  Fix bad method call with guard authentication + session migration
2018-06-15 09:52:42 +02:00
Nicolas Grekas
aa432743f5 remove HHVM code 2018-06-15 09:52:13 +02:00
Nicolas Grekas
79b804fdb7 Merge branch '3.4' into 4.0
* 3.4:
  [VarDumper] Fix dumping ArrayObject and ArrayIterator instances
  [ProxyManagerBridge] Fixed support of private services
  [Cache] Fix typo in comment.
  Fix bad method call with guard authentication + session migration
2018-06-15 09:50:28 +02:00
Nicolas Grekas
be700aed1d Merge branch '2.8' into 3.4
* 2.8:
  [VarDumper] Fix dumping ArrayObject and ArrayIterator instances
  Fix bad method call with guard authentication + session migration
2018-06-15 09:47:49 +02:00
Nicolas Grekas
56f5d83f82 bug #27593 [ProxyManagerBridge] Fixed support of private services (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[ProxyManagerBridge] Fixed support of private services

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

<!--
Write a short README entry for your feature/bugfix here (replace this comment block.)
This will help people understand your PR and can be used as a start of the Doc PR.
Additionally:
 - Bug fixes must be submitted against the lowest 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 the master branch.
-->

Fixed lazy loading of private services, that was broken since Symfony 4.0 release because of renaming
addObjectResource
fa022f05be/src/Symfony/Component/DependencyInjection/CHANGELOG.md (L114)

Commits
-------

198bee0916 [ProxyManagerBridge] Fixed support of private services
2018-06-15 09:10:17 +02:00
Nicolas Grekas
2627c16d0b bug #27591 [VarDumper] Fix dumping ArrayObject and ArrayIterator instances (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

[VarDumper] Fix dumping ArrayObject and ArrayIterator instances

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

Properties added on child classes of `ArrayObject` and `ArrayIterator`, or dynamic properties added on instances of them were now properly dumped. This fixes it.

![image](https://user-images.githubusercontent.com/243674/41349429-2660cbc6-6f10-11e8-8015-a3d6ad8b0c9c.png)

Commits
-------

3ecabfc36e [VarDumper] Fix dumping ArrayObject and ArrayIterator instances
2018-06-15 08:50:57 +02:00
Nicolas Grekas
ffa79bacc1 bug #27528 [FrameworkBundle] give access to non-shared services when using test.service_container (nicolas-grekas)
This PR was merged into the 4.1 branch.

Discussion
----------

[FrameworkBundle] give access to non-shared services when using test.service_container

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

Commits
-------

516ff5a985 [FrameworkBundle] give access to non-shared services when using test.service_container
2018-06-15 08:49:43 +02:00
Nicolas Grekas
3ecabfc36e [VarDumper] Fix dumping ArrayObject and ArrayIterator instances 2018-06-15 08:44:46 +02:00
Nicolas Grekas
198bee0916 [ProxyManagerBridge] Fixed support of private services 2018-06-14 12:06:05 +02:00
Nicolas Grekas
eeb53ee2ed minor #27598 [Cache] Fix typo in comment. (sepehr)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #27598).

Discussion
----------

[Cache] Fix typo in comment.

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

It's just a typo fix.

Commits
-------

39dd9b2f97 [Cache] Fix typo in comment.
2018-06-14 10:53:11 +02:00
Sepehr Lajevardi
39dd9b2f97 [Cache] Fix typo in comment. 2018-06-14 10:53:02 +02:00
Nicolas Grekas
516ff5a985 [FrameworkBundle] give access to non-shared services when using test.service_container 2018-06-14 10:43:49 +02:00
Fabien Potencier
b560883ffe feature #27315 [TwigBundle] add exception chain breadcrumbs navigation (kiler129)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[TwigBundle] add exception chain breadcrumbs navigation

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

Small DX improvement allowing to jump to exception in chain:
![preview](https://media.giphy.com/media/23chfZo9oFzdOrZzYl/giphy.gif)

Commits
-------

5551e0c091 feature #26824 add exception chain breadcrumbs navigation
2018-06-14 07:06:08 +02:00
Fabien Potencier
fb4c79bca7 bug #27584 Avoid calling eval when there is no script embedded in the toolbar (stof)
This PR was merged into the 4.1 branch.

Discussion
----------

Avoid calling eval when there is no script embedded in the toolbar

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

#27189 changed the way embedded scripts were eval'd for the toolbar. But it also refactored the code in a way triggering `eval` all the time, even when there is no embedded script, which was reported several times as an issue with CSP.

While the debug panel (showing dumps) still requires having `unsafe-eval` in the CSP header (due to embedding scripts that we eval), this PR reverts back to the behavior of Symfony 4.0 and older, where only toolbars actually embedding scripts have this CSP compat issue.

Commits
-------

a0f78a5e0b Avoid calling eval when there is no script embedded in the toolbar
2018-06-13 07:33:56 +02:00
Robin Chalas
2643ec87d5 bug #27581 Fix bad method call with guard authentication + session migration (weaverryan)
This PR was squashed before being merged into the 2.8 branch (closes #27581).

Discussion
----------

Fix bad method call with guard authentication + session migration

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no (but there needs to be on master)
| Tests pass?   | yes
| Fixed tickets | #27577
| License       | MIT
| Doc PR        | n/a

I messed up #27452 :/. Guard is the one class where the session migration is not on the listener, it's on the handler. The tricky part is that there is only ONE handler (unlike listeners where there is 1 listener per firewall). That means that implementing a session migration strategy that avoids stateless firewalls was a bit more tricky: I could only think to inject a map into `GuardAuthenticationHandler`. On the bright side, this also fixes session migration (not happening) when people call the `authenticateUserAndHandleSuccess()` method directly.

On master, we'll need to add a deprecation to make the 3rd argument of `authenticateWithToken()` required - it's optional now for BC. We may also need to re-order the constructor args.

I DID test this in a real 2.8 project, to make sure that things were properly wired up. Apologies for not doing that for the other PR.

Cheers!

Commits
-------

2c0ac93 Fix bad method call with guard authentication + session migration
2018-06-12 15:18:03 +02:00
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