Commit Graph

37336 Commits

Author SHA1 Message Date
Nicolas Grekas
c6b3135c9b bug #27633 [Messenger] Fixed MessengerPass::guessHandledClasses return type (massimilianobraglia)
This PR was squashed before being merged into the 4.2-dev branch (closes #27633).

Discussion
----------

[Messenger] Fixed MessengerPass::guessHandledClasses return type

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

Good evening! Thanks for this amazing project.
I've searched over issues and PRs and I didn't find anything about this bug I found. Excuse me if this is a duplicate.

If you create an implementation of `MessageSubscriberInterface` and yield results from `getHandledMessages` method, a TypeError (like the following) will be raised:

```TypeError: Return value of Symfony\Component\Messenger\DependencyInjection\MessengerPass::guessHandledClasses() must be of the type array, object returned```

`MessengerPass::guessHandledClasses` return type declared is `array`, when `MessageSubscriberInterface::guessHandledClasses()`'s return type is `iterable`.

In this PR I have fixed the return type and wrote a simple test for it.

I am looking forward your review. Thank you.
Massimiliano

Commits
-------

0b1c8257d6 [Messenger] Fixed MessengerPass::guessHandledClasses return type
2018-06-19 11:34:47 +02:00
Massimiliano Braglia
0b1c8257d6 [Messenger] Fixed MessengerPass::guessHandledClasses return type 2018-06-19 11:34:40 +02:00
Nicolas Grekas
1f439e5845 minor #27623 [minor] SCA (kalessil)
This PR was squashed before being merged into the 3.4 branch (closes #27623).

Discussion
----------

[minor] SCA

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

New findings: language level, greedy regex, array_column usages

Commits
-------

5922507dc5 [minor] SCA
2018-06-19 11:31:47 +02:00
Vladimir Reznichenko
5922507dc5 [minor] SCA 2018-06-19 11:31:41 +02:00
Nicolas Grekas
ee2f76e929 bug #27632 [HttpFoundation] Ensure RedisSessionHandler::updateTimestamp returns a boolean (MatTheCat)
This PR was merged into the 4.1 branch.

Discussion
----------

[HttpFoundation] Ensure RedisSessionHandler::updateTimestamp returns a boolean

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

Since v1.1.0 predis doesn't return the result of `EXPIRE` as a boolean, thus breaking `updateTimestamp` implementation.

Maybe it's worth mentioning error messages were useless here:

- Symfony: `User Warning: session_write_close(): Failed to write session data with Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler handler`
- PHP: `session_write_close(): Session callback expects true/false return value`

Commits
-------

079b944077 Ensure updateTimestamp returns a boolean
2018-06-19 11:15:38 +02:00
Nicolas Grekas
ea53fb01ad bug #27630 [Validator][Form] Remove BOM in some xlf files (gautierderuette)
This PR was submitted for the 3.4 branch but it was merged into the 2.8 branch instead (closes #27630).

Discussion
----------

[Validator][Form] Remove BOM in some xlf files

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

I removed first blank space from some xml files

It caused this error during cache:clear
[ERROR 4] Start tag expected, '<' not found (in n/a - line 1, column 1)

Commits
-------

0bc53d66c0 [Validator] Remove BOM in some xlf files
2018-06-19 10:02:23 +02:00
Gautier Deuette
0bc53d66c0 [Validator] Remove BOM in some xlf files 2018-06-19 10:02:14 +02:00
Fabien Potencier
c0ca2afbb3 feature #27543 [Cache] serialize objects using native arrays when possible (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Cache] serialize objects using native arrays when possible

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

This PR allows leveraging OPCache shared memory when storing objects in `Php*` pool storages (as done by default for all system caches). This improves performance a bit further when loading e.g. annotations, etc. (bench coming);

Instead of using native php serialization, this uses a marshaller that represents objects in plain static arrays. Unmarshalling these arrays is faster than unserializing the corresponding PHP strings (because it works with copy-on-write, while unserialize cannot.)

php-serialization is still a possible format because we have to use it when serializing structures with internal references or with objects implementing `Serializable`. The best serialization format is selected automatically so this is completely seamless.

ping @palex-fpt since you gave me the push to work on this, and are pursuing a similar goal in #27484. I'd be thrilled to get some benchmarks on your scenarios.

Commits
-------

866420e2eb [Cache] serialize objects using native arrays when possible
2018-06-18 17:28:27 +02:00
Fabien Potencier
d075d0ce11 feature #27563 [Cache] Improve perf of array-based pools (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Cache] Improve perf of array-based pools

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

- skip key validation when key is already known
- remove overhead in `ArrayCache::get()` via inlining
- don't store simple values in serialized format when not needed, preserving COW

~~Needs #27565 to be green.~~

Commits
-------

92a2d4754f [Cache] Improve perf of array-based pools
2018-06-18 17:12:19 +02:00
Fabien Potencier
137dd7658e feature #27604 [Cache] Prevent stampede at warmup using flock() (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Cache] Prevent stampede at warmup using flock()

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

Replaces #27028

This PR protects against cache stampede by wrapping the computation of items in a pool of locks.

For each apps, there can be at most 20 concurrent processes that compute items at the same time and only one per cache-key.

Commits
-------

0ac2777ad1 [Cache] Prevent stampede at warmup using flock()
2018-06-18 17:07:46 +02:00
Nicolas Grekas
0ac2777ad1 [Cache] Prevent stampede at warmup using flock() 2018-06-18 17:06:11 +02:00
MatTheCat
079b944077 Ensure updateTimestamp returns a boolean 2018-06-18 15:48:40 +02:00
Robin Chalas
84c5635870 Merge branch '4.1'
* 4.1:
2018-06-18 14:30:03 +02:00
karl.rixon
dae704ad2f Fix #27378: Error when rendering a DateIntervalType form with exactly 0 weeks 2018-06-18 12:57:58 +01:00
Pascal Montoya
acfb325a35
refs #26898
Remove unnecessary loop
Trim messages on build rather than on display
2018-06-18 12:27:44 +02:00
Pascal Montoya
da42b3e23c
refs #26898
Check if projectDir is not null before loop
2018-06-18 12:27:44 +02:00
Pascal Montoya
da0c589385
refs #26898
Move changelog entry to 4.1.0 to 4.2.0
2018-06-18 12:27:44 +02:00
Pascal Montoya
7d9467a319
Add an entry on json export format 2018-06-18 12:27:44 +02:00
Pascal Montoya
bab9d99032
Use %twig.default_path% parameter and search in old folder structure too 2018-06-18 12:27:44 +02:00
Pascal Montoya
1758de24a5
[TwigBridge] Added bundle name suggestion on wrongly overrided templates paths 2018-06-18 12:27:44 +02:00
Robin Chalas
28d754db2c Merge branch '4.0'
* 4.0:
  Fix merge
  [HttpKernel] Fix resetting DumpDataCollector::$isCollected
  [Framework][Workflow] Added support for interfaces
2018-06-18 11:32:54 +02:00
Robin Chalas
15c0d48277 Merge branch '4.0' into 4.1
* 4.0:
  Fix merge
  [HttpKernel] Fix resetting DumpDataCollector::$isCollected
  [Framework][Workflow] Added support for interfaces
2018-06-18 11:31:19 +02:00
Robin Chalas
57fc15bde6 Merge branch '3.4' into 4.0
* 3.4:
  Fix merge
  [HttpKernel] Fix resetting DumpDataCollector::$isCollected
  [Framework][Workflow] Added support for interfaces
2018-06-18 11:30:06 +02:00
Robin Chalas
13e983a127 Fix merge 2018-06-18 11:28:47 +02:00
Nicolas Grekas
866420e2eb [Cache] serialize objects using native arrays when possible 2018-06-18 10:20:36 +02:00
Oskar Stark
1df7742345 [FrameworkBundle] show public/private for aliases in debug:container command 2018-06-17 22:04:46 +02:00
Nicolas Grekas
4cec0e1260 [HttpKernel] Fix resetting DumpDataCollector::$isCollected 2018-06-16 10:35:33 +02:00
Fabien Potencier
50f2ed768a bug #27596 [Framework][Workflow] Added support for interfaces (vudaltsov)
This PR was squashed before being merged into the 3.4 branch (closes #27596).

Discussion
----------

[Framework][Workflow] Added support for interfaces

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

I consider this to be a bugfix in config, because `ClassInstanceSupportStrategy` (`InstanceOfSupportStrategy`) actually works with interfaces. Therefore propose to 3.4.

Commits
-------

6104c28c08 [Framework][Workflow] Added support for interfaces
2018-06-15 15:02:39 +02:00
Valentin Udaltsov
6104c28c08 [Framework][Workflow] Added support for interfaces 2018-06-15 15:02:31 +02:00
Nicolas Grekas
92a2d4754f [Cache] Improve perf of array-based pools 2018-06-15 11:22:35 +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
benoushnorouzi
32988b4294 Enhance the twig not found exception
Enhance the twig not found exception
2018-06-14 14:22:04 +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