Commit Graph

38101 Commits

Author SHA1 Message Date
Fabien Potencier
8651758fc1 feature #28294 [Messenger] Remove the "obscure" message subscriber configuration (sroze)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Messenger] Remove the "obscure" message subscriber configuration

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

As described in #28275, all of the configuration can be done using yield and that we could remove the support for other ways (especially the obscure return `[['method', -10]]` syntax) as I believe this would clarify the configuration a lot.

Commits
-------

cf2ad861f5 Remove the "obscure" message subscriber configuration
2018-08-29 15:11:20 +02:00
Fabien Potencier
7504535464 feature #28271 [Messenger] Allow interfaces to be type-hinted as well (sroze)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Messenger] Allow interfaces to be type-hinted as well

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

Interfaces can be type-hinted as well for the message handlers.

Commits
-------

2dbbfbda4e Allow interfaces to be type-hinted as well
2018-08-29 11:11:23 +02:00
Fabien Potencier
6c539e1408 feature #28190 [Messenger] Add a --bus option to the messenger:consume-messages command (chalasr, sroze)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Messenger] Add a --bus option to the messenger:consume-messages command

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

Making it compatible with the multi-bus feature.

Commits
-------

e3f1eecbc1 Bus argument is a required option when multiple buses are defined
539cb62ffe [Messenger] Add a --bus option to the messenger:consume-messages command
2018-08-29 11:09:36 +02:00
Samuel ROZE
cf2ad861f5 Remove the "obscure" message subscriber configuration 2018-08-28 13:58:44 +01:00
Samuel ROZE
bedd7aa19a feature #28275 [Messenger] Only subscribe to a given bus from the MessageSubscriber (sroze)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Messenger] Only subscribe to a given bus from the MessageSubscriber

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | ø

#27275 introduced the ability to listen to only a few buses from the handler tag. This adds that ability directly from the message subscriber.

It has also highlighted to me that most of the configuration can be done using `yield` (like the example I've added in this PR's tests) and that we could remove the support for other ways (especially the obscure `return [['method', -10]]` syntax) but I believe this should be done **in another pull-request** (that I'm happy to do after this one).

Commits
-------

f60e409011 Only subscribe to a given bus from the MessageSubscriber
2018-08-28 13:42:55 +01:00
Samuel ROZE
e3f1eecbc1 Bus argument is a required option when multiple buses are defined 2018-08-28 11:10:33 +02:00
Robin Chalas
539cb62ffe [Messenger] Add a --bus option to the messenger:consume-messages command 2018-08-28 11:09:59 +02:00
Fabien Potencier
4edbd60bbb feature #28243 [FrameworkBundle] Deprecate Symfony\Bundle\FrameworkBundle\Controller\Controller (sroze)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[FrameworkBundle] Deprecate `Symfony\Bundle\FrameworkBundle\Controller\Controller`

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

Time to deprecate `Controller`, youpi !! 🎉

Commits
-------

a7e319d9e1 Deprecate `Symfony\Bundle\FrameworkBundle\Controller\Controller`
2018-08-28 08:35:15 +02:00
Fabien Potencier
9cc80ecd75 feature #28070 [Translator] Use ICU parent locales as fallback locales (thewilkybarkid)
This PR was squashed before being merged into the 4.2-dev branch (closes #28070).

Discussion
----------

[Translator] Use ICU parent locales as fallback locales

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #12319
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/10122

Currently the `Translator` fall backs based on the locale separator (eg `es_AR` to `es`), but the ICU data contains parent locales (eg `es_AR` is a child of `es_419`, as is `es_BO`, `es_EC` etc).

This makes use of the ICU data to add add in these fallbacks. This means the specific locales can be used, but the translations can stored in these groupings (eg `es_419` for Latin American Spanish), as well as adding other sensible fallbacks (eg Cape Verdean Portuguese to `pt_PT`).

Commits
-------

e0f402fc29 [Translator] Use ICU parent locales as fallback locales
2018-08-28 08:30:53 +02:00
Chris Wilkinson
e0f402fc29 [Translator] Use ICU parent locales as fallback locales 2018-08-28 08:30:46 +02:00
Samuel ROZE
a7e319d9e1 Deprecate Symfony\Bundle\FrameworkBundle\Controller\Controller 2018-08-27 19:13:10 +01:00
Fabien Potencier
a1aee05bc1 Merge branch '4.1'
* 4.1:
  bumped Symfony version to 2.8.46
  updated VERSION for 2.8.45
  update CONTRIBUTORS for 2.8.45
  updated CHANGELOG for 2.8.45
  [PhpUnitBridge] keep compat with composer 1.0
  Instantiate $offset and $maxlen at definition
  [Cache] minor code update to leverage PHP 7.1
2018-08-27 19:47:18 +02:00
Fabien Potencier
2c3c5c23b1 Merge branch '3.4' into 4.1
* 3.4:
  bumped Symfony version to 2.8.46
  updated VERSION for 2.8.45
  update CONTRIBUTORS for 2.8.45
  updated CHANGELOG for 2.8.45
  [PhpUnitBridge] keep compat with composer 1.0
  Instantiate $offset and $maxlen at definition
2018-08-27 19:47:02 +02:00
Fabien Potencier
05dccf88d0 Merge branch '2.8' into 3.4
* 2.8:
  bumped Symfony version to 2.8.46
  updated VERSION for 2.8.45
  update CONTRIBUTORS for 2.8.45
  updated CHANGELOG for 2.8.45
  Instantiate $offset and $maxlen at definition
2018-08-27 19:45:33 +02:00
Fabien Potencier
a8b16054e7 bumped Symfony version to 2.8.46 2018-08-27 19:44:28 +02:00
Fabien Potencier
289dc238c5
Merge pull request #28286 from fabpot/release-2.8.45
released v2.8.45
2018-08-27 19:33:57 +02:00
Fabien Potencier
7e0a16cf2f updated VERSION for 2.8.45 2018-08-27 19:33:38 +02:00
Fabien Potencier
97e425cdcb update CONTRIBUTORS for 2.8.45 2018-08-27 19:33:31 +02:00
Fabien Potencier
0aee31fcd8 updated CHANGELOG for 2.8.45 2018-08-27 19:33:04 +02:00
Fabien Potencier
da0ef24744 feature #28231 [VarExporter] a new component to serialize values to plain PHP code (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[VarExporter] a new component to serialize values to plain PHP code

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

This PR proposes moving what is currently the `PhpMarshaller` class in the Cache component to a separate component.

This component would provide only one public static method:
`VarExporter::export($value, bool &$isStaticValue = null): string`.

This method returns `$value` serialized as plain PHP code. Running this code creates the same exact data structure that `$value` contained. This is exactly like `serialize()` and `unserialize()`, from which all semantics are preserved (`__sleep`, `__wakeup` and `Serializable`).

The reason to use this method *vs* `serialize()` or even igbinary is performance: thanks to OPcache, the resulting code is significantly faster and more memory efficient than using `unserialize()` or `igbinary_unserialize()`.

Unlike `var_export()`, this works on any serializable PHP value.

It also provides a few improvements over `var_export()`/`serialize()`:
- the output is PSR-2 compatible
- the output can be re-indented without messing up with any `\r` or `\n` in the data
- missing classes throw a `ReflectionException` instead of being unserialized to a `PHP_Incomplete_Class` object
- references involving `SplObjectStorage`, `ArrayObject` or `ArrayIterator` instances are preserved
- `Reflection*`, `IteratorIterator` and `RecursiveIteratorIterator` classes throw an exception when being serialized (their unserialized version is broken anyway, see  https://bugs.php.net/76737.)

Commits
-------

7831ad75e5 [VarExporter] a new component to serialize values to plain PHP code
2018-08-27 18:42:24 +02:00
Nicolas Grekas
7831ad75e5 [VarExporter] a new component to serialize values to plain PHP code 2018-08-27 18:34:07 +02:00
Fabien Potencier
ecff692f8e minor #28222 [WebProfilerBundle] Limit width of toolbar item (ostrolucky)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[WebProfilerBundle] Limit width of toolbar item

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

before
![screenshot from 2018-08-17 22-06-46](https://user-images.githubusercontent.com/496233/44287443-2d4dab80-a26d-11e8-9e28-e4f7764ed428.png)
after:
![screenshot from 2018-08-17 22-07-04](https://user-images.githubusercontent.com/496233/44287452-33438c80-a26d-11e8-8efe-539f7a1dae8d.png)

Tested on master and 2.8.
IMO should be treated as bug fix, there are no conflicts.

Commits
-------

097c3f82a7 [WebProfilerBundle] Limit width of toolbar item
2018-08-27 18:25:07 +02:00
Fabien Potencier
74461cc2db feature #28244 [FrameworkBundle] Added new "auto" mode for framework.session.cookie_secure to turn it on when https is used (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[FrameworkBundle] Added new "auto" mode for `framework.session.cookie_secure` to turn it on when https is used

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

I'm pretty sure we're many forgetting to make session cookies "secure".
Here is an "auto" mode that makes them secure automatically when the session is started on requests with the "https" scheme.

Commits
-------

4f7b41a83d [FrameworkBundle] Added new "auto" mode for `framework.session.cookie_secure` to turn it on when https is used
2018-08-27 18:19:09 +02:00
Nicolas Grekas
4f7b41a83d [FrameworkBundle] Added new "auto" mode for framework.session.cookie_secure to turn it on when https is used 2018-08-27 18:13:55 +02:00
Fabien Potencier
ea5fe6f353 minor #28236 Don't "replace" symfony/contracts (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

Don't "replace" symfony/contracts

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

Maintaining an exact version number here is going to be painful on the long run.
Let's free us from this burden.

Commits
-------

7b4e5cc50b Don't "replace" symfony/contracts
2018-08-27 18:00:25 +02:00
Fabien Potencier
53ffa6674a feature #28277 [Serializer] AbstractObjectNormalizer improve performance (martiis)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Serializer] AbstractObjectNormalizer improve performance

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

Check ticket for description

Commits
-------

4224145a69 [Serializer] AbstractObjectNormalizer improve perf when checking types
2018-08-27 17:56:01 +02:00
Fabien Potencier
b547855b23 bug #28278 [HttpFoundation] Fix unprepared BinaryFileResponse sends empty file (wackymole)
This PR was merged into the 2.8 branch.

Discussion
----------

[HttpFoundation] Fix unprepared BinaryFileResponse sends empty file

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes, with the exception of preexisting, unrelated failures
| Fixed tickets | #28237
| License       | MIT
| Doc PR        |

When you call `BinaryFileResponse#sendContent()` without first calling `prepare()` the response is sent but the contents are empty. `prepare()` properly initializes the `$maxlen` and `$offset` properties. However, `sendContent()` doesn't do any sanity checking, and so, uses the uninitialized properties. This causes `stream_copy_to_stream()` to copy empty contents and the file that is sent, to contain nothing.

This change initializes the properties at definition instead of in `prepare()`.

> Additionally:
> - Bug fixes must be submitted against the lowest branch where they apply

~I'm not sure how early this bug exists, or how far back to go. I'll check to see if 2.7 and 2.8 are affected and report back.~

Commits
-------

dba8687a5d Instantiate $offset and $maxlen at definition
2018-08-27 17:52:41 +02:00
Fabien Potencier
8e984f8bfd minor #28280 [Cache] minor code update to leverage PHP 7.1 (nicolas-grekas)
This PR was merged into the 4.1 branch.

Discussion
----------

[Cache] minor code update to leverage PHP 7.1

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

Commits
-------

c1bf1918ec [Cache] minor code update to leverage PHP 7.1
2018-08-27 17:49:12 +02:00
Fabien Potencier
6cc2bd680e minor #28281 [Serializer] Update changelog about the new $encoderIgnoredNodeTypes arg in XmlEncoder contrustor (maidmaid)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Serializer] Update changelog about the new $encoderIgnoredNodeTypes arg in XmlEncoder contrustor

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/27926
| License       | MIT
| Doc PR        | /

Commits
-------

49f3bfc823 Update changelog
2018-08-27 17:45:46 +02:00
Fabien Potencier
93bb665272 feature #28247 [Messenger] Don't make EnvelopeItemInterface extend Serializable (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Messenger] Don't make EnvelopeItemInterface extend Serializable

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

`Serializable` is a broken interface, see e.g. https://externals.io/message/98834
I don't think we should force ppl to implement it anywhere.
Actually, it isn't required to be able to serialize an object, and it doesn't enforce making a class serializable (as the `serialize()` method can throw).

What was the purpose of the removed logic? ping @sroze @ogizanagi

Commits
-------

2beda894f2 [Messenger] Don't make EnvelopeItemInterface extend Serializable
2018-08-27 17:40:47 +02:00
Fabien Potencier
2041624286 bug #28284 [PhpUnitBridge] keep compat with composer 1.0 (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnitBridge] keep compat with composer 1.0

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

Remove `--no-suggest` when installing PHPUnit from the bridge to keep compat with composer 1.0, which is shipped with Ubuntu 16.04LTS.

Commits
-------

28492a7bb1 [PhpUnitBridge] keep compat with composer 1.0
2018-08-27 17:39:04 +02:00
Nicolas Grekas
28492a7bb1 [PhpUnitBridge] keep compat with composer 1.0 2018-08-27 17:17:06 +02:00
Dany Maillard
49f3bfc823 Update changelog 2018-08-27 17:10:45 +02:00
Justin
dba8687a5d Instantiate $offset and $maxlen at definition 2018-08-27 09:50:38 -04:00
Samuel ROZE
2dbbfbda4e Allow interfaces to be type-hinted as well 2018-08-27 12:46:17 +01:00
Samuel ROZE
f60e409011 Only subscribe to a given bus from the MessageSubscriber 2018-08-27 12:33:54 +01:00
Nicolas Grekas
c1bf1918ec [Cache] minor code update to leverage PHP 7.1 2018-08-27 11:36:56 +02:00
Martynas Sudintas
4224145a69 [Serializer] AbstractObjectNormalizer improve perf when checking types 2018-08-26 19:46:07 +03:00
Nicolas Grekas
ff1727e2ee Merge branch '4.1'
* 4.1:
  [HttpFoundation] cleanup test case
  [HttpFoundation] Allow RedisCluster class for RedisSessionHandler
2018-08-26 10:35:20 +02:00
Nicolas Grekas
620dfdec13 [HttpFoundation] cleanup test case 2018-08-26 10:29:34 +02:00
Nicolas Grekas
aa8b9c0ecc bug #28251 [HttpFoundation] Allow RedisCluster class for RedisSessionHandler (michaelperrin)
This PR was squashed before being merged into the 4.1 branch (closes #28251).

Discussion
----------

[HttpFoundation] Allow RedisCluster class for RedisSessionHandler

| Q             | A
| ------------- | ---
| Branch?       | 4.1 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets |    <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        |

The `RedisSessionHandler` added in Symfony 4.1 was supposed to accept `RedisCluster` instances but that possibility was not in the condition, leading to an `InvalidArgumentException`.

I formatted the object type condition to allow the `RedisCluster` instance value and also added a test for it.

A double space formatting issue has been fixed too (which is included in the same commit, I can change that if needed).

I could not add a test using RedisCluster, as the installed Redis instance on Travis doesn't use clusters.

Commits
-------

d2ecea0b6e [HttpFoundation] Allow RedisCluster class for RedisSessionHandler
2018-08-26 10:23:36 +02:00
Michaël Perrin
d2ecea0b6e [HttpFoundation] Allow RedisCluster class for RedisSessionHandler 2018-08-26 10:23:26 +02:00
Kévin Dunglas
9ef362eecb
feature #27926 [Serializer] XmlEncoder doesn't ignore PI nodes while encoding (maidmaid)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Serializer] XmlEncoder doesn't ignore PI nodes while encoding

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

It's sometimes important to get only the XML body without the processing instructions (like the `<?xml version="1.0" ?>` on the top of your XML doc). At the moment, it's possible to ignore them while decoding, but not while encoding.

```php
$encoder = new XmlEncoder('response', null, $ignoredNodeTypes = [XML_PI_NODE]);
echo $encoder->encode([], 'xml');
```
```
Expected:
<response/>

Actual:
<?xml version="1.0"?>
<response/>
```

So, a new `$encoderIgnoredNodeTypes` arg is added to the constructor which will be:

```php
public function __construct(string $rootNodeName = 'response', int $loadOptions = null, array $decoderIgnoredNodeTypes = array(XML_PI_NODE, XML_COMMENT_NODE), array $encoderIgnoredNodeTypes = array())
```

Commits
-------

2223fcc5b9 Allow to ignore PI while encoding
2018-08-25 12:11:08 +02:00
Dany Maillard
2223fcc5b9 Allow to ignore PI while encoding 2018-08-24 19:15:24 +02:00
Nicolas Grekas
4e4b21668a Merge branch '4.1'
* 4.1:
  [HttpKernel] fix forwarding trusted headers as server parameters
2018-08-24 16:41:28 +02:00
Nicolas Grekas
3ac90c172a Merge branch '3.4' into 4.1
* 3.4:
  [HttpKernel] fix forwarding trusted headers as server parameters
2018-08-24 16:41:24 +02:00
Nicolas Grekas
96e0833b93 Merge branch '2.8' into 3.4
* 2.8:
  [HttpKernel] fix forwarding trusted headers as server parameters
2018-08-24 16:37:40 +02:00
Nicolas Grekas
2554ad0698 bug #28241 [HttpKernel] fix forwarding trusted headers as server parameters (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

[HttpKernel] fix forwarding trusted headers as server parameters

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

Commits
-------

92953485a5 [HttpKernel] fix forwarding trusted headers as server parameters
2018-08-24 16:33:48 +02:00
Nicolas Grekas
2beda894f2 [Messenger] Don't make EnvelopeItemInterface extend Serializable 2018-08-24 15:12:11 +02:00
Nicolas Grekas
c099d8675f Merge branch '4.1'
* 4.1:
  [travis] fix composer.lock invalidation for deps=low
  fix typo
2018-08-24 14:41:40 +02:00