Commit Graph

44088 Commits

Author SHA1 Message Date
Yonel Ceruto
b79532ab0e Add ErrorController to preview and render errors 2019-09-02 17:02:21 -04:00
Nicolas Grekas
959eb56488 Merge branch '4.3' into 4.4
* 4.3:
  fix merge
2019-09-02 21:50:03 +02:00
Nicolas Grekas
d26a6568b3 fix merge 2019-09-02 21:49:51 +02:00
Nicolas Grekas
5d4a3a16e0 Merge branch '4.3' into 4.4
* 4.3:
  fix merge
2019-09-02 20:43:07 +02:00
Nicolas Grekas
af474ab97e fix merge 2019-09-02 20:42:57 +02:00
Nicolas Grekas
cf507a6728 Merge branch '4.3' into 4.4
* 4.3:
  [Bridge/PhpUnit] fix looking for composer
  cs fix
2019-09-02 20:34:52 +02:00
Nicolas Grekas
7c5d220f1a Merge branch '3.4' into 4.3
* 3.4:
  [Bridge/PhpUnit] fix looking for composer
2019-09-02 20:34:38 +02:00
Nicolas Grekas
62020ab91f [Bridge/PhpUnit] fix looking for composer 2019-09-02 20:32:45 +02:00
Nicolas Grekas
61dad16c9d cs fix 2019-09-02 18:03:34 +02:00
Fabien Potencier
cf57ca81ee Merge branch '4.3' into 4.4
* 4.3:
  [Mailer] fixed Mailgun support when a response is not JSON as expected
2019-09-02 17:26:08 +02:00
Fabien Potencier
ca16f5278e bug #33432 [Mailer] Fix Mailgun support when a response is not JSON as expected (fabpot)
This PR was merged into the 4.3 branch.

Discussion
----------

[Mailer] Fix Mailgun support when a response is not JSON as expected

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #32043
| License       | MIT
| Doc PR        | n/a

Sometimes, like when getting a 401, the Mailgun API does not respond with JSON :(

Commits
-------

3b2db425f6 [Mailer] fixed Mailgun support when a response is not JSON as expected
2019-09-02 17:24:05 +02:00
Fabien Potencier
3b2db425f6 [Mailer] fixed Mailgun support when a response is not JSON as expected 2019-09-02 17:20:17 +02:00
Nicolas Grekas
727aa7ed9e Merge branch '4.3' into 4.4
* 4.3:
  [4.3] Cleanup tests
  Cleanup tests
  [Finder] Prevent unintentional file locks in Windows
  [FrameworkBundle] Fix about command not showing .env vars
  [DomCrawler] Fix FileFormField PHPDoc
  [Mailer] Remove the default dispatcher in AbstractTransport
  Fix #33395 PHP 5.3 compatibility
2019-09-02 16:51:55 +02:00
Nicolas Grekas
d05e49797c [4.3] Cleanup tests 2019-09-02 16:45:56 +02:00
Fabien Potencier
85d0982f84 bug #33429 [Mailer] hotfix (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] hotfix

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Bug fixes must be submitted against the lowest maintained 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 branch 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

e15df84313 [Mailer] fixed wrong  behavior
2019-09-02 16:41:57 +02:00
Nicolas Grekas
d423b0f473 Merge branch '3.4' into 4.3
* 3.4:
  Cleanup tests
  [Finder] Prevent unintentional file locks in Windows
  [DomCrawler] Fix FileFormField PHPDoc
  Fix #33395 PHP 5.3 compatibility
2019-09-02 16:41:27 +02:00
Fabien Potencier
e15df84313 [Mailer] fixed wrong behavior 2019-09-02 16:39:38 +02:00
Nicolas Grekas
33e466577f minor #33428 Cleanup tests (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

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

Commits
-------

a461943345 Cleanup tests
2019-09-02 16:39:16 +02:00
Nicolas Grekas
a461943345 Cleanup tests 2019-09-02 16:34:19 +02:00
Fabien Potencier
9e0640a281 [Mailer] fixed previous merge 2019-09-02 16:31:12 +02:00
Fabien Potencier
2ad7f97568 feature #33409 [Mailer] Add support for multiple mailers (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Add support for multiple mailers

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | closes #32535
| License       | MIT
| Doc PR        | -

This adds the possibility to define several email transports.

If you only have one email transport,  nothing changes:

```yaml
framework:
    mailer:
        dsn: '%env(MAILER_DSN)%'
```

But if you need more than one, use the `transports` entry instead:

```yaml
framework:
    mailer:
        transports:
            main: '%env(MAILER_DSN)%'
            important: '%env(MAILER_DSN_IMPORTANT)%'
```

Then, when sending an email via the `Mailer`, pass the mailer name explicitly (by default, the first one is used):

```php
// use the first "main" transport
$mailer->send($email);

// or use the "important" one (`null` is the envelope)
$mailer->send($email, null, 'important');
```

The web profiler now displays the name and the shorten DSN.

Commits
-------

de5fae4dd8 [Mailer] Add support for multiple mailers
2019-09-02 16:12:44 +02:00
Fabien Potencier
378abfae04 feature #33424 [Mailer] Change the DSN semantics (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Change the DSN semantics

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | yes
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/12258

I'm not very satisfied with the current DSNs for the Mailer. First, the scheme/protocol should use the provider name, then, there is no way to change the host, which would be nice to debug more easily (using a requestb.in service for instance).

Before:

```
smtp://USERNAME:PASSWORD@mailgun
http://KEY:DOMAIN@mailgun
```

After:

```
mailgun+smtp://USERNAME:PASSWORD@default
mailgun+http://KEY:DOMAIN@default

# New
mailgun+http://KEY:DOMAIN@somewhere.com:99
```

SMTP DSNs did not change, but the special sendmail one did:

Before:

```
smtp://sendmail
```

After:

```
sendmail+smtp://default
```

And for the `null` transport:

Before:

```
smtp://null
```

After:

```
null://null
```

Commits
-------

469c989697 [Mailer] Change the DSN semantics
2019-09-02 16:11:47 +02:00
Fabien Potencier
469c989697 [Mailer] Change the DSN semantics 2019-09-02 15:50:44 +02:00
Fabien Potencier
de5fae4dd8 [Mailer] Add support for multiple mailers 2019-09-02 12:19:09 +02:00
Fabien Potencier
ef2b65aaf1 minor #33419 [Mailer] Renamed getName() to toString() (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Renamed getName() to toString()

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

The `getName()` method on a Transport was introduced in 4.4. We rename it here as this method is mainly used by the profiler to display useful information about which mailer is used. This is more a string representation than a name (which is going to be introduced in the PR about multiple mailer support).

Commits
-------

5b7bba9ef3 [Mailer] Renamed getName() to toString()
2019-09-02 11:58:01 +02:00
Fabien Potencier
5b7bba9ef3 [Mailer] Renamed getName() to toString() 2019-09-02 11:41:25 +02:00
Nicolas Grekas
6a31d31f28 bug #33402 [Finder] Prevent unintentional file locks in Windows (jspringe)
This PR was submitted for the 4.3 branch but it was squashed and merged into the 3.4 branch instead (closes #33402).

Discussion
----------

[Finder] Prevent unintentional file locks in Windows

| Q             | A
| ------------- | ---
| Branch?       | 4.3 for bug fixes <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #33400   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        |

~~This replaces the constructor behavior for `SortableIterator`. Instead of storing the sort strategy as a property, causing the object to hold references to the files being sorted and thus locking them in Windows, it uses a method to determine the sort strategy when calling `getIterator`.~~

Change stored `$sort` closure to a static closure. This removes the instance context that causes the file lock. This doesn't change any intended behavior.

I, unfortunately, did not provided tests for 2 reasons. The first being that I've never written tests for the Symfony framework so I do not know the nuances. ~~The second is that in order for the test to actually fail it would need to be run in the Windows OS.~~ AppVeyor tests with a Windows instance, but it appears the `Finder` tests get skipped.

Commits
-------

997cc5c3f0 [Finder] Prevent unintentional file locks in Windows
2019-09-01 23:32:41 +02:00
Joe Springe
997cc5c3f0 [Finder] Prevent unintentional file locks in Windows 2019-09-01 23:32:23 +02:00
Fabien Potencier
bcb91eadf0 bug #33408 Fix the profiler panel for Mailer (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

Fix the profiler panel for Mailer

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Currently, the web profiler panel for Mailer is never shown as `$this->mailerConfigEnabled` is set after the profiler is configured.

Commits
-------

326afc7a09 Fix the profiler panel for Mailer
2019-09-01 18:10:31 +02:00
Fabien Potencier
326afc7a09 Fix the profiler panel for Mailer 2019-09-01 17:28:36 +02:00
Robin Chalas
b9f8c7bbf9 bug #33376 [Mailer] Remove the default dispatcher in AbstractTransport (fabpot)
This PR was merged into the 4.3 branch.

Discussion
----------

[Mailer] Remove the default dispatcher in AbstractTransport

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n:a

Creating a default event dispatcher does not make sense as nobody can listen on it.

Commits
-------

55d6a65df9 [Mailer] Remove the default dispatcher in AbstractTransport
2019-08-31 06:21:39 +02:00
Fabien Potencier
d67289ca82 bug #33357 [FrameworkBundle] Fix about command not showing .env vars (brentybh)
This PR was squashed before being merged into the 4.3 branch (closes #33357).

Discussion
----------

[FrameworkBundle] Fix about command not showing .env vars

Before this fix, `bin/console about` can't properly show `Environment (.env)` section because:
`SYMFONY_DOTENV_VARS` which stores all keys of Dotenv-set env vars, is being fetched via `getenv()`.

However, in Symfony Dotenv 4.3, usage of `putenv()` is deprecated:
d2fa94d259 (diff-a6967492da82dce9ba93bcba3eee0334)
so we can get env vars via `getenv()` only when `new Dotenv(true)`.
In the default shipped `config/bootstrap.php`, there is `new Dotenv(false)` set.

(Maybe related #29131)

| Q             | A
| ------------- | ---
| Branch?       | 4.3 for bug fixes <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| License       | MIT

<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Bug fixes must be submitted against the lowest maintained 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 branch 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

f48f19db91 [FrameworkBundle] Fix about command not showing .env vars
2019-08-30 19:50:45 +02:00
Bohan Yang
f48f19db91 [FrameworkBundle] Fix about command not showing .env vars 2019-08-30 19:50:33 +02:00
Fabien Potencier
71a8ecbfd6 minor #33289 [DomCrawler] Fix FileFormField PHPDoc (dunglas)
This PR was squashed before being merged into the 3.4 branch (closes #33289).

Discussion
----------

[DomCrawler] Fix FileFormField PHPDoc

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

`null` is a valid value, it is used in case of errors. Then the parent class must allow `null` values too. I think it's important regarding the ongoing process of adding typehints everywhere.

Commits
-------

162bfc3cad [DomCrawler] Fix FileFormField PHPDoc
2019-08-30 19:42:32 +02:00
Kévin Dunglas
162bfc3cad [DomCrawler] Fix FileFormField PHPDoc 2019-08-30 19:42:23 +02:00
Fabien Potencier
87c8d2ded9 bug #33396 Fix #33395 PHP 5.3 compatibility (kylekatarnls)
This PR was merged into the 3.4 branch.

Discussion
----------

Fix #33395 PHP 5.3 compatibility

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

<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Bug fixes must be submitted against the lowest maintained 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 branch 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

dede158e8a Fix #33395 PHP 5.3 compatibility
2019-08-30 19:39:55 +02:00
Fabien Potencier
55d6a65df9 [Mailer] Remove the default dispatcher in AbstractTransport 2019-08-30 19:29:56 +02:00
Kyle
dede158e8a
Fix #33395 PHP 5.3 compatibility 2019-08-30 15:50:48 +02:00
Nicolas Grekas
9ea05b1601 Merge branch '4.3' into 4.4
* 4.3:
  [Console] allow Command::getName() to return null
2019-08-30 14:54:56 +02:00
Nicolas Grekas
8c0f54ba21 Merge branch '3.4' into 4.3
* 3.4:
  [Console] allow Command::getName() to return null
2019-08-30 14:54:44 +02:00
Nicolas Grekas
22ed6247fa Merge branch '4.3' into 4.4
* 4.3:
  [Routing] fix static route reordering when a previous dynamic route conflicts
  Return null as Expire header if it was set to null
  bug #33370 Fix import statement typo in NullCache (adrienbrault)
  [ProxyManager] remove ProxiedMethodReturnExpression polyfill
  fix dumping not inlined scalar tag values
2019-08-30 14:49:06 +02:00
Nicolas Grekas
247815d21c Merge branch '3.4' into 4.3
* 3.4:
  Return null as Expire header if it was set to null
  [ProxyManager] remove ProxiedMethodReturnExpression polyfill
  fix dumping not inlined scalar tag values
2019-08-30 14:41:22 +02:00
Nicolas Grekas
4b66beed75 bug #33363 [Routing] fix static route reordering when a previous dynamic route conflicts (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Routing] fix static route reordering when a previous dynamic route conflicts

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

Spotted while playing with the code.
I confirm the test case is green on 3.4 too (but route reordering didn't exist then.)

Commits
-------

cba3b6245a [Routing] fix static route reordering when a previous dynamic route conflicts
2019-08-30 14:41:04 +02:00
Nicolas Grekas
cba3b6245a [Routing] fix static route reordering when a previous dynamic route conflicts 2019-08-30 14:38:42 +02:00
Nicolas Grekas
15bbfc36e4 minor #33390 [FrameworkBundle][TwigBundle] conflict with HttpKernel 5 (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle][TwigBundle] conflict with HttpKernel 5

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

Commits
-------

7d94b7c086 conflict with HttpKernel 5
2019-08-30 14:22:42 +02:00
Christian Flothmann
7d94b7c086 conflict with HttpKernel 5 2019-08-30 13:37:47 +02:00
Robin Chalas
720ffd869e bug #33385 [Console] allow Command::getName() to return null (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console] allow Command::getName() to return null

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

As reported on 4510f04e70 (commitcomment-34845639)

Commits
-------

59ad6c29d1 [Console] allow Command::getName() to return null
2019-08-29 18:31:21 +02:00
Nicolas Grekas
bff95742eb bug #33353 Return null as Expire header if it was set to null (danrot)
This PR was squashed before being merged into the 3.4 branch (closes #33353).

Discussion
----------

Return null as Expire header if it was set to null

| Q             | A
| ------------- | ---
| Branch?       | 3.4 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please 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        | symfony/symfony-docs#... <!-- required for new features -->

This PR fixes a regression introduces in #33332. If you set the `Expires` header to null when creating a `Response`, the `getExpires` function returned a date instead of null.

```php
$response = new Response(null, 200, ['Expires' => null]);
$response->getExpires(); // Returns a date currently, but should return null
```

See also [the comment](https://github.com/symfony/symfony/pull/33332#discussion_r317934607) in the PR introducing this regression.

Commits
-------

5e3c7ea452 Return null as Expire header if it was set to null
2019-08-29 18:18:10 +02:00
Daniel Rotter
5e3c7ea452 Return null as Expire header if it was set to null 2019-08-29 18:18:03 +02:00
Nicolas Grekas
59ad6c29d1 [Console] allow Command::getName() to return null 2019-08-29 18:09:35 +02:00