Commit Graph

43982 Commits

Author SHA1 Message Date
Nicolas Grekas
5aff4a66f1 bug #34896 [Cache] fix memory leak when using PhpFilesAdapter (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Cache] fix memory leak when using PhpFilesAdapter

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

Similar to #34839 but for `PhpFilesAdapter`, as the "appendOnly" mode is a v4-only feature.

Commits
-------

0b46226648 [Cache] fix memory leak when using PhpFilesAdapter
2019-12-10 11:24:37 +01:00
Nicolas Grekas
0b46226648 [Cache] fix memory leak when using PhpFilesAdapter 2019-12-10 11:09:22 +01:00
Nicolas Grekas
a492e72129 Merge branch '3.4' into 4.3
* 3.4:
  [Cache] fix memory leak when using PhpArrayAdapter
  fix parsing negative octal numbers
  [SecurityBundle] Properly escape regex in AddSessionDomainConstraintPass
  [Config] never try loading failed classes twice with ClassExistenceResource
2019-12-07 17:25:26 +01:00
Fabien Potencier
c0b2ade0a3 bug #34762 [Config] never try loading failed classes twice with ClassExistenceResource (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Config] never try loading failed classes twice with ClassExistenceResource

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

Commits
-------

90c9a80863 [Config] never try loading failed classes twice with ClassExistenceResource
2019-12-07 14:42:18 +01:00
Fabien Potencier
7dbc4c677b bug #34839 [Cache] fix memory leak when using PhpArrayAdapter (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] fix memory leak when using PhpArrayAdapter

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

Thanks to @adrienfr, I've been able to understand what causes this massive memory leak when using `PhpArrayAdapter`:
![image](https://user-images.githubusercontent.com/243674/70262187-303b1b00-1794-11ea-9fcb-21ae29c31ff0.png)

When tests run, a new kernel is booted for each test case. This means a new instance of `PhpArrayAdapter` is created, which means it loads its state again and again using `include` for e.g. `annotations.php` in this example.

The first obvious thing is that we see this doing `compile::*`: this means PHP is parsing the same file again and again. But shouldn't opcache prevent this? Well, it's disabled by default because `opcache.enable_cli=0`. To prove the point, here is a comparison with the same tests run with `php -dopcache.enable_cli=1`. The comparison is swapped, but you'll get it:

![image](https://user-images.githubusercontent.com/243674/70262616-fb7b9380-1794-11ea-81c3-6fea0145a63b.png)

But that's not over: because of https://bugs.php.net/76982 (see #32236 also), we still have a memory leak when the included file contains closures. And this one does.

This PR fixes the issue by storing the return value of the include statement into a static property. This fits the caching model of `PhpArrayAdapter`: it's a read-only storage for system caches - i.e. its content is immutable.

Commits
-------

4194c4c56d [Cache] fix memory leak when using PhpArrayAdapter
2019-12-07 14:38:12 +01:00
Fabien Potencier
8f2cd5bd67 bug #34812 [Yaml] fix parsing negative octal numbers (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Yaml] fix parsing negative octal numbers

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

Commits
-------

7ab53f9a39 fix parsing negative octal numbers
2019-12-07 14:29:49 +01:00
Fabien Potencier
9a025b44d9 bug #34854 [Messenger] gracefully handle missing event dispatchers (xabbuh)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] gracefully handle missing event dispatchers

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

Commits
-------

d4ae85fc72 gracefully handle missing event dispatchers
2019-12-07 05:52:32 +01:00
Robin Chalas
ae6c5d3482 bug #34788 [SecurityBundle] Properly escape regex in AddSessionDomainConstraintPass (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[SecurityBundle] Properly escape regex in AddSessionDomainConstraintPass

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

`%s` should be escaped, so it is dumped as `%%s` (it ends up being properly unescaped at load time, so the passed value to the service is the same).

Commits
-------

de03cee846 [SecurityBundle] Properly escape regex in AddSessionDomainConstraintPass
2019-12-06 21:35:12 +01:00
Christian Flothmann
d4ae85fc72 gracefully handle missing event dispatchers 2019-12-06 19:13:02 +01:00
Christian Flothmann
2ac56093a5 Merge branch '3.4' into 4.3
* 3.4:
  [Validator] Allow underscore character "_" in URL username and password
  [SecurityBundle] Passwords are not encoded when algorithm set to \"true\"
  do not validate passwords when the hash is null
  [DI] Fix making the container path-independent when the app is in /app
  Allow copy instead of symlink for ./link script
  [FrameworkBundle] resolve service locators in `debug:*` commands
  bumped Symfony version to 3.4.37
  updated VERSION for 3.4.36
  update CONTRIBUTORS for 3.4.36
  updated CHANGELOG for 3.4.36
2019-12-06 14:11:20 +01:00
Fabien Potencier
56fac414ff minor #34850 [DotEnv] Remove usePutEnv property default value (tucksaun)
This PR was merged into the 4.3 branch.

Discussion
----------

[DotEnv] Remove `usePutEnv` property default value

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

The default value is already set in the constructor (and changes in 5.0, see https://github.com/symfony/symfony/pull/31957/files#diff-3dc82e6e990428b0c71cf2112d02269fR44) and the class is final.

Commits
-------

362c339fa6 [DotEnv] Remove `usePutEnv` property default value
2019-12-06 13:12:56 +01:00
Tugdual Saunier
362c339fa6
[DotEnv] Remove usePutEnv property default value
The value is already set in the constructor (and changes in 5.0) and the class is final.
2019-12-06 12:04:06 +01:00
Nicolas Grekas
a672132392 minor #34829 [Messenger] "set up" typo fix (alex-bacart)
This PR was submitted for the 4.4 branch but it was merged into the 4.3 branch instead.

Discussion
----------

[Messenger] "set up" typo fix

| Q             | A
| ------------- | ---
| Branch?       | master for features / 3.4, 4.3, 4.4 or 5.0 for bug fixes <!-- see below -->
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| License       | MIT

![image](https://user-images.githubusercontent.com/13940752/70231803-1b4a9180-176c-11ea-9faf-b7addf81190a.png)
There's a typo, `setup` is a noun, but it should be a verb `set up`.

Commits
-------

b0daf020de Set up typo fix
2019-12-06 10:25:45 +01:00
Alex Bacart
b0daf020de Set up typo fix 2019-12-06 10:25:38 +01:00
Robin Chalas
5807f5f1fb bug #34755 [FrameworkBundle] resolve service locators in debug:* commands (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] resolve service locators in `debug:*` commands

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

Because of the way ServiceClosureArgument are dumped, we need to resolve locators after loading the xml dump of the container:
https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php#L273

Commits
-------

820da66346 [FrameworkBundle] resolve service locators in `debug:*` commands
2019-12-06 04:55:08 +01:00
Nicolas Grekas
4194c4c56d [Cache] fix memory leak when using PhpArrayAdapter 2019-12-05 19:35:35 +01:00
Fabien Potencier
ffcb691698 bug #34832 [3.4][Validator] Allow underscore character "_" in URL username and password (romainneutron)
This PR was merged into the 3.4 branch.

Discussion
----------

[3.4][Validator] Allow underscore character "_" in URL username and password

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

Hello!

It's been a long time since my last push on Symfony :)
Here's a bug fix. I think URL usernames and password may contain an underscore. Let me know!

Commits
-------

869518bc7e [Validator] Allow underscore character "_" in URL username and password
2019-12-05 17:05:19 +01:00
Romain Neutron
869518bc7e
[Validator] Allow underscore character "_" in URL username and password 2019-12-05 15:05:00 +01:00
Christian Flothmann
7ab53f9a39 fix parsing negative octal numbers 2019-12-04 12:33:46 +01:00
Fabien Potencier
302243dd39 bug #34776 [DI] fix resolving bindings for named TypedReference (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[DI] fix resolving bindings for named TypedReference

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

As spotted in https://github.com/symfony/symfony/pull/34769#issuecomment-561064156

Commits
-------

62c227e368 [DI] fix resolving bindings for named TypedReference
2019-12-04 07:44:27 +01:00
Robin Chalas
59126e0f9c bug #34738 [SecurityBundle] Passwords are not encoded when algorithm set to "true" (nieuwenhuisen)
This PR was merged into the 3.4 branch.

Discussion
----------

[SecurityBundle] Passwords are not encoded when algorithm set to "true"

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

If the algorithm is set to `true`, password will be encode as plain password.

```
security:
    encoders:
        App\User\User:
            algorithm: true
```

The reason for this is the not strict comparison of php switches.

```
switch ($config['algorithm']) {
            case 'plaintext':
}
```

`true == 'plaintext'` is `true`, so the first case is hit. My first solution was to cast the algorithm to a string, to prevent this. After some feedback I have catch this problem earlier and does not allow true as valid value to the algorithm option.

Ps. This is my first PR for Symfony, any feedback is welcome :-)!

Commits
-------

83a5517c01 [SecurityBundle] Passwords are not encoded when algorithm set to \"true\"
2019-12-03 22:06:31 +01:00
Jeroen van den Nieuwenhuisen
83a5517c01 [SecurityBundle] Passwords are not encoded when algorithm set to \"true\" 2019-12-03 22:04:52 +01:00
Robin Chalas
cb429cd762 bug #34779 [Security] do not validate passwords when the hash is null (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security] do not validate passwords when the hash is null

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

Commits
-------

5699cb22bb do not validate passwords when the hash is null
2019-12-03 21:49:28 +01:00
Thomas Calvet
de03cee846 [SecurityBundle] Properly escape regex in AddSessionDomainConstraintPass 2019-12-03 19:26:40 +01:00
Christian Flothmann
5699cb22bb do not validate passwords when the hash is null 2019-12-03 19:05:24 +01:00
Nicolas Grekas
6611ae654b minor #34721 [MonologBridge] Add test on ServerLogHandler (jderusse)
This PR was merged into the 4.3 branch.

Discussion
----------

[MonologBridge] Add test on ServerLogHandler

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

After writing https://github.com/symfony/symfony/pull/34697#issuecomment-559840469 I realized that  ServerLogHandler wasn't tested.

Tell me if it's a BugFix and should be rebased on 4.3

Commits
-------

8c7947f827 Add test on ServerLogHandler
2019-12-03 17:28:04 +01:00
Nicolas Grekas
3b42ca9ae0 minor #34758 Allow copy instead of symlink for ./link script (ogizanagi)
This PR was merged into the 3.4 branch.

Discussion
----------

Allow copy instead of symlink for ./link script

| Q             | A
| ------------- | ---
| Branch?       | 3.4 <!-- see below -->
| Bug fix?      | no
| 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

Not the most efficient way to work, but sometimes it helps to test a bug fix/feature within an existing project for which symlinks can't be resolved due to the dev environment (e.g: a Vagrant where only the current project directory is mounted).

Commits
-------

b28fe66363 Allow copy instead of symlink for ./link script
2019-12-03 17:16:07 +01:00
Nicolas Grekas
62c227e368 [DI] fix resolving bindings for named TypedReference 2019-12-03 10:36:50 +01:00
Nicolas Grekas
90c9a80863 [Config] never try loading failed classes twice with ClassExistenceResource 2019-12-03 08:51:16 +01:00
Fabien Potencier
30294c477d bug #34757 [DI] Fix making the container path-independent when the app is in /app (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Fix making the container path-independent when the app is in /app

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

Right now, we mandate the app to be nested in a directory of level 2 minimum. This means apps cannot be made path-independent if they are built in e.g. `/app`.

Commits
-------

b33b9a6ad9 [DI] Fix making the container path-independent when the app is in /app
2019-12-02 16:27:49 +01:00
Nicolas Grekas
b33b9a6ad9 [DI] Fix making the container path-independent when the app is in /app 2019-12-02 16:26:29 +01:00
Maxime Steinhausser
b28fe66363 Allow copy instead of symlink for ./link script 2019-12-02 15:51:37 +01:00
Nicolas Grekas
820da66346 [FrameworkBundle] resolve service locators in debug:* commands 2019-12-02 14:28:43 +01:00
Fabien Potencier
e9366b4d17 bumped Symfony version to 4.3.10 2019-12-01 15:05:41 +01:00
Fabien Potencier
a87f0ff029
Merge pull request #34741 from fabpot/release-4.3.9
released v4.3.9
2019-12-01 15:00:41 +01:00
Fabien Potencier
7ac4f9062d updated VERSION for 4.3.9 2019-12-01 15:00:23 +01:00
Fabien Potencier
6937f831ba updated CHANGELOG for 4.3.9 2019-12-01 15:00:11 +01:00
Fabien Potencier
7a13ea3efb bumped Symfony version to 3.4.37 2019-12-01 14:59:33 +01:00
Fabien Potencier
0a6fccb577
Merge pull request #34740 from fabpot/release-3.4.36
released v3.4.36
2019-12-01 14:50:53 +01:00
Fabien Potencier
ae2514cd03 updated VERSION for 3.4.36 2019-12-01 14:50:37 +01:00
Fabien Potencier
5ed820030f update CONTRIBUTORS for 3.4.36 2019-12-01 14:50:27 +01:00
Fabien Potencier
c5d4c5eb7b updated CHANGELOG for 3.4.36 2019-12-01 14:50:19 +01:00
Nicolas Grekas
54e2ad7c88 Merge branch '3.4' into 4.3
* 3.4:
  Fix failures on PHP 7.4
2019-12-01 11:50:31 +01:00
Nicolas Grekas
a94e76a866 Fix failures on PHP 7.4 2019-12-01 11:45:41 +01:00
Nicolas Grekas
a489c529ef Merge branch '3.4' into 4.3
* 3.4:
  [Console] fix typos
2019-12-01 11:04:59 +01:00
Nicolas Grekas
abc2880be4 [Console] fix typos 2019-12-01 11:04:45 +01:00
Nicolas Grekas
cd2a8d2628 [Console] fix tests 2019-12-01 10:59:54 +01:00
Fabien Potencier
2c04fad016 Fix CS 2019-12-01 09:39:44 +01:00
Fabien Potencier
d5ca9ec2c7 Merge branch '3.4' into 4.3
* 3.4:
  Fix CS
2019-12-01 09:34:52 +01:00
Fabien Potencier
861783cc15 Fix CS 2019-12-01 09:33:36 +01:00