Commit Graph

46963 Commits

Author SHA1 Message Date
Nicolas Grekas
cfc71469ed bug #35024 [HttpFoundation] fix pdo session handler for sqlsrv (azjezz)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] fix pdo session handler for sqlsrv

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34995
| License       | MIT
| Doc PR        | N/A

Commits
-------

776f649c61 [HttpFoundation] fix pdo session handler for sqlsrv
2019-12-18 22:39:54 +01:00
Nicolas Grekas
4d064a2584 bug #35025 [HttpClient][Psr18Client] Remove Psr18ExceptionTrait (fancyweb)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient][Psr18Client] Remove Psr18ExceptionTrait

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Interesting case. Declared trait are instantly loaded by PHP. When ClassExistenceResource fails to load this class because of a thrown \LogicException (when a dependency is missing, cf the top of this class) the trait is loaded. Then, to display the exception, this class is reaccessed (I guess by the duplicated request 🤔) and it results in a fatal error "Cannot redeclare trait...". Basically ClassExistenceResource does not support this kind of structure (thrown exception + trait). Let's do the easy fix first, and then revert if someone finds a fix for the root problem?

Commits
-------

c1746d8b14 [HttpClient][Psr18Client] Remove Psr18ExceptionTrait
2019-12-18 22:38:12 +01:00
Nicolas Grekas
5b5ac83e22 minor #35027 Docs - Update debug section of UPGRADE guides for 4.4 and 5.0 versions. (QuentinCurtet)
This PR was submitted for the master branch but it was squashed and merged into the 4.4 branch instead.

Discussion
----------

Docs - Update debug section of UPGRADE guides for 4.4 and 5.0 versions.

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34968
| License       | MIT

Update the UPGRADE guides for 4.4 and 5.0 versions (specifically the debug section) because it was not clearly specified that it's necessary to replace `use Symfony\Component\Debug\Debug;` to `use Symfony\Component\ErrorHandler\Debug;`.

Commits
-------

a3d90bece1 Docs - Update debug section of UPGRADE guides for 4.4 and 5.0 versions.
2019-12-18 22:37:01 +01:00
Quentin CURTET
a3d90bece1 Docs - Update debug section of UPGRADE guides for 4.4 and 5.0 versions. 2019-12-18 22:36:53 +01:00
Nicolas Grekas
edac0cedad bug #35028 [TwigBridge] Fix invalid typehint for subject in is_granted Twig function (emodric)
This PR was merged into the 5.0 branch.

Discussion
----------

[TwigBridge] Fix invalid typehint for subject in is_granted Twig function

| Q             | A
| ------------- | ---
| Branch?       | 5.0
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #35026
| License       | MIT
| Doc PR        | N/A

Twig function `is_granted` does not accept `mixed` any more for its second argument, instead requiring `object` or `null` with a PHP typehint. `AuthorizationCheckerInterface::isGranted`, where this argument is passed, has no typehint in code and is typehinted as `mixed` in PHPDoc.

This makes it impossible to have a check in Twig template with code similar to this:

`{% if is_granted('ROLE_MY_APP', {foo: 'bar', bar: 'baz'}) %}...{% endif %}`

Commits
-------

d3d86ce250 Fix invalid typehint for subject in is_granted Twig function
2019-12-18 22:35:07 +01:00
Nicolas Grekas
231c505a47 [DI] allow "." and "-" in env processor lines 2019-12-18 17:27:44 +01:00
Edi Modrić
d3d86ce250
Fix invalid typehint for subject in is_granted Twig function 2019-12-18 17:23:52 +01:00
Alexander McCullagh
9c5754acaa [Dotenv] FIX missing getenv 2019-12-18 16:41:13 +01:00
Saif Eddin G
776f649c61
[HttpFoundation] fix pdo session handler for sqlsrv 2019-12-18 16:15:58 +01:00
Thomas Calvet
c1746d8b14 [HttpClient][Psr18Client] Remove Psr18ExceptionTrait 2019-12-18 16:09:34 +01:00
Nicolas Grekas
e411b65dd0 [HttpKernel] ignore failuresgenerated by opcache.restrict_api 2019-12-18 15:43:30 +01:00
Nicolas Grekas
9960f3032a Merge branch '5.0'
* 5.0:
  [Config] improve perf of glob discovery when GLOB_BRACE is not available
  use utf8mb4_bin to align code with documentation
  [HttpClient] make pushed responses retry-able
  [VarDumper] ignore failing __debugInfo()
2019-12-18 14:50:41 +01:00
Nicolas Grekas
c048ea5de5 Merge branch '4.4' into 5.0
* 4.4:
  [Config] improve perf of glob discovery when GLOB_BRACE is not available
  use utf8mb4_bin to align code with documentation
  [HttpClient] make pushed responses retry-able
  [VarDumper] ignore failing __debugInfo()
2019-12-18 14:50:31 +01:00
Nicolas Grekas
d7a0679011 bug #35015 [Config] fix perf of glob discovery when GLOB_BRACE is not available (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Config] fix perf of glob discovery when GLOB_BRACE is not available

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #35009
| License       | MIT
| Doc PR        | -

This PR implements a fast fallback implementation of GLOB_BRACE for musl-based libc, as found on Alpine. It is *not* a feature-complete fallback implementation. Implementing one would be [much more involving](https://github.com/zendframework/zend-stdlib/blob/master/src/Glob.php). But the provided implementation is good enough in practice IMHO, and the slow path is still used when not-covered glob patterns are used.

Here is the comparison:
![image](https://user-images.githubusercontent.com/243674/71022909-eb9f7000-2101-11ea-99f5-eab0286c77a3.png)

![image](https://user-images.githubusercontent.com/243674/71022899-e4786200-2101-11ea-8663-80c1674602db.png)

Commits
-------

8af6d86371 [Config] improve perf of glob discovery when GLOB_BRACE is not available
2019-12-18 14:46:16 +01:00
Nicolas Grekas
b450a2bed7 Merge branch '4.3' into 4.4
* 4.3:
  use utf8mb4_bin to align code with documentation
  [HttpClient] make pushed responses retry-able
  [VarDumper] ignore failing __debugInfo()
2019-12-18 14:41:29 +01:00
Nicolas Grekas
bbf7ed12b1 bug #35014 [HttpClient] make pushed responses retry-able (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] make pushed responses retry-able

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/orgs/symfony/projects/1#card-30499375
| License       | MIT
| Doc PR        | -

This moves the PUSH matching logic down so that the curl handle of pushed responses can be properly configured. This should make pushed requests retry-able when they fail just after the push-promise frame.

Commits
-------

c2864f65ab [HttpClient] make pushed responses retry-able
2019-12-18 14:38:49 +01:00
Nicolas Grekas
026d57e196 Merge branch '3.4' into 4.3
* 3.4:
  use utf8mb4_bin to align code with documentation
  [VarDumper] ignore failing __debugInfo()
2019-12-18 14:36:54 +01:00
Nicolas Grekas
e85acddc9a bug #35010 [VarDumper] ignore failing __debugInfo() (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[VarDumper] ignore failing __debugInfo()

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34993
| License       | MIT
| Doc PR        | -

Commits
-------

eb2eb76d0e [VarDumper] ignore failing __debugInfo()
2019-12-18 14:29:30 +01:00
Robin Chalas
39bd706cbf feature #34548 Added access decision strategy to respect voter priority (aschempp)
This PR was squashed before being merged into the 5.1-dev branch (closes #34548).

Discussion
----------

Added access decision strategy to respect voter priority

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | _will happily do if this is of interest/to be merged 🙃_

The priority-based access decision strategy will decide based on the first voter that does not abstain from the decision. Security voters can be registered with priority (`PriorityTaggedServiceTrait`), so a voter with higher priority can overrule other voters.

In [Contao CMS](https://github.com/contao/contao), the core system should provide security voters that provide the "default permissions", but extensions/bundles can override almost anything and therefore need to be able to override the core decision. None of the existing strategies allow for something like that.

/ping @chalasr @Toflar @leofeyer @ausi
#SymfonyHackday

Commits
-------

0b8028a0ec Added access decision strategy to respect voter priority
2019-12-18 14:26:38 +01:00
Andreas Schempp
0b8028a0ec Added access decision strategy to respect voter priority 2019-12-18 14:26:30 +01:00
Nicolas Grekas
b47f1af6c2 minor #35020 [HttpFoundation] use utf8mb4_bin to align code with documentation (bendavies)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpFoundation] use utf8mb4_bin to align code with documentation

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

This aligns the code with [the documentation](https://symfony.com/doc/3.4/doctrine/pdo_session_storage.html#mysql), which says to use `utf8mb4` for the character set when using mysql.

Commits
-------

3739ec9f29 use utf8mb4_bin to align code with documentation
2019-12-18 13:05:47 +01:00
Nicolas Grekas
8af6d86371 [Config] improve perf of glob discovery when GLOB_BRACE is not available 2019-12-18 13:00:29 +01:00
Nicolas Grekas
317ce6d16e [DI] Enable inline_class_loader in debug mode 2019-12-18 12:53:53 +01:00
Ben Davies
3739ec9f29 use utf8mb4_bin to align code with documentation 2019-12-18 10:25:03 +00:00
Nicolas Grekas
c2864f65ab [HttpClient] make pushed responses retry-able 2019-12-17 17:19:12 +01:00
Nicolas Grekas
eb2eb76d0e [VarDumper] ignore failing __debugInfo() 2019-12-17 16:56:06 +01:00
Nicolas Grekas
76c98fda98 Merge branch '5.0'
* 5.0:
  [Console][QuestionHelper] Use string type declaration
2019-12-17 15:24:10 +01:00
Nicolas Grekas
c253ffd68d minor #35008 [Console][QuestionHelper] Use string type declaration (fancyweb)
This PR was merged into the 5.0 branch.

Discussion
----------

[Console][QuestionHelper] Use string type declaration

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Minor improvement.

Commits
-------

a594fe405b [Console][QuestionHelper] Use string type declaration
2019-12-17 15:23:51 +01:00
Thomas Calvet
a594fe405b [Console][QuestionHelper] Use string type declaration 2019-12-17 14:20:22 +01:00
Nicolas Grekas
1b6c71200f Merge branch '5.0'
* 5.0:
  [DI] revert reordering of ResolveFactoryClassPass and AutowireRequiredMethodsPass in PassConfig
2019-12-17 13:18:30 +01:00
Nicolas Grekas
3c672bc923 Merge branch '4.4' into 5.0
* 4.4:
  [DI] revert reordering of ResolveFactoryClassPass and AutowireRequiredMethodsPass in PassConfig
2019-12-17 13:17:37 +01:00
Nicolas Grekas
32b09a8461 Merge branch '4.3' into 4.4
* 4.3:
  [DI] revert reordering of ResolveFactoryClassPass and AutowireRequiredMethodsPass in PassConfig
2019-12-17 13:17:04 +01:00
Nicolas Grekas
2b0f9d6bd9 [DI] revert reordering of ResolveFactoryClassPass and AutowireRequiredMethodsPass in PassConfig 2019-12-17 13:15:16 +01:00
Nicolas Grekas
8ffdef2958 Merge branch '5.0'
* 5.0:
  [DI] Service locators can't be decorated
  [HttpClient] force HTTP/1.1 when NTLM auth is used
  [Validation][FrameworkBundle] Allow EnableAutoMapping to work without auto-mapping namespaces
  [Console][SymfonyQuestionHelper] Handle multibytes question choices keys and custom prompt
  [DI] fix auto-binding service providers to their service subscribers
  [Mailer] fixed undefined index when sending mail
2019-12-17 11:36:18 +01:00
Nicolas Grekas
3c348df73b Merge branch '4.4' into 5.0
* 4.4:
  [DI] Service locators can't be decorated
  [HttpClient] force HTTP/1.1 when NTLM auth is used
  [Validation][FrameworkBundle] Allow EnableAutoMapping to work without auto-mapping namespaces
  [Console][SymfonyQuestionHelper] Handle multibytes question choices keys and custom prompt
  [DI] fix auto-binding service providers to their service subscribers
  [Mailer] fixed undefined index when sending mail
2019-12-17 11:33:13 +01:00
Nicolas Grekas
4b93c6210d Merge branch '4.3' into 4.4
* 4.3:
  [DI] Service locators can't be decorated
  [Console][SymfonyQuestionHelper] Handle multibytes question choices keys and custom prompt
  [DI] fix auto-binding service providers to their service subscribers
2019-12-17 11:32:23 +01:00
Nicolas Grekas
91016348ba Merge branch '3.4' into 4.3
* 3.4:
  [Console][SymfonyQuestionHelper] Handle multibytes question choices keys and custom prompt
2019-12-17 11:30:23 +01:00
Nicolas Grekas
8c74562dd8 bug #34998 [DI] fix auto-binding service providers to their service subscribers (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[DI] fix auto-binding service providers to their service subscribers

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix https://github.com/orgs/symfony/projects/1#card-30503621
| License       | MIT
| Doc PR        | -

Spotted during a workshop at SymfonyLive Sao Paulo if I recall well :)

Commits
-------

6c2ceb0c44 [DI] fix auto-binding service providers to their service subscribers
2019-12-17 11:27:58 +01:00
Nicolas Grekas
07bfe6bae5 bug #34954 [Mailer] Fixed undefined index when sending via Mandrill API (wulff)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Fixed undefined index when sending via Mandrill API

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34892
| License       | MIT

When a [Mandrill API send request](https://www.mandrillapp.com/api/docs/messages.JSON.html#method=send) is succesful, it returns an array of results, one for each recipient. To get rid of the undefined index error, we grab the message ID from the first recipient in the array.

Commits
-------

ef0aa4dc87 [Mailer] fixed undefined index when sending mail
2019-12-17 11:26:47 +01:00
Nicolas Grekas
672fbf5a2b bug #33670 [DI] Service locators can't be decorated (malarzm)
This PR was squashed before being merged into the 4.3 branch.

Discussion
----------

[DI] Service locators can't be decorated

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

This popped up while I was trying to update my work project as we have decorated the `messenger.receiver_locator` service. Not sure if this is a regression in DI or a change in messenger that caused the issue thus I'm not marking this as a BC break.

Exception while trying to compile the container:

```
Invalid definition for service "Symfony\Component\DependencyInjection\Tests\Compiler\DecoratedServiceLocator": an array of references is expected as first argument when the "container.service_locator" tag is set.
```

Expected result: service locator can be decorated.

Commits
-------

343282b9d4 [DI] Service locators can't be decorated
2019-12-17 11:22:17 +01:00
Maciej Malarz
343282b9d4 [DI] Service locators can't be decorated 2019-12-17 11:22:10 +01:00
Nicolas Grekas
ae9c41cb16 bug #35000 [Console][SymfonyQuestionHelper] Handle multibytes question choices keys and custom prompt (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console][SymfonyQuestionHelper] Handle multibytes question choices keys and custom prompt

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/33928
| License       | MIT
| Doc PR        | -

Replaces / finishes https://github.com/symfony/symfony/pull/33911

Commits
-------

f175032ed8 [Console][SymfonyQuestionHelper] Handle multibytes question choices keys and custom prompt
2019-12-17 11:19:24 +01:00
Nicolas Grekas
cb96f143da bug #35005 [HttpClient] force HTTP/1.1 when NTLM auth is used (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] force HTTP/1.1 when NTLM auth is used

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

NTLM requires HTTP/1.1.

Commits
-------

0e87e9b960 [HttpClient] force HTTP/1.1 when NTLM auth is used
2019-12-17 11:18:26 +01:00
Nicolas Grekas
45d65cc000 feature #34881 [FrameworkBundle] Allow using the kernel as a registry of controllers and service factories (nicolas-grekas)
This PR was merged into the 5.1-dev branch.

Discussion
----------

[FrameworkBundle] Allow using the kernel as a registry of controllers and service factories

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #28992, fix #29997
| License       | MIT
| Doc PR        | -

This PR builds on #34873 and #34872 and allows using the `Kernel` as a registry of autowired controllers and service factories. The `ContainerConfigurator` passed to `configureContainer()` defaults to declaring autowired and autoconfigured services.

TL;DR: Silex is back but in a much more powerful way \o/

Here is a Kernel that just works and displays `Hello App\Foo` on the `/` route:
```php
class Kernel extends BaseKernel
{
    use MicroKernelTrait;

    protected function configureContainer(ContainerConfigurator $container): void
    {
        $container->services()
            ->load('App\\', '../src')
            ->set(Foo::class)
                ->factory([$this, 'createFoo']);
    }

    public function createFoo(Bar $bar)
    {
        return new Foo($bar);
    }

    protected function configureRoutes(RoutingConfigurator $routes): void
    {
        $routes->add('home', '/')->controller([$this, 'helloAction']);
    }

    public function helloAction(Foo $foo)
    {
        return new Response('Hello '.get_class($foo));
    }
}
```

Commits
-------

9c9b99cc65 [FrameworkBundle] Allow using the kernel as a registry of controllers and service factories
2019-12-17 11:12:34 +01:00
Nicolas Grekas
0e87e9b960 [HttpClient] force HTTP/1.1 when NTLM auth is used 2019-12-17 10:59:36 +01:00
Maxime Steinhausser
3efdd80704 bug #34707 [Validation][FrameworkBundle] Allow EnableAutoMapping to work without auto-mapping namespaces (ogizanagi)
This PR was squashed before being merged into the 4.4 branch (closes #34707).

Discussion
----------

[Validation][FrameworkBundle] Allow EnableAutoMapping to work without auto-mapping namespaces

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- see below -->
| Bug fix?      | yes?
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | N/A <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | N/A

Currently, when no `framework.validation.auto_mapping` namespaces are configured, the `EnableAutoMapping` annotation has no effect on its own, because the loaders were removed by the fwb extension and the compiler pass.
Simply adding a namespace (even a foolish one) will make it work:

```yml
    validation:
        auto_mapping:
            '*': ~ # this does not really map anything, but allows `EnableAutoMapping` to work as loaders won't be removed.
```

So for those only wanting to use the auto-mapping feature by explicitly setting the `EnableAutoMapping` annotation, it'll be counter-intuitive, as it cannot work without declaring at least one namespace.

Commits
-------

00b46fa72e [Validation][FrameworkBundle] Allow EnableAutoMapping to work without auto-mapping namespaces
2019-12-17 09:15:10 +01:00
Maxime Steinhausser
00b46fa72e [Validation][FrameworkBundle] Allow EnableAutoMapping to work without auto-mapping namespaces 2019-12-17 09:15:02 +01:00
fancyweb
f175032ed8 [Console][SymfonyQuestionHelper] Handle multibytes question choices keys and custom prompt
Co-authored-by: Mikhail Fesenko <m.fesenko@corp.vk.com>
2019-12-17 09:06:44 +01:00
Nicolas Grekas
6c2ceb0c44 [DI] fix auto-binding service providers to their service subscribers 2019-12-16 19:47:19 +01:00
Nicolas Grekas
a44f58bd79 Merge branch '5.0'
* 5.0:
  Fix displaying anonymous classes on PHP 7.4
  Fix merge
2019-12-16 15:48:59 +01:00