Commit Graph

33054 Commits

Author SHA1 Message Date
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
Yonel Ceruto 0a658c6eef Add exclusive Twig namespace for bundles path 2017-09-28 14:36:07 -04:00
Tobias Schultze 0f0a6e85e3 PdoSessionHandler: fix advisory lock for pgsql when session.sid_bits_per_character > 4 2017-09-28 20:22:10 +02:00
Jérémy Derussé 95358ac98f
Share connection factories between cache and lock 2017-09-28 19:35:07 +02:00
Nicolas Grekas 648a8953dd feature #22200 [DI] Reference tagged services in config (ro0NL)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Reference tagged services in config

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

This is a proof of concept to reference a sequence of tagged services.

The problem bugs me for some time, and at first i thought the solution was to have some super generic compiler pass. If it could replace a lot of compilers in core.. perhaps worth it, but eventually each tag comes with it's own logic, including how to deal with tag attributes.

However, writing the passes over and over again becomes tedious for the most basic usecase. So given the recent developments, this idea came to mind.

```yml
services:
    a:
        class: stdClass
        properties: { a: true }
        tags: [foo]

    b:
        class: stdClass
        properties: { b: true }
        tags: [foo]

    c:
        class: stdClass
        properties:
            #stds: !tagged_services foo (see #22198)
            stds: !tagged_services
                foo
```

```
dump(iterator_to_array($this->get('c')->stds));
```

```
array:2 [▼
  0 => {#5052 ▼
    +"a": true
  }
  1 => {#4667 ▼
    +"b": true
  }
]
```

Given the _basic_ example at https://symfony.com/doc/current/service_container/tags.html, this could replace that.

Any thoughts?

Commits
-------

979e58f [DI] Reference tagged services in config
2017-09-28 17:24:12 +02:00