Commit Graph

37336 Commits

Author SHA1 Message Date
Gabriel Ostrolucký
02f2f0ed39 [Form] Deprecate searchAndRenderBlock returning empty string 2018-06-25 08:47:55 +02:00
Fabien Potencier
92c37b9711 minor #27609 Remove direct dependencies on doctrine/common (Majkl578)
This PR was merged into the 4.2-dev branch.

Discussion
----------

Remove direct dependencies on doctrine/common

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

Doctrine has recently separated multiple components from doctrine/common:
* [doctrine/event-manager](https://github.com/doctrine/event-manager) [[release notes](https://github.com/doctrine/event-manager/releases/tag/v1.0.0) | [split PR](https://github.com/doctrine/common/pull/842)]
* [doctrine/persistence](https://github.com/doctrine/persistence) [[release notes](https://github.com/doctrine/persistence/releases/tag/v1.0.0) | [split PR](https://github.com/doctrine/common/pull/845)]
* [doctrine/reflection](https://github.com/doctrine/reflection) [[release notes](https://github.com/doctrine/reflection/releases/tag/v1.0.0) | [split PR](https://github.com/doctrine/common/pull/845)]

All of the packages are 100% backward compatible with their counterparts in Common 2.8.

This is a major step to slowly start with [phasing out doctrine/common package](https://github.com/doctrine/common/issues/826) before ORM 3.0 / DBAL 3.0 / ODM 3.0.
Common 2.9.0 will also be composed from these new packages.

Most of the remaining parts in doctrine/common are likely to be deprecated (or already are), please see & discuss in [the PR over in doctrine/common repository](https://github.com/doctrine/common/pull/845).

This PR therefore aims to remove the direct doctrine/common dependency from Symfony, replacing it by specific Doctrine components.

Commits
-------

b0fa398187 Remove direct dependencies on doctrine/common
2018-06-20 19:56:31 +02:00
Fabien Potencier
bc8d4f627e feature #27646 [Cache] added support for phpredis 4 compression and tcp_keepalive options (nicolas-grekas)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[Cache] added support for phpredis 4 `compression` and `tcp_keepalive` options

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

See https://pecl.php.net/package-changelog.php?package=redis

Commits
-------

2ff02cd333 [Cache] added support for phpredis 4 `compression` and `tcp_keepalive` options
2018-06-20 19:52:00 +02:00
Fabien Potencier
1dac82a41a feature #27605 [DX] Log potential redirect loops caused by forced HTTPS (colinodell)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[DX] Log potential redirect loops caused by forced HTTPS

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

If the developer forgets/fails to set "trusted_proxies" properly, forcing the
https channel can cause infinite redirect loops. This change will hopefully
help them identify the problem faster.

See https://github.com/symfony/symfony/issues/27603

Commits
-------

53048cec6d Log potential redirect loops caused by forced HTTPS
2018-06-20 19:48:57 +02:00
Fabien Potencier
1ff80e3b97 feature #27653 [Translation] Improved the performance of the lint:xliff command (javiereguiluz)
This PR was squashed before being merged into the 4.2-dev branch (closes #27653).

Discussion
----------

[Translation] Improved the performance of the lint:xliff command

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

As suggested by @stof I extracted the schema validation logic from XliffFileLoader to reuse it in the `lint:xliff` command. The validation is now instantaneous, so the command is blazing fast!

Commits
-------

e53bf5839b [Translation] Improved the performance of the lint:xliff command
2018-06-20 19:36:31 +02:00
Javier Eguiluz
e53bf5839b [Translation] Improved the performance of the lint:xliff command 2018-06-20 19:36:22 +02:00
Nicolas Grekas
1abfb2ced6 Merge branch '4.1'
* 4.1:
  [Cache] Improve resiliency when calling doFetch() in AbstractTrait
  [Messenger] Fixed MessengerPass::guessHandledClasses return type
  Fixing GlobResource when inside phar archive
2018-06-20 13:16:05 +02:00
Nicolas Grekas
389fa4dc23 bug #27651 [Messenger] Fixed MessengerPass::guessHandledClasses return type (massimilianobraglia)
This PR was merged into the 4.1 branch.

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?   |  no
| Fixed tickets | #27633
| License       | MIT
| Doc PR        | ø

#27633 should have been merged to 4.1.

Commits
-------

d6b6e9658c [Messenger] Fixed MessengerPass::guessHandledClasses return type
2018-06-20 13:15:41 +02:00
Nicolas Grekas
20147fce57 Merge branch '4.0' into 4.1
* 4.0:
  [Cache] Improve resiliency when calling doFetch() in AbstractTrait
  Fixing GlobResource when inside phar archive
2018-06-20 13:15:17 +02:00
Nicolas Grekas
641ecbb74b Merge branch '3.4' into 4.0
* 3.4:
  [Cache] Improve resiliency when calling doFetch() in AbstractTrait
  Fixing GlobResource when inside phar archive
2018-06-20 13:15:04 +02:00
Nicolas Grekas
b61c8fcb77 bug #26845 [Config] Fixing GlobResource when inside phar archive (vworldat)
This PR was merged into the 3.4 branch.

Discussion
----------

[Config] Fixing GlobResource when inside phar archive

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | yes if old broken behavior counts as stable
| Deprecations? | no
| Tests pass?   | no tests yet
| Fixed tickets |
| License       | MIT
| Doc PR        | N/A

When packaging an Sf4 application as a PHAR archive using globs at various locations (`Kernel`, `services.yaml`) most glob files are not found because the `glob()` PHP method [does not support PHAR streams](https://stackoverflow.com/questions/8203188/unexpected-problems-with-php-phar).

Using the regex fallback instead when operating inside PHAR archives fixes the behavior for me.

## Examples:

`src/Kernel.php::configureContainer()`:

```php
$loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob');
```

Expected behavior: `config/services.yaml` inside PHAR archive is found and parsed
Actual behavior: the file will not be loaded

`config/services.yaml` (hard-coded in Kernel without using glob pattern)

```yaml
    App\:
        resource: '../src/*'
        exclude: '../src/{Entity,Migrations,Tests,Kernel.php}'
```

Expected behavior: service classes in `src/` will be found and auto-wired
Actual behavior: services are not auto-wired because the class files are not found

Commits
-------

e336ebeecf Fixing GlobResource when inside phar archive
2018-06-20 13:09:19 +02:00
Nicolas Grekas
b7ccf10de7 [Cache] Improve resiliency when calling doFetch() in AbstractTrait 2018-06-20 13:05:06 +02:00
Nicolas Grekas
683bbf9eaf Merge branch '4.1'
* 4.1:
  [Cache] Fix exception handling in AbstractTrait::clear()
  Revert "minor #27649 [Cache] fix Memcached tests (nicolas-grekas)"
2018-06-20 11:26:44 +02:00
Nicolas Grekas
a278c79c6e Merge branch '4.0' into 4.1
* 4.0:
  [Cache] Fix exception handling in AbstractTrait::clear()
  Revert "minor #27649 [Cache] fix Memcached tests (nicolas-grekas)"
2018-06-20 11:26:39 +02:00
Nicolas Grekas
6d26d9a5ae Merge branch '3.4' into 4.0
* 3.4:
  [Cache] Fix exception handling in AbstractTrait::clear()
  Revert "minor #27649 [Cache] fix Memcached tests (nicolas-grekas)"
2018-06-20 11:26:33 +02:00
Massimiliano Braglia
d6b6e9658c [Messenger] Fixed MessengerPass::guessHandledClasses return type 2018-06-20 12:25:27 +03:00
Nicolas Grekas
bef15cebca [Cache] Fix exception handling in AbstractTrait::clear() 2018-06-20 11:24:39 +02:00
Nicolas Grekas
bb644c1df8 Revert "minor #27649 [Cache] fix Memcached tests (nicolas-grekas)"
This reverts commit dc323f084c, reversing
changes made to 917b07a5c6.
2018-06-20 10:56:56 +02:00
Nicolas Grekas
2ff02cd333 [Cache] added support for phpredis 4 compression and tcp_keepalive options 2018-06-20 10:12:31 +02:00
Nicolas Grekas
d41385024f Merge branch '4.1'
* 4.1:
  [Cache] fix Memcached tests
2018-06-20 09:27:19 +02:00
Nicolas Grekas
f68e19468d Merge branch '4.0' into 4.1
* 4.0:
  [Cache] fix Memcached tests
2018-06-20 09:27:12 +02:00
Nicolas Grekas
9b64e8bedf Merge branch '3.4' into 4.0
* 3.4:
  [Cache] fix Memcached tests
2018-06-20 09:27:05 +02:00
Nicolas Grekas
dc323f084c minor #27649 [Cache] fix Memcached tests (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] fix Memcached tests

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

Clearing a memcached pool works only when versioning is enabled. Dunno why this has not be caught before, but it's making tests fail now.

Commits
-------

09ec9e7cce [Cache] fix Memcached tests
2018-06-20 09:26:50 +02:00
Nicolas Grekas
09ec9e7cce [Cache] fix Memcached tests 2018-06-20 09:02:04 +02:00
Nicolas Grekas
a5a91d318c Merge branch '4.1'
* 4.1:
  [HttpKernel] fix PHP 5.4 compat
  Fix surrogate not using original request
  [Finder] Update RealIteratorTestCase
  [Routing] remove unneeded dev dep on doctrine/common
  [minor] SCA
  [Validator] Remove BOM in some xlf files
  Ensure updateTimestamp returns a boolean
  Fix #27378: Error when rendering a DateIntervalType form with exactly 0 weeks
  [HttpKernel] fix session tracking in surrogate master requests
2018-06-19 23:38:29 +02:00
Nicolas Grekas
34acfe4bfb Merge branch '4.0' into 4.1
* 4.0:
  [HttpKernel] fix PHP 5.4 compat
  Fix surrogate not using original request
  [Finder] Update RealIteratorTestCase
  [Routing] remove unneeded dev dep on doctrine/common
  [minor] SCA
  [Validator] Remove BOM in some xlf files
  Fix #27378: Error when rendering a DateIntervalType form with exactly 0 weeks
  [HttpKernel] fix session tracking in surrogate master requests
2018-06-19 23:38:16 +02:00
Nicolas Grekas
b85f70e3bc Merge branch '3.4' into 4.0
* 3.4:
  [HttpKernel] fix PHP 5.4 compat
  Fix surrogate not using original request
  [Finder] Update RealIteratorTestCase
  [Routing] remove unneeded dev dep on doctrine/common
  [minor] SCA
  [Validator] Remove BOM in some xlf files
  Fix #27378: Error when rendering a DateIntervalType form with exactly 0 weeks
  [HttpKernel] fix session tracking in surrogate master requests
2018-06-19 22:54:48 +02:00
Nicolas Grekas
917b07a5c6 Merge branch '2.8' into 3.4
* 2.8:
  [HttpKernel] fix PHP 5.4 compat
  Fix surrogate not using original request
  [Finder] Update RealIteratorTestCase
  [Routing] remove unneeded dev dep on doctrine/common
  [Validator] Remove BOM in some xlf files
2018-06-19 22:52:10 +02:00
Nicolas Grekas
0f2b752138 [HttpKernel] fix PHP 5.4 compat 2018-06-19 22:37:28 +02:00
Nicolas Grekas
a4f5c6e2b6 minor #27643 [FrameworkBundle] Fixed tests added in #27611 (HeahDude)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[FrameworkBundle] Fixed tests added in #27611

| Q             | A
| ------------- | ---
| Branch?       | master
| 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 | ~
| 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.
-->

Commits
-------

be97006c57 [FrameworkBundle] Fixed tests added in #27611
2018-06-19 22:33:37 +02:00
Jules Pietri
be97006c57 [FrameworkBundle] Fixed tests added in #27611 2018-06-19 19:13:47 +02:00
Colin O'Dell
53048cec6d Log potential redirect loops caused by forced HTTPS
If the developer forgets/fails to set "trusted_proxies" properly, forcing the
https channel can cause infinite redirect loops. This change will hopefully
help them identify the problem faster.

See https://github.com/symfony/symfony/issues/27603
2018-06-19 10:59:18 -04:00
David Herrmann
e336ebeecf Fixing GlobResource when inside phar archive
When packaging an Sf4 application as a PHAR archive using globs at various locations (`Kernel`, `services.yaml`) most glob files are not found because the `glob()` PHP method [does not support PHAR streams](https://stackoverflow.com/questions/8203188/unexpected-problems-with-php-phar).

Using the regex fallback instead when operating inside PHAR archives fixes the behavior for me.
2018-06-19 16:02:58 +02:00
Nicolas Grekas
c4d972ac20 bug #27382 [Form] Fix error when rendering a DateIntervalType form with exactly 0 weeks (krixon)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Fix error when rendering a DateIntervalType form with exactly 0 weeks

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

Fixes the issue described in #27378

Commits
-------

dae704ad2f Fix #27378: Error when rendering a DateIntervalType form with exactly 0 weeks
2018-06-19 15:17:38 +02:00
Nicolas Grekas
4fde3bb4f3 feature #27421 CacheWarmerAggregate handle deprecations logs (ScullWM)
This PR was merged into the 4.2-dev branch.

Discussion
----------

CacheWarmerAggregate handle deprecations logs

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #27387
| License       | MIT

Actually the Web Debug Toolbar warning you about the deprecation messages thrown during the container built (#21502).
Cache warmup can throw deprecated message without any persistance, it may cause issue like #27387
This PR reproduce the same job for the cache warmer, and so on, handle deprecated messages during the warmup of Twig, Translator, Validator, Security and all `kernel.cache_warmer` services.

Here are the point that may be improvable in this PR:

1.  Actually I've "duplicate" the callable used in the `set_error_handler` of the Kernel.
IMHO I think that Kernel and CacheWarmerAggregate have differents jobs and a trait may be a good solution to share this error handler setter without duplicating the code, but I'm a little bit lost about the repercussion of adding a Trait in the Kernel.

2. I've think about extending the `CacheWarmerAggregate` into a `DeprecatedLogHandlingCacheWarmerAggregate` to add the debug and containerClass argument, and declare it as the `cache_warmer` service only in debug mode (by declaring it in the DebugBundle/Resources/config/services.xml).

Commits
-------

f03b8bba9d CacheWarmerAggregate handle deprecations logs
2018-06-19 15:15:00 +02:00
Nicolas Grekas
3fc2200134 bug #27309 Fix surrogate not using original request (Toflar)
This PR was submitted for the 3.4 branch but it was squashed and merged into the 2.8 branch instead (closes #27309).

Discussion
----------

Fix surrogate not using original request

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

Warning: This might need some close attention. It took me hours to wrap my head around that issue :-)

So the problem is that `HttpCache::forward()` (or essentially any part in your application) can modify the `$request` that is passed to the `HttpCache::handle()` and the surrogate can never access the original request using `HttpCache::getRequest()` anymore.

Example:

* Main request (GET `/foobar`)
* It's not in the cache, so `HttpCache::forward()` modifies `REMOTE_ADDR` to `127.0.0.1` and adds the `X-Forwarded-For` header.
* The request is sent to the application and any e.g. `kernel.request` listener might modify the `$request` further.
* Now the `/foobar` route returns `text/html` that contains some `<esi src="=/fragment_path"` tag.
* `HttpCache` has an instance of `SurrogateInterface` so (in our case `Esi`) will be asked to `process()` and then later on `handle()` the `/fragment_path` request. For that, `Esi` (or in fact `AbstractSurrogate` uses the following line to create a subrequest and pass it on to the application again:

```php
$subRequest = Request::create($uri, Request::METHOD_GET, array(), $cache->getRequest()->cookies->all(), array(), $cache->getRequest()->server->all());
```

What you can see here, is that it uses `$cache->getRequest()`. And here follows the problem:
We did not duplicate (clone) the original request so essentially `$cache->getRequest()` is a reference to the current request that `HttpKernel::forward()` modified and probably any other part of the application did so too. So for example the original `REMOTE_ADDR` (client IP) got lost.

What we should do instead is duplicate the original request so the surrogates can actually behave like a real reverse proxy such as Varnish would by keeping all the original request attributes.

Commits
-------

ab86f43d78 Fix surrogate not using original request
2018-06-19 15:13:23 +02:00
Yanick Witschi
ab86f43d78 Fix surrogate not using original request 2018-06-19 15:13:16 +02:00
Nicolas Grekas
e9e6ec54af feature #27611 [FrameworkBundle][SecurityBundle] Moved security expression providers pass logic to SecurityBundle (HeahDude)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[FrameworkBundle][SecurityBundle] Moved security expression providers pass logic to SecurityBundle

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

Commits
-------

a8017be6ae [FrameworkBundle][SecurityBundle] Moved security expression providers pass logic to SecurityBundle
2018-06-19 15:04:04 +02:00
Jules Pietri
a8017be6ae [FrameworkBundle][SecurityBundle] Moved security expression providers pass logic to SecurityBundle 2018-06-19 15:02:06 +02:00
Nicolas Grekas
76d3589a44 feature #27277 [OptionsResolver] Introduce ability to deprecate options, allowed types and values (yceruto)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[OptionsResolver] Introduce ability to deprecate options, allowed types and values

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

**Deprecating an option**
```php
$resolver = (new OptionsResolver())
    ->setDefined(['foo', 'bar'])
    ->setDeprecated('foo')
;
$resolver->resolve(['foo' => 'baz']); // PHP Deprecated: The option "foo" is deprecated.
```
With custom message:
```php
$resolver = (new OptionsResolver())
    ->setDefined('foo')
    ->setDefault('bar', function (Options $options) {
        return $options['foo'];
    })
    ->setDeprecated('foo', 'The option "foo" is deprecated, use "bar" option instead.')
;
$resolver->resolve(['foo' => 'baz']); // PHP Deprecated: The option "foo" is deprecated, use "bar" option instead.
$resolver->resolve(['bar' => 'baz']); // OK.
```
**Deprecating allowed types**
```php
$resolver = (new OptionsResolver())
    ->setDefault('type', null)
    ->setAllowedTypes('type', ['null', 'string', FormTypeInterface::class])
    ->setDeprecated('type', function ($value) {
        if ($value instanceof FormTypeInterface) {
            return sprintf('Passing an instance of "%s" to option "type" is deprecated, pass its FQCN instead.', FormTypeInterface::class);
        }
    })
;
$resolver->resolve(['type' => new ChoiceType()]); // PHP Deprecated: Passing an instance of "Symfony\Component\Form\FormTypeInterface" to option "type" is deprecated, pass its FQCN instead.
$resolver->resolve(['type' => ChoiceType::class]); // OK.
```
The closure is invoked when `resolve()` is called. The closure must return a string (the deprecation message) or an empty string to ignore the option deprecation.

Multiple types and normalizer:
```php
$resolver = (new OptionsResolver())
    ->setDefault('percent', 0.0)
    ->setAllowedTypes('percent', ['null', 'int', 'float'])
    ->setDeprecated('percent', function ($value) {
        if (null === $value) {
            return 'Passing "null" to option "percent" is deprecated, pass a float number instead.';
        }

        if (is_int($value)) {
            return sprintf('Passing an integer "%d" to option "percent" is deprecated, pass a float number instead.', $value);
        }
    })
    ->setNormalizer('percent', function (Options $options, $value) {
        return (float) $value;
    })
;
$resolver->resolve(['percent' => null]); // PHP Deprecated: Passing "null" to option "percent" is deprecated, pass a float number instead.
$resolver->resolve(['percent' => 20]); // PHP Deprecated: Passing an integer "20" to option "percent" is deprecated, pass a float number instead.
$resolver->resolve(['percent' => 20.0]); // OK.
```
The parameter passed to the closure is the value of the option after validating it and before normalizing it.

**Deprecating allowed values**
```php
$resolver = (new OptionsResolver())
    ->setDefault('percent', 0.0)
    ->setAllowedTypes('percent', 'float')
    ->setDeprecated('percent', function ($value) {
        if ($value < 0) {
            return 'Passing a number less than 0 to option "percent" is deprecated.';
        }
    })
;
$resolver->resolve(['percent' => -50.0]); // PHP Deprecated: Passing a number less than 0 to option "percent" is deprecated.
```

Commits
-------

f8746ce8bd Add ability to deprecate options
2018-06-19 14:56:30 +02:00
Nicolas Grekas
d148fa708a feature #26919 [TwigBridge] Added bundle name suggestion on wrongly overrided templates paths (pmontoya, Pascal Montoya)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[TwigBridge] Added bundle name suggestion on wrongly overrided templates paths

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

Report unknown folders in templates/bundles in debug:twig and make suggestions if any

Developped with @bricejulia

Commits
-------

acfb325a35 refs #26898 Remove unnecessary loop Trim messages on build rather than on display
da42b3e23c refs #26898 Check if projectDir is not null before loop
da0c589385 refs #26898 Move changelog entry to 4.1.0 to 4.2.0
7d9467a319 Add an entry on json export format
bab9d99032 Use %twig.default_path% parameter and search in old folder structure too
1758de24a5 [TwigBridge] Added bundle name suggestion on wrongly overrided templates paths
2018-06-19 14:50:24 +02:00
Nicolas Grekas
18026dcc83 bug #27467 [HttpKernel] fix session tracking in surrogate master requests (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] fix session tracking in surrogate master requests

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

Spotted while looking at ESI fragments resolved by`HttpCache`: right now when the master request starts the session, fragments are not cacheable anymore, even when they do not use the session.

Commits
-------

146e01cb44 [HttpKernel] fix session tracking in surrogate master requests
2018-06-19 13:58:43 +02:00
Michael Moravec
b0fa398187
Remove direct dependencies on doctrine/common 2018-06-19 13:41:48 +02:00
Nicolas Grekas
f065873881 feature #26486 [HttpFoundation] Adds getAcceptableFormats() method for Request (AndreiIgna)
This PR was squashed before being merged into the 4.2-dev branch (closes #26486).

Discussion
----------

[HttpFoundation] Adds getAcceptableFormats() method for Request

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #21909
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Adds a new method `getAcceptableFormats()` for `Request`. This reads the content types in Accept header and maps them to formats already defined in `Request` class

In a request made by a browser, based on the default Accept header, the `getAcceptableFormats()` will return an array `['html', 'xml']`

In progress
- [x] gather feedback for my changes
- [x] submit changes to the documentation

Commits
-------

8a127ea34a [HttpFoundation] Adds getAcceptableFormats() method for Request
2018-06-19 13:26:37 +02:00
Andrei Igna
8a127ea34a [HttpFoundation] Adds getAcceptableFormats() method for Request 2018-06-19 13:26:24 +02:00
Nicolas Grekas
9f1d1d82fb minor #27508 [Finder] Update RealIteratorTestCase (flip111)
This PR was submitted for the master branch but it was squashed and merged into the 2.8 branch instead (closes #27508).

Discussion
----------

[Finder] Update RealIteratorTestCase

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

Makes the entire test directory empty instead of trying to delete particular files and directories. The old method failed when trying to remove a directory which was not empty.

Commits
-------

7d0ebd41ab [Finder] Update RealIteratorTestCase
2018-06-19 13:07:17 +02:00
flip111
7d0ebd41ab [Finder] Update RealIteratorTestCase 2018-06-19 13:04:56 +02:00
Nicolas Grekas
6c03064cb6 feature #27535 [TwigBundle] Enhance the twig not found exception (behnoushnorouzi)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[TwigBundle] Enhance the twig not found exception

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

Improve error message to make it clear to developers what mistake they have made.

Commits
-------

32988b4294 Enhance the twig not found exception
2018-06-19 12:58:50 +02:00
Nicolas Grekas
c6948044c7 feature #27551 [FrameworkBundle] show public/private for aliases in debug:container command (OskarStark)
This PR was merged into the 4.2-dev branch.

Discussion
----------

[FrameworkBundle] show public/private for aliases in debug:container command

| Q             | A
| ------------- | ---
| Branch?       |  master
| Bug fix?      | no
| New feature?  | yes <!-- 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        | not needed <!-- required for new features -->

It could be helpful to see the public/private status for aliases in `debug:container` command.

Otherwise you need to dive into the code to get the information, because the result only shows the options of the aliased service.

## Look & Feel for public alias
![screenshot 2018-06-08 09 25 50](https://user-images.githubusercontent.com/995707/41144664-f3b50766-6afd-11e8-92d0-ca30513a1afc.png)

_text has slightly changed_

## Look & Feel for private alias
![screenshot 2018-06-08 09 23 31](https://user-images.githubusercontent.com/995707/41144593-b354aad2-6afd-11e8-8ab1-f9196e567f67.png)

_text has slightly changed_

//cc @nicolas-grekas

Commits
-------

1df7742345 [FrameworkBundle] show public/private for aliases in debug:container command
2018-06-19 12:57:50 +02:00
Nicolas Grekas
ec6b941738 [Routing] remove unneeded dev dep on doctrine/common 2018-06-19 11:52:17 +02:00