Commit Graph

32896 Commits

Author SHA1 Message Date
Fabien Potencier
8c35d91e7d feature #21751 Bootstrap4 support for Twig form theme (hiddewie, javiereguiluz)
This PR was merged into the 3.4 branch.

Discussion
----------

Bootstrap4 support for Twig form theme

**This PR is a followup from #19648. That PR was closed because GitHub thought my branch contained no commits after a force push...**

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

I have made a port of the Twig form theming code for Bootstrap 3 to the α-5 version of Bootstrap 4.
- The (inheritance) structure of the form theming files has changed because a number of blocks are the same between BS 3 and 4. They have been migrated to `bootstrap_base_layout.html.twig`.
  The new tree is as follows:

```
bootstrap_base_layout.html.twig
|-- bootstrap_3_layout.html.twig
|   `-- bootstrap_3_horizontal_layout.html.twig
`-- bootstrap_4_layout.html.twig
    `-- bootstrap_4_horizontal_layout.html.twig
```
- Any occurances of `.form-horizontal` have been removed from the BS 4 code.
- Checkboxes and radio buttons have been stacked using the `.form-check`, `.form-check-label` and `.form-check-input` classes. There is now no distinction between checkboxes and radio buttons in the markdown.
- All layout tests have been added and updated for BS4. The inheritance tree is as follows:

```
AbstractLayoutTest
`-- AbstractBootstrap3LayoutTest
    |-- AbstractBootstrap3HorizontalLayoutTest
    `-- AbstractBootstrap4LayoutTest
        `-- AbstractBootstrap4HorizontalLayoutTest
```

All tests pass. The classes `FormExtensionBootstrap4LayoutTest` and `FormExtensionBootstrap4HorizontalLayoutTest` have been created similarly to the BS 3 versions.
- ~~The label coloring on an validation is not correct. I've made an issue (twbs/bootstrap#20535) of the problem.~~
- No [custom form elements](http://v4-alpha.getbootstrap.com/components/forms/#custom-forms) have been used.
- A docs PR can be created if this PR is accepted.
- The new code might have to be updated if large changes occur in the BS 4 α.

Screenshot of BS3 and 4 comparison for the same form:

![1](https://cloud.githubusercontent.com/assets/1073881/17732594/dfcb50d6-6472-11e6-8e96-c46987809322.PNG)

Commits
-------

f12e5887ff Removed unneeded wrapping quotes around a Twig key
709f134dc8 Removed unneeded wrapping quotes around a Twig key
4222d54a53 Initial commit for Bootstrap 4 form theme, based on Bootstrap 3 form theme
2017-10-01 10:10:24 -07:00
Fabien Potencier
4f89386b74 feature #24383 [FrameworkBundle] Don't clear app pools on cache:clear (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] Don't clear app pools on cache:clear

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

The cache:clear command currently clears all cache pools by default.
This is not expected and is a bad default behavior (as explained in linked issue).
If we don't want to have that behavior forever, I see no other option than just doing the change, as done here, targeting 3.4.

Commits
-------

b0c04f8354 [FrameworkBundle] Don't clear app pools on cache:clear
2017-10-01 09:49:04 -07:00
Nicolas Grekas
b0c04f8354 [FrameworkBundle] Don't clear app pools on cache:clear 2017-09-30 20:17:55 +02:00
Fabien Potencier
0c6eca34f6 feature #24148 [Form] Hide label button when its setted to false (TeLiXj)
This PR was submitted for the 2.7 branch but it was merged into the 3.4 branch instead (closes #24148).

Discussion
----------

[Form] Hide label button when its setted to false

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

Added same behaviour in buttons like in other form components when label is setted to false, don't show it.
It's very useful with buttons with icon and without text.

Commits
-------

e3190755cf Hide label button when its setted to false
2017-09-30 07:30:11 -07:00
TeLiXj
e3190755cf Hide label button when its setted to false
Added same behaviour in buttons like in other form components when label is setted to false, don't show it. It's very useful with buttons with icon and without text
2017-09-30 07:30:11 -07:00
Fabien Potencier
f73d8d26b0 bug #24157 [Intl] Fixed support of Locale::getFallback (lyrixx)
This PR was merged into the 2.7 branch.

Discussion
----------

[Intl] Fixed support of Locale::getFallback

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

Commits
-------

256055218e [Intl] Fixed support of Locale::getFallback
2017-09-30 07:22:16 -07:00
Fabien Potencier
166f64efb1 bug #24198 [HttpFoundation] Fix file upload multiple with no files (enumag)
This PR was merged into the 2.7 branch.

Discussion
----------

[HttpFoundation] Fix file upload multiple with no files

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

```php
<form method="post" enctype="multipart/form-data">
<input type="file" multiple name="img[]">
<input type="submit">
</form>

<?php

$loader = require __DIR__ . '/../app/autoload.php';

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $request = \Symfony\Component\HttpFoundation\Request::createFromGlobals();
    var_export($request->files->all()['img']);
}
```

Expected result when I send the form without any files:

```
array ()
```

Actual result:

```
array ( 0 => NULL, )
```

This causes a problem later when using FileType with multiple option - if no files are sent the form data are `[0 => '']` instead of `[]`.

Of course I need to add a test for this.

Commits
-------

d4f6039dcd [HttpFoundation] Fix file upload multiple with no files
2017-09-30 07:18:14 -07:00
Fabien Potencier
72cc5df5fc minor #24342 removed useless PHPDoc (OskarStark)
This PR was squashed before being merged into the 2.7 branch (closes #24342).

Discussion
----------

removed useless PHPDoc

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        | n/a

Commits
-------

5ee9043d8b removed useless PHPDoc
2017-09-30 07:00:25 -07:00
Oskar Stark
5ee9043d8b removed useless PHPDoc 2017-09-30 07:00:23 -07:00
Fabien Potencier
77998813fe minor #24374 [HttpFoundation] Return instance in StreamedResponse (abellion)
This PR was squashed before being merged into the 3.4 branch (closes #24374).

Discussion
----------

[HttpFoundation] Return instance in StreamedResponse

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

<!--
- 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 3.4,
  legacy code removals go to the master branch.
- Please fill in this template according to the PR you're about to submit.
- Replace this comment by a description of what your PR is solving.
-->

Commits
-------

2080582a75 [HttpFoundation] Return instance in StreamedResponse
2017-09-30 06:57:21 -07:00
Antoine Bellion
2080582a75 [HttpFoundation] Return instance in StreamedResponse 2017-09-30 06:57:19 -07:00
Fabien Potencier
f6d001e5fe bug #24379 [PHPUnitBridge] don't remove when set to empty string (Simperfit)
This PR was merged into the 3.3 branch.

Discussion
----------

[PHPUnitBridge] don't remove when set to  empty string

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

Fix a bug when passing empty string symfony/yaml and phpspec/prophecy

Commits
-------

722872f4c4 [PHPUnitBridge] don't remove when set to  empty string
2017-09-30 06:53:22 -07:00
Fabien Potencier
fbbab43506 minor #24384 [Form] Fix FormInterface::submit() annotation (enumag)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Fix FormInterface::submit() annotation

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

`null|string|array` does not cover all possible values. For example for UploadType it is an instance of UploadedFile.

Commits
-------

c6c09e4f28 [Form] Fix FormInterface::submit() annotation
2017-09-30 06:49:47 -07:00
Fabien Potencier
cd91b8f120 minor #24385 [FrameworkBundle] Register a NullLogger from test kernels (ogizanagi)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] Register a NullLogger from test kernels

| Q             | A
| ------------- | ---
| Branch?       | 3.4 <!-- see comment below -->
| Bug fix?      | no
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | N/A <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

Relates to #24300

This will avoid unnecessary output on Travis or when running FrameworkBundle tests locally:
- before: https://travis-ci.org/symfony/symfony/jobs/281624658#L3594-L3635
- after: https://travis-ci.org/symfony/symfony/jobs/281643868#L3599-L3617

but also needed for anyone running functional tests on their project and using the default logger, in order to not get garbage output.

Do we need to find a more generic solution (like exposing a `framework.default_logger` option so users can set it to false for test)? Or just documenting this?

Commits
-------

c109dcd5ae [FrameworkBundle] Register a NullLogger from test kernels
2017-09-30 06:45:16 -07:00
Fabien Potencier
a2ae9a4ff8 feature #24378 [SecurityBundle] Deprecate auto picking the first provider (ogizanagi)
This PR was merged into the 3.4 branch.

Discussion
----------

[SecurityBundle] Deprecate auto picking the first provider

when no provider is explicitly configured on a firewall

| Q             | A
| ------------- | ---
| Branch?       | 3.4 <!-- see comment below -->
| Bug fix?      | no
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | yes <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | https://symfony-devs.slack.com/archives/C3A2XAQ20/p1506626210000345 <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

From @Pierstoval on Slack:

> Hey, guys, I learnt a few days ago that if you don't specify a user provider in a firewall configuration, the security will use the first one in the list. Don't anyone think specifying the user provider should be mandatory ? Or at least mandatory if we have more than one provider registered?

- [x] UPGRADE files
- [x] CHANGELOG
- [x] Fix other tests
- [x] Removal PR #24380

Commits
-------

2d1e3347a6 [SecurityBundle] Deprecate auto picking the first provider
2017-09-30 06:42:59 -07:00
Fabien Potencier
b1e2d21213 feature #24260 [Security] Add impersonation support for stateless authentication (chalasr)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security] Add impersonation support for stateless authentication

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/lafourchette/SwitchUserStatelessBundle/issues/10#issuecomment-330434589
| License       | MIT
| Doc PR        | n/a

The `switch_user` listener triggers a redirection in case of success and thus does not play well with stateless authentication which is common nowadays (as opposed to other listeners like the [exception one](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php#L187..#L189)).
This adds a new `stateless` option to the `switch_user` listener, if set to true then no redirection is triggered during user switching.

This will avoid the need for [lafourchette/SwitchUserStatelessBundle](https://github.com/lafourchette/SwitchUserStatelessBundle) which just duplicated the symfony SwitchUserListener (with config factory) at a given state to avoid the 2 LOC which are causing the redirection.
The bundle is not actively maintained and the listener it provides is out of date due to the missing upstream additions and bug fixes (see https://github.com/lafourchette/SwitchUserStatelessBundle/issues/10).

Commits
-------

e7a5803e2e [Security] Add user impersonation support for stateless authentication
2017-09-30 06:39:03 -07:00
Maxime Steinhausser
c109dcd5ae [FrameworkBundle] Register a NullLogger from test kernels 2017-09-30 14:58:47 +02:00
Maxime Steinhausser
2d1e3347a6 [SecurityBundle] Deprecate auto picking the first provider
when no provider is explicitly configured on a firewall
2017-09-30 13:21:25 +02:00
Robin Chalas
e7a5803e2e [Security] Add user impersonation support for stateless authentication 2017-09-30 13:13:18 +02:00
Jáchym Toušek
c6c09e4f28 [Form] Fix FormInterface::submit() annotation 2017-09-29 22:09:03 +02:00
Amrouche Hamza
722872f4c4
[PHPUnitBridge] don't remove when set to empty string 2017-09-29 20:45:30 +02:00
Fabien Potencier
09afa64909 feature #24300 [HttpKernel][FrameworkBundle] Add a minimalist default PSR-3 logger (dunglas)
This PR was squashed before being merged into the 3.4 branch (closes #24300).

Discussion
----------

[HttpKernel][FrameworkBundle] Add a minimalist default PSR-3 logger

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | yes <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

This PR provides a minimalist PSR-3 logger that is always available when FrameworkBundle is installed.
By default, it writes errors on `stderr`, regular logs on `stdout` and discards debug data (this is configurable).

This approach has several benefits:

- It's what expect from an app logging systems of major containerization and orchestration tools including [Docker](https://docs.docker.com/engine/admin/logging/view_container_logs/) and [Kubernetes](https://kubernetes.io/docs/concepts/cluster-administration/logging/), as well as most cloud providers such as [Heroku](https://devcenter.heroku.com/articles/logging#writing-to-your-log) and [Google Container Engine](https://kubernetes.io/docs/tasks/debug-application-cluster/logging-stackdriver/). If the app follows this standard (and it's not currently the case with Symfony by default) logs will be automatically collected, aggregated and stored.
- It's in sync with the "back to Unix roots" philosophy of Flex
- Logs are directly displayed in the console when running the integrated PHP web server (`bin/console server:start` or Flex's `make serve`), Create React App also do that for instance.
- It fixes a common problem when installing Flex recipes: many bundles expect a logger service but currently there is none available by default, and you usually get a `"logger" service not found error` (because packages depend of the PSR, but the PSR doesn't provide a logger service).

Commits
-------

9a06513ec7 [HttpKernel][FrameworkBundle] Add a minimalist default PSR-3 logger
2017-09-29 10:02:07 -07:00
Kévin Dunglas
9a06513ec7 [HttpKernel][FrameworkBundle] Add a minimalist default PSR-3 logger 2017-09-29 09:59:44 -07:00
Fabien Potencier
59c272b312 bug #24036 [Form] Fix precision of MoneyToLocalizedStringTransformer's divisions and multiplications (Rubinum)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Fix precision of MoneyToLocalizedStringTransformer's divisions and multiplications

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

There is a [PHP Bug](https://bugs.php.net/bug.php?id=75004) with the accuracy of divisions and multiplications when `/=` and `*=` are used.
Here is the proof: https://3v4l.org/u1DkX
It would be better to use `bcmul()` and `bcdiv()` in the `MoneyToLocalizedStringTransformer.php` to prevent this bug.

Commits
-------

ab47c7878e Added improvement for accuracy in MoneyToLocalizedStringTransformer.
2017-09-29 09:36:28 -07:00
Fabien Potencier
1b300985ff feature #21604 [Security] Argon2i Password Encoder (zanbaldwin)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security] Argon2i Password Encoder

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

Since the [libsodium RFC](https://wiki.php.net/rfc/libsodium) passed with flying colours, I'd like to kick start a discussion about adding Argon2i as a password encoder to the security component. The initial code proposal in this PR supports both the upcoming public API confirmed for PHP 7.2, and the [libsodium PECL extension](https://pecl.php.net/package/libsodium) for those below 7.2 (available for PHP 5.4+).

#### Concerns

- Should the test cover hash length? At the moment the result of Argon2i is 96 characters, but because the hashing parameters are included in the result (`$argon2i$v=19$m=32768,t=4,p=1$...`) this is not guaranteed.
- I've used one password encoder class because the result *should* be the same whether running natively in 7.2 or from the PECL extension, but should the logic be split out into separate private methods (like `Argon2iPasswordEncoder::encodePassword()`) or not (like in `Argon2iPasswordEncoder::isPasswordValid()`)? Since I can't really find anything concrete on Symfony choosing one way over another I'm assuming it's down to personal preference?

#### The Future

Whilst the libsodium RFC has been approved and the public API confirmed, there has been no confirmation of Argon2i becoming an official algorithm for `passhword_hash()`. If that is confirmed, then the implementation should *absolutely* use the native `password_*` functions since the `sodium_*` functions do not have an equivalent to the `password_needs_rehash()` function.

Any feedback would be greatly appreciated 😃

Commits
-------

be093dd79a Argon2i Password Encoder
2017-09-29 07:04:03 -07:00
Fabien Potencier
d2d9274823 minor #24373 [FrameworkBundle] Use PhpExtractor from Translation (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] Use PhpExtractor from Translation

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

The FrameworkBundle's one is legacy, so triggers a deprecation notice.

Commits
-------

3d19fd9837 [FrameworkBundle] Use PhpExtractor from Translation
2017-09-29 07:01:06 -07:00
Fabien Potencier
c10baf9e9f feature #24372 [DowCrawler] Default to UTF-8 when possible (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DowCrawler] Default to UTF-8 when possible

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

This can't be ambiguous, let's use UTF-8 when possible.

Commits
-------

73eda66b99 [DowCrawler] Default to UTF-8 when possible
2017-09-29 06:59:44 -07:00
Zan Baldwin
be093dd79a Argon2i Password Encoder
Add the Argon2i hashing algorithm provided by libsodium as a core encoder in the Security component, and enable it in the SecurityBundle.
Credit to @chalasr for help with unit tests.
2017-09-29 14:21:29 +01:00
Maxime Steinhausser
260d2f02d8 [DI] EnvVarProcessorInterface: fix missing use 2017-09-29 13:52:29 +02:00
Nicolas Grekas
3d19fd9837 [FrameworkBundle] Use PhpExtractor from Translation 2017-09-29 13:28:23 +02:00
Christian Flothmann
ee545bf8d4 Merge branch '3.3' into 3.4
* 3.3:
  include file and line number in deprecation
  parse merge keys with PARSE_OBJECT_FOR_MAP flag
2017-09-29 13:19:35 +02:00
Nicolas Grekas
15a2e5b091 fix test 2017-09-29 13:13:44 +02:00
Nicolas Grekas
3392f9f32d Fix conflicts between Bridge/PhpUnit and Debug fixtures 2017-09-29 12:59:58 +02:00
Nicolas Grekas
ace6464d5c minor #24371 [DI] Fix TypeHint of ParametersConfigurator::set() (smoench)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Fix TypeHint of ParametersConfigurator::set()

| Q             | A
| ------------- | ---
| Branch?       | 3.4  <!-- see comment below -->
| Bug fix?      | yes
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        | <!--highly recommended for new features-->

Use TypeHint of `Symfony\Component\DependencyInjection\Loader\ConfiguratorAbstractConfigurator::processValue` instead of `string`

Commits
-------

1c0701a [DI] Fix typehint
2017-09-29 12:25:16 +02:00
Nicolas Grekas
73eda66b99 [DowCrawler] Default to UTF-8 when possible 2017-09-29 12:22:06 +02:00
Simon Mönch
1c0701ab85 [DI] Fix typehint 2017-09-29 12:03:48 +02:00
Nicolas Grekas
006380034e bug #24191 [DependencyInjection] include file and line number in deprecation (xabbuh)
This PR was merged into the 3.3 branch.

Discussion
----------

[DependencyInjection] include file and line number in deprecation

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

In #23108 we removed line numbers from deprecation messages created by the YAML parser because those numbers were quite useless without the file being parsed. I suggest to revert this change and add the file being parsed to the deprecation message.

Commits
-------

cf03552 include file and line number in deprecation
2017-09-29 11:52:28 +02:00
Nicolas Grekas
ad449ef551 minor #24369 [PhpUnitBridge] Make CoverageListenerTest more robust when xdebug is not available (lyrixx)
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnitBridge] Make CoverageListenerTest more robust when xdebug is not available

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

Commits
-------

9fac290 [PhpUnitBridge] Make CoverageListenerTest more robust when xdebug is not available
2017-09-29 11:48:51 +02:00
Nicolas Grekas
f18a47bef7 doc fixes 2017-09-29 11:41:38 +02:00
Grégoire Pineau
9fac290b41 [PhpUnitBridge] Make CoverageListenerTest more robust when xdebug is not available 2017-09-29 11:30:13 +02:00
Fabien Potencier
5bbec9c722 bug #24367 PdoSessionHandler: fix advisory lock for pgsql (Tobion)
This PR was merged into the 2.7 branch.

Discussion
----------

PdoSessionHandler: fix advisory lock for pgsql

when session.sid_bits per_character > 4 the session id can contain non-hex-characters which will be ignored by hexdec. this can potentially result in collisions on the lock key from different sessions, e.g. the session ids `aagh` and `aaij` would have the same pgsql lock because `hexdec('aagh') === hexdec('aaij')`

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | #24095
| License       | MIT
| Doc PR        |

Commits
-------

0f0a6e85e3 PdoSessionHandler: fix advisory lock for pgsql when session.sid_bits_per_character > 4
2017-09-28 17:54:35 -07:00
Fabien Potencier
2e2f02cd36 feature #24264 [TwigBundle] Improve the overriding of bundle templates (yceruto)
This PR was merged into the 3.4 branch.

Discussion
----------

[TwigBundle] Improve the overriding of bundle templates

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

### [Overriding a Template that also extends itself](https://twig.symfony.com/doc/2.x/recipes.html#overriding-a-template-that-also-extends-itself)

Now that bundles inheritance is deprecated and removed (#24160, #24161), I'm wondering if we can solve this old issue defining an exclusive namespace only for root bundles in `3.4` just bundles in `4.0`:
```yaml
twig:
    paths:
        # adding paths behind the scene into TwigExtension
        app/Resources/FooBundle/views: Foo
        vendor/acme/foo-bundle/Resources/views: Foo
        vendor/acme/foo-bundle/Resources/views: !Foo # exclusive
```
Thus, one can decide when use the exclusive namespace to avoid the issue and then [we could to say also](http://symfony.com/doc/current/templating/overriding.html):

> To override the bundle template partially (which contains `block`) creates a new `index.html.twig` template in `app/Resources/AcmeBlogBundle/views/Blog/index.html.twig` and extends from `@!AcmeBlogBundle/Blog/index.html.twig` to customize the bundle template:

```twig
{# app/Resources/FooBundle/views/layout.html.twig #}

{# this does not work: circular reference to itself #}
{% extends '@Foo/layout.html.twig' %}

{# this will work: load bundle layout template #}
{% extends '@!Foo/layout.html.twig' %}

{% block title 'New title' %}
```
I hear other suggestions about the excluse namespace.

We will need to update http://symfony.com/doc/current/templating.html#referencing-templates-in-a-bundle too to add this convention.

WDYT?

Commits
-------

0a658c6eef Add exclusive Twig namespace for bundles path
2017-09-28 17:47:42 -07:00
Fabien Potencier
2c5e2a23ce feature #24197 [Translation] Moved PhpExtractor and PhpStringTokenParser to Translation component (Nyholm)
This PR was merged into the 3.4 branch.

Discussion
----------

[Translation] 	Moved PhpExtractor and PhpStringTokenParser to Translation component

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

Extraction of translations keys does not really belong to the framework bundle. It is related to the translation component.

Commits
-------

eca2f8e587 Moved PhpExtractor and PhpStringTokenParser to Translation component
2017-09-28 16:48:56 -07:00
Tobias Nyholm
eca2f8e587 Moved PhpExtractor and PhpStringTokenParser to Translation component 2017-09-29 01:37:07 +02:00
Fabien Potencier
a442e378e1 feature #24362 [HttpKernel] Deprecate some compiler passes in favor of tagged iterator args (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] Deprecate some compiler passes in favor of tagged iterator args

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

More code that we can drop :)

Commits
-------

fa62e5068e [HttpKernel] Deprecate some compiler passes in favor of tagged iterator args
2017-09-28 16:21:02 -07:00
Fabien Potencier
537c496dfe minor #24366 [Lock] Use cache connection factories in lock (jderusse)
This PR was merged into the 3.4 branch.

Discussion
----------

[Lock] Use cache connection factories in lock

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

An alternative to https://github.com/symfony/symfony/pull/24267 to share code between cache and lock.

Commits
-------

95358ac98f Share connection factories between cache and lock
2017-09-28 16:19:46 -07:00
Fabien Potencier
29433fa977 bug #24189 [Yaml] parse merge keys with PARSE_OBJECT_FOR_MAP flag (xabbuh)
This PR was merged into the 3.3 branch.

Discussion
----------

[Yaml] parse merge keys with PARSE_OBJECT_FOR_MAP flag

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

Commits
-------

534eaed7ae parse merge keys with PARSE_OBJECT_FOR_MAP flag
2017-09-28 16:05:04 -07:00
Fabien Potencier
c7f664c5e0 feature #21027 [Asset] Provide default context (ro0NL)
This PR was squashed before being merged into the 3.4 branch (closes #21027).

Discussion
----------

[Asset] Provide default context

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #19396
| License       | MIT
| Doc PR        | should be noted somewhere, ill create an issue

Allows configuring the default asset context to make things works on CLI for example. Same approach as the routing component.

Introduces
```yaml
# parameters.yml
asset.request_context.base_path: '/base/path'
asset.request_context.secure: false
```

Commits
-------

9137d57ecd [Asset] Provide default context
2017-09-28 15:56:48 -07:00
Roland Franssen
9137d57ecd [Asset] Provide default context 2017-09-28 15:56:45 -07:00
Nicolas Grekas
fa62e5068e [HttpKernel] Deprecate some compiler passes in favor of tagged iterator args 2017-09-29 00:01:08 +02:00