Commit Graph

38324 Commits

Author SHA1 Message Date
Fabien Potencier
a27288a598 fixed CS 2018-09-04 10:29:18 +02:00
Fabien Potencier
7be3bb2d8f feature #28168 Add SameSite cookies to FrameWorkBundle (rpkamp)
This PR was merged into the 4.2-dev branch.

Discussion
----------

Add SameSite cookies to FrameWorkBundle

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes, and added to changelog https://github.com/symfony/symfony/pull/28168/files#diff-276f5b13978c2ce3f555b9603f44801aR21
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27631
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/10202

Uses `session.cookie_samesite` for PHP >= 7.3. For PHP < 7.3 it first
does a session_start(), find the emitted header, changes it, and emits
it again with the value for SameSite added.

I also tried it in a minimal Symfony 4.1 app, and works there too:

![screenshot from 2018-08-08 21-39-10](https://user-images.githubusercontent.com/1059790/43864708-b7437978-9b60-11e8-81dd-b41f1a5afb52.png)

Commits
-------

4091feb693 Add SameSite cookies to FrameWorkBundle
2018-09-04 10:27:39 +02:00
Samuel ROZE
9b575ab263 Uses Symfony Serializer by default for envelope items 2018-09-04 09:24:55 +01:00
Fabien Potencier
2738d00e32 feature #28303 [Process] Add relative path support for PHP_BINARY env var of PhpExecutableFinder (maidmaid)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Process] Add relative path support for PHP_BINARY env var of PhpExecutableFinder

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

At the moment, only the absolute path for PHP_BINARY env var works, for instance :

```
$ PHP_BINARY=/usr/bin/php7.2 php bin/console server:run
[OK] Server listening on http://127.0.0.1:8000

$ PHP_BINARY=php7.2 php bin/console server:run
[ERROR] Unable to find the PHP binary.
```

This PR makes possible the second command.

Commits
-------

52ed9889af Add relative path support for PHP_BINARY env var of PhpExecutableFinder
2018-09-04 10:22:54 +02:00
Fabien Potencier
824dbbdd8f bug #28322 [Workflow] Make sure we do not run the next transition on an updated state (Nyholm)
This PR was squashed before being merged into the 4.1 branch (closes #28322).

Discussion
----------

[Workflow] Make sure we do not run the next transition on an updated state

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

When you have a workflow like this, where all transitions are named the same.

![php](https://user-images.githubusercontent.com/1275206/44908106-87914680-ad1a-11e8-9c6f-e58de4b255e8.png)

The current behavior on `$stateMachine->apply($object, 'next')` is that it will go to "done".

It will do this because it checks the current "froms" at each iteration in the loop in `apply()`. It should check the valid transition before it actually apply them.

Commits
-------

d9dda76d8a [Workflow] Make sure we do not run the next transition on an updated state
2018-09-04 10:20:17 +02:00
Nyholm
d9dda76d8a [Workflow] Make sure we do not run the next transition on an updated state 2018-09-04 10:20:06 +02:00
Nicolas Grekas
675abdcfee [Contracts] Add traits+interfaces from the DI component 2018-09-04 10:20:02 +02:00
Fabien Potencier
487f8acde5 minor #28321 [Routing] Fixed the interface description of the url generator interface (Toflar)
This PR was merged into the 2.8 branch.

Discussion
----------

[Routing] Fixed the interface description of the url generator interface

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

The `UrlGenerator` has always been able to return `null`. Many tests assert this for many years but the interface actually always only allowed a `string` return.

Examples for tests:

- https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php#L206
- https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php#L217
- https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php#L471

So I think I would not consider this change as a BC break but rather a doc fix because it seems like `null` has always been an accepted return value.

Commits
-------

d2e9e0bcf3 Fixed the interface description of the url generator interface
2018-09-04 10:17:45 +02:00
Fabien Potencier
cf359c2e79 bug #28344 [HttpKernel][FrameworkBundle] Fix escaping of serialized payloads passed to test clients (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

[HttpKernel][FrameworkBundle] Fix escaping of serialized payloads passed to test clients

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

Commits
-------

255455430a [HttpKernel][FrameworkBundle] Fix escaping of serialized payloads passed to test clients
2018-09-04 10:15:22 +02:00
Fabien Potencier
b102e72856 minor #28345 chore: rename AppVeyor filename (Kocal)
This PR was merged into the 2.8 branch.

Discussion
----------

chore: rename AppVeyor filename

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | no
| 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        | ~ <!-- required for new features -->

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

In [AppVeyor documentation](https://www.appveyor.com/docs/build-configuration/#yaml-file-alternative-naming), it says that is possible to use alternative filename `.appveyor.yml`.

By doing this, I find this more consistent with Travis file which starts with a `.` too.

Commits
-------

b133bd6bd3 chore: rename Appveyor filename
2018-09-04 10:13:26 +02:00
Nicolas Grekas
a0e21f8d19 minor #28097 [Cache] leverage Contracts\Cache (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Cache] leverage Contracts\Cache

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

Implementing #28096

Commits
-------

0a1220fd96 [Cache] leverage Contracts\Cache
2018-09-04 10:05:30 +02:00
Nicolas Grekas
0a1220fd96 [Cache] leverage Contracts\Cache 2018-09-04 09:24:06 +02:00
Fabien Potencier
09786044c4 feature #28096 [Contracts] Add Cache contract to extend PSR-6 with tag invalidation, callback-based computation and stampede protection (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Contracts] Add Cache contract to extend PSR-6 with tag invalidation, callback-based computation and stampede protection

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

Let's separate the useful interfaces of the Cache component in Contracts.
This does not include `PruneableInterface`, `MarshallerInterface` nor `*AdapterInterface` because they are too specific to the component.

But `CacheInterface`, `TawAwareCacheInterface` and `ItemInterface` form a nice consistent set of features on top of PSR-6.

Updating the Cache component to use these interfaces will be done in a separate PR so that we can focus on the contract itself here.

Commits
-------

ca6478bbbb [Contracts] Add Cache contract to extend PSR-6 with tag invalidation, callback-based computation and stampede protection
2018-09-04 09:22:33 +02:00
Fabien Potencier
edbd869bfd bug #28183 [WebProfilerBundle] fix wrong url when base path is the index (ismail1432)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #28183).

Discussion
----------

[WebProfilerBundle] fix wrong url when base path is the index

| Q             | A
| ------------- | ---
| Branch?       | >= 3.4
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no
| 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 | #27846   <!-- #-prefixed issue number(s), if any -->
| License       | MIT

The `FileLinkFormatter` create a wrong url because it's using [getBaseUrl](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpFoundation/Request.php#L870) that render the script filename, the problem is that in this class it's used twice, first time with the [getBaseUrl method](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/Debug/FileLinkFormatter.php#L99) and another time with the [generate method](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/Debug/FileLinkFormatter.php#L77). Just switch to `getBasePath` solve the issue.
WDYT ?

Commits
-------

897615ee0d change baseUrl to basePath to fix wrong profiler url
2018-09-04 09:18:11 +02:00
Smaine Milianni
897615ee0d change baseUrl to basePath to fix wrong profiler url 2018-09-04 09:18:01 +02:00
Nicolas Grekas
ca6478bbbb [Contracts] Add Cache contract to extend PSR-6 with tag invalidation, callback-based computation and stampede protection 2018-09-04 09:16:03 +02:00
Fabien Potencier
baad3321f4 feature #27399 [Translation] Added intl message formatter. (aitboudad, Nyholm)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Translation] Added intl message formatter.

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

This PR will replace #20007 and continue the work from the original author.

I've have tried to address all comments made in the original PR.

Commits
-------

2a90931e52 cs
fb30c77659 Be more specific with what exception we catch
b1aa0047fd Only use the default translator if intl extension is loaded
f88153fa22 Updates according to feedback
597a15d7f7 Use FallbackFormatter instead of support for multiple formatters
2aa7181e15 Fixes according to feedback
a325a443ed Allow config for different domain specific formatters
b43fe21997 Add support for multiple formatters
c2b3dc0a90 [Translation] Added intl message formatter.
19e8e69979 use error
940d440e87 Make it a warning
2018-09-04 09:03:37 +02:00
Tobias Nyholm
2a90931e52
cs 2018-09-04 08:58:25 +02:00
Tobias Nyholm
fb30c77659
Be more specific with what exception we catch 2018-09-04 08:42:35 +02:00
Fabien Potencier
68a910f528 feature #28315 [DI] Trigger exception when using '@id' name in parent option (Seb33300)
This PR was squashed before being merged into the 4.2-dev branch (closes #28315).

Discussion
----------

[DI] Trigger exception when using '@id' name in parent option

Same exception [already triggered](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php#L505) on the `decorates` option.

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

Note sure if I should submit this change for master or previous branches...

Commits
-------

1f67db626e [DI] Trigger exception when using '@id' name in parent option
2018-09-04 08:40:05 +02:00
Sébastien ALFAIATE
1f67db626e [DI] Trigger exception when using '@id' name in parent option 2018-09-04 08:39:56 +02:00
Nicolas Grekas
255455430a [HttpKernel][FrameworkBundle] Fix escaping of serialized payloads passed to test clients 2018-09-04 08:39:37 +02:00
Fabien Potencier
cabbf51af4 minor #28295 [VarExporter] optimize dumped code in time and space (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[VarExporter] optimize dumped code in time and space

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

Let's squeeze some more µs when running exported code.
On a simple case run 100k times with a few objects, I go from 1.8s to 1.5s.
The generated exports are also a bit smaller if it matters.

This works by:
- using local variables instead of manually dealing with a stack
- creating more optimized object hydrators for internal classes

This PR also fixes handling of hard references that are bound to external variables.

Commits
-------

07e90d71d8 [VarExporter] optimize dumped code in time and space
2018-09-04 08:34:59 +02:00
Fabien Potencier
a82b2a78c6 Merge branch '4.1'
* 4.1:
  fixed usage of setUp in tests
  fixed usage of setUp in tests
  fixed usage of setUp in tests
  [travis] minor fix (quater)
2018-09-04 08:30:07 +02:00
Fabien Potencier
1c3d3db496 minor #28349 Fix usage of setUp in tests (4.1) (fabpot)
This PR was merged into the 4.1 branch.

Discussion
----------

Fix usage of setUp in tests (4.1)

| Q             | A
| ------------- | ---
| Branch?       | 4.1
| Bug fix?      | no
| 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 -->
| License       | MIT

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

Commits
-------

d8ba2cd703 fixed usage of setUp in tests
2018-09-04 08:29:30 +02:00
Fabien Potencier
525c98b224 Merge branch '3.4' into 4.1
* 3.4:
  fixed usage of setUp in tests
  fixed usage of setUp in tests
  [travis] minor fix (quater)
2018-09-04 08:28:44 +02:00
Fabien Potencier
9a97ea819a minor #28348 Fix usage of setUp in tests (3.4) (fabpot)
This PR was merged into the 3.4 branch.

Discussion
----------

Fix usage of setUp in tests (3.4)

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

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

Commits
-------

298782841c fixed usage of setUp in tests
2018-09-04 08:28:11 +02:00
Fabien Potencier
fcc31cb6dd Merge branch '2.8' into 3.4
* 2.8:
  fixed usage of setUp in tests
  [travis] minor fix (quater)
2018-09-04 08:27:33 +02:00
Fabien Potencier
26b173b915 minor #28347 Fix usage of setUp in tests (fabpot)
This PR was merged into the 2.8 branch.

Discussion
----------

Fix usage of setUp in tests

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | no
| 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 -->
| License       | MIT

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

Commits
-------

62e620843e fixed usage of setUp in tests
2018-09-04 08:26:58 +02:00
Fabien Potencier
d8ba2cd703 fixed usage of setUp in tests 2018-09-04 08:24:48 +02:00
Fabien Potencier
298782841c fixed usage of setUp in tests 2018-09-04 08:21:44 +02:00
Nyholm
b1aa0047fd Only use the default translator if intl extension is loaded 2018-09-04 07:44:12 +02:00
Fabien Potencier
62e620843e fixed usage of setUp in tests 2018-09-04 07:42:16 +02:00
Nyholm
f88153fa22 Updates according to feedback 2018-09-04 07:36:39 +02:00
Nyholm
597a15d7f7 Use FallbackFormatter instead of support for multiple formatters 2018-09-04 00:13:52 +02:00
Nyholm
2aa7181e15 Fixes according to feedback 2018-09-04 00:13:51 +02:00
Nyholm
a325a443ed Allow config for different domain specific formatters 2018-09-04 00:13:51 +02:00
Nyholm
b43fe21997 Add support for multiple formatters 2018-09-03 23:02:48 +02:00
Abdellatif Ait boudad
c2b3dc0a90 [Translation] Added intl message formatter. 2018-09-03 23:02:14 +02:00
Nyholm
19e8e69979 use error 2018-09-03 23:02:14 +02:00
Nyholm
940d440e87 Make it a warning 2018-09-03 23:02:14 +02:00
Fabien Potencier
59fad59886 feature #28210 [Contracts] Add Translation\TranslatorInterface + decouple symfony/validator from symfony/translation (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Contracts] Add Translation\TranslatorInterface + decouple symfony/validator from symfony/translation

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

Let's decouple Validator from Translation component \o/!

TODO:
- [x] add `TranslatorInterface`, deprecate it from Translation
- [x] add `TranslatorTrait`, deprecating `MessageSelector`, `Internal` and `PluralizationRules`
- [x] deprecate `ValidatorBuilderInterface(LegacyTranslatorInterface)`
- [x] inject a new `identity_translator` into `translator.formatter.default`, deprecate `translator.selector`
- [x] copy tests in the Contracts namespace to ensure the `TranslatorTrait` behaves properly
- [x] figure out a way to keep throwing `InvalidArgumentException` from the component
- [x] update UPGRADING and CHANGELOG files
- [x] polish the deprecation layer (ensure all needed runtime deprecations are here)

Reviews welcome already.

Commits
-------

064e369e06 [Contracts] Add Translation\TranslatorInterface + decouple symfony/validator from symfony/translation
2018-09-03 22:20:47 +02:00
Fabien Potencier
19e5218c0b feature #28331 [FrameworkBundle] Don't populate fallback cache on warmup (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[FrameworkBundle] Don't populate fallback cache on warmup

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

Since we populate the front PhpArrayCache, there is no need to also populate its fallback pool, since it will never be hit for the warmed up values.
This saves creating a myriad of small cache files and some MB.

Commits
-------

c857ba5ded [FrameworkBundle] Don't populate fallback cache on warmup
2018-09-03 22:16:15 +02:00
Hugo Alliaume
b133bd6bd3 chore: rename Appveyor filename 2018-09-03 20:51:33 +02:00
Nicolas Grekas
064e369e06 [Contracts] Add Translation\TranslatorInterface + decouple symfony/validator from symfony/translation 2018-09-03 15:19:33 +02:00
Nicolas Grekas
f9bd8acc58 [travis] minor fix (quater) 2018-09-03 15:07:30 +02:00
Nicolas Grekas
b1755cbbbb Merge branch '4.1'
* 4.1:
  [travis][appveyor] fix ter
2018-09-03 14:31:29 +02:00
Nicolas Grekas
32db92eba7 Merge branch '3.4' into 4.1
* 3.4:
  [travis][appveyor] fix ter
2018-09-03 14:31:06 +02:00
Nicolas Grekas
e170d940d8 Merge branch '2.8' into 3.4
* 2.8:
  [travis][appveyor] fix ter
2018-09-03 14:31:00 +02:00
Nicolas Grekas
74b6689838 [travis][appveyor] fix ter 2018-09-03 14:29:28 +02:00