Commit Graph

30321 Commits

Author SHA1 Message Date
Robin Chalas
c99641a540 Document removal of server:* commands from the framework 2017-03-21 15:47:31 +01:00
Fabien Potencier
8ba279bc22 minor #22015 [Security] Added option to return true in the method isRememberMeRequested (WhiteEagle88)
This PR was merged into the 2.7 branch.

Discussion
----------

[Security] Added option to return true in the method isRememberMeRequested

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

Replaces #21989

Commits
-------

522ec3ef0c [Security] Added option to return true in the method isRememberMeRequested
2017-03-21 07:31:45 -07:00
Fabien Potencier
c797fc4462 minor #22087 Fix some invalid phpdoc in the Dotenv class (stof)
This PR was merged into the 3.3-dev branch.

Discussion
----------

Fix some invalid phpdoc in the Dotenv class

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

Commits
-------

14525b73b8 Fix some invalid phpdoc in the Dotenv class
2017-03-21 07:24:05 -07:00
Fabien Potencier
749451ed59 minor #22086 Release memory for the parsed data after parsing (stof)
This PR was merged into the 3.3-dev branch.

Discussion
----------

Release memory for the parsed data after parsing

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

If the Dotenv instance outlives the parsing of the file (which is the case easily in the usage described in the documentation as it is used in the global scope and so the variable does not go out of scope until the end of the process), there is no reason to keep the parsed data in memory after the end of the parsing.

I have not reset the integer properties, as this would not save any memory anyway (integers are inline inside the ZVAL anyway)

Commits
-------

518f618d33 Release memory for the parsed data after parsing
2017-03-21 07:21:25 -07:00
Fabien Potencier
e75d4be74d minor #22088 Remove unused private method in Dotenv (stof)
This PR was merged into the 3.3-dev branch.

Discussion
----------

Remove unused private method in Dotenv

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

Commits
-------

f4a7418e3a Remove unused private method in Dotenv
2017-03-21 07:19:31 -07:00
Fabien Potencier
74a1cc34eb bug #22090 [WebProfilerBundle] Fix Content-Security-Policy compatibility in case of a style-src 'self' policy (romainneutron)
This PR was merged into the 3.2 branch.

Discussion
----------

[WebProfilerBundle] Fix Content-Security-Policy compatibility in case of a `style-src 'self'` policy

| Q             | A
| ------------- | ---
| Branch?       | 3.2 <!-- 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 | #22053 #20963
| License       | MIT

This fixes the compatibility of the bundle in case of a `style-src 'self'` policy.
This PR must be rebased once #22089 is merged

Commits
-------

4acec8973f [WebProfilerBundle] Fix content-security-policy compatibility
2017-03-21 07:14:48 -07:00
Romain Neutron
4acec8973f
[WebProfilerBundle] Fix content-security-policy compatibility
This fixes the compatibility of the bundle in case of a `style-src 'self'` policy.
2017-03-21 11:36:15 +01:00
Nicolas Grekas
48e90e3124 Merge branch '2.8' into 3.2
* 2.8:
  [WebProfilerBundle] Drop dead code
2017-03-21 11:32:01 +01:00
Nicolas Grekas
3d8959f4b4 minor #22089 [2.8][WebProfilerBundle] Drop dead code (romainneutron)
This PR was merged into the 2.8 branch.

Discussion
----------

[2.8][WebProfilerBundle] Drop dead code

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

As you can read in https://github.com/symfony/symfony/blob/2.8/src/Symfony/Bundle/WebProfilerBundle/DependencyInjection/Configuration.php#L40-L46 the `position` can only be `top` or `bottom`. I don't see any reference anywhere to a `normal` position.
The removed tests are always true.

Commits
-------

2de494f [WebProfilerBundle] Drop dead code
2017-03-21 11:29:56 +01:00
Romain Neutron
2de494f60b
[WebProfilerBundle] Drop dead code 2017-03-21 11:01:33 +01:00
Christophe Coevoet
f4a7418e3a Remove unused private method in Dotenv 2017-03-21 10:50:23 +01:00
Christophe Coevoet
14525b73b8 Fix some invalid phpdoc in the Dotenv class 2017-03-21 10:34:30 +01:00
Christophe Coevoet
518f618d33 Release memory for the parsed data after parsing 2017-03-21 10:32:25 +01:00
Nicolas Grekas
6643fe2fa8 bug #22084 [DI] Restore skipping logic when autowiring getters (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Restore skipping logic when autowiring getters

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

Partial revert for #22030: the skipping logic is part of the getter injection experience, which provides laziness, thus shouldn't bother you until you actually call the getter, if you do.

Commits
-------

b3f494f [DI] Restore skipping logic when autowiring getters
2017-03-21 09:19:37 +01:00
Nicolas Grekas
b3f494f5da [DI] Restore skipping logic when autowiring getters 2017-03-21 09:09:26 +01:00
Fabien Potencier
35e66ae0a9 bug #22079 [HttpKernel] Fixed bug with purging of HTTPS URLs (ausi)
This PR was squashed before being merged into the 2.7 branch (closes #22079).

Discussion
----------

[HttpKernel] Fixed bug with purging of HTTPS URLs

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

I found two bugs in `HttpCache\Store::purge()` with HTTPS URLs:

1. `->purge('https://example.com/')` only purges the `http` version not the `https` one.
2. If a cache entry exists for both `http` and `https`, only the `http` version gets purged, the `https` version stays in the cache.

I think this issues were introduced with #21582.

This pull request fixes both issues and adds tests for them.

Commits
-------

f50915066f [HttpKernel] Fixed bug with purging of HTTPS URLs
2017-03-20 17:24:39 -07:00
Martin Auswöger
f50915066f [HttpKernel] Fixed bug with purging of HTTPS URLs 2017-03-20 17:24:37 -07:00
Fabien Potencier
a001c2e7ef minor #22080 [FrameworkBundle] Exclude container.service_locator from UnusedTagsPass (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle] Exclude container.service_locator from UnusedTagsPass

| Q             | A
| ------------- | ---
| Branch?       | master
| Tests pass?   | yes

Commits
-------

ad501e5eeb Whitelist container.service_locator tag
2017-03-20 14:46:32 -07:00
Robin Chalas
ad501e5eeb Whitelist container.service_locator tag 2017-03-20 22:29:41 +01:00
Fabien Potencier
93ff304bce minor #22076 [SecurityBundle] Remove dead code in fixtures (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[SecurityBundle] Remove dead code in fixtures

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

Commits
-------

afa5ef603c [SecurityBundle] Remove dead code in fixtures
2017-03-20 13:33:03 -07:00
Nicolas Grekas
afa5ef603c [SecurityBundle] Remove dead code in fixtures 2017-03-20 19:08:03 +01:00
Christian Flothmann
abf1787dcc fix some risky tests 2017-03-20 16:03:41 +01:00
Fabien Potencier
2ba564d984 minor #22012 [DI] [YamlFileLoader] change error message of a non existing file (jordscream)
This PR was squashed before being merged into the 2.7 branch (closes #22012).

Discussion
----------

[DI] [YamlFileLoader] change error message of a non existing file

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

This PR replaces the error message when non existing Yaml file is loaded. It gives more sense for the user.

Commits
-------

1c2ea97585 [DI] [YamlFileLoader] change error message of a non existing file
2017-03-20 07:02:55 -07:00
Jordan Samouh
1c2ea97585 [DI] [YamlFileLoader] change error message of a non existing file 2017-03-20 07:02:54 -07:00
Fabien Potencier
88914a9b1b feature #22059 [Yaml] deprecate "? " starting unquoted strings (xabbuh)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Yaml] deprecate "? " starting unquoted strings

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

Commits
-------

731a74e79c [Yaml] deprecate "? " starting unquoted strings
2017-03-20 06:59:57 -07:00
Fabien Potencier
ece42c50f8 bug #22045 [WebProfilerBundle] Handle Content-Security-Policy-Report-Only header correctly (romainneutron)
This PR was merged into the 3.2 branch.

Discussion
----------

[WebProfilerBundle] Handle Content-Security-Policy-Report-Only header correctly

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

This header should have been handled from the beginning.
Content-Security-Policy recommendation specify this header, it needs to be correctly handled

Commits
-------

b0ba698111 [WebProfilerBundle] Handle Content-Security-Policy-Report-Only header correctly
2017-03-20 06:59:21 -07:00
Christian Flothmann
167742e521 add errors as late as possible
PHPUnit may change the test's state after the listener's startTest()
method has been executed thus leading to broken test result output.
2017-03-20 14:28:31 +01:00
Nicolas Grekas
4d48b58d19 Merge branch '3.2'
* 3.2:
  [Yaml] CS
  [DI] Fix PhpDumper generated doc block
  #20411 fix Yaml parsing for very long quoted strings
  [Workflow] add Phpdoc for better IDE support
  fix package name in conflict rule
  improve message when workflows are missing
  [Doctrine Bridge] fix priority for doctrine event listeners
  Use PHP functions as array_map callbacks when possible
  [Validator] revert wrong Phpdoc change
  Use proper line endings
2017-03-20 11:06:58 +01:00
Nicolas Grekas
ab08fd69b4 Merge branch '2.8' into 3.2
* 2.8:
  [Yaml] CS
2017-03-20 10:45:15 +01:00
Nicolas Grekas
c80a0ae90f Merge branch '2.7' into 2.8
* 2.7:
  [Yaml] CS
2017-03-20 10:41:44 +01:00
Nicolas Grekas
3185dc9c8f [Yaml] CS 2017-03-20 10:41:03 +01:00
Nicolas Grekas
d7e74b964f Merge branch '2.8' into 3.2
* 2.8:
  [DI] Fix PhpDumper generated doc block
  #20411 fix Yaml parsing for very long quoted strings
  [Doctrine Bridge] fix priority for doctrine event listeners
  Use PHP functions as array_map callbacks when possible
  [Validator] revert wrong Phpdoc change
  Use proper line endings
2017-03-20 10:32:19 +01:00
Christian Flothmann
731a74e79c [Yaml] deprecate "? " starting unquoted strings 2017-03-20 10:21:06 +01:00
Nicolas Grekas
5dd83adb1b minor #22065 [DI] Fix PhpDumper generated doc block (nicolas-grekas)
This PR was merged into the 2.8 branch.

Discussion
----------

[DI] Fix PhpDumper generated doc block

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

Commits
-------

58b3ee7 [DI] Fix PhpDumper generated doc block
2017-03-20 09:47:13 +01:00
Nicolas Grekas
5d06acadd3 Merge branch '2.7' into 2.8
* 2.7:
  #20411 fix Yaml parsing for very long quoted strings
  [Doctrine Bridge] fix priority for doctrine event listeners
  Use PHP functions as array_map callbacks when possible
  [Validator] revert wrong Phpdoc change
  Use proper line endings
2017-03-20 09:46:40 +01:00
Nicolas Grekas
58b3ee7616 [DI] Fix PhpDumper generated doc block 2017-03-20 09:19:13 +01:00
Nicolas Grekas
e41064f65a feature #22030 [DI] Remove skipping magic for autowired methods (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Remove skipping magic for autowired methods

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

Wildcard based autowiring made it required to auto-skip methods that were not wireable.
Now that things need to be explicit (ie via the `@required` annotation, or via configuration), this "automagic" behavior is not required anymore.
Since it can lead to wtf moments ("*I* did *put that `@required` annotation, why is it ignored by autowiring?*"), I think we should remove it.
This also fixes another issue where configured method calls had their optional arguments wired, while we want only the constructor's to behave as such.

Commits
-------

a6bfe1c [DI] Remove skipping magic for autowired methods
2017-03-19 18:25:10 +01:00
Nicolas Grekas
a6bfe1c6c5 [DI] Remove skipping magic for autowired methods 2017-03-18 00:31:45 +01:00
Christian Flothmann
923bbdbf9f [Security] simplify the SwitchUserListenerTest 2017-03-17 23:55:35 +01:00
Fabien Potencier
c12727deb8 minor #22038 [FrameworkBundle] harden the config when using workflow guards (xabbuh)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle] harden the config when using workflow guards

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

This will forbid using the FrameworkBundle in 3.3 with previous releases
of the Workflow to avoid issues related to the GuardListener class not
being present. Additionally, it provides a useful exception in case the
guard option is used without the ExpressionLanguage component being
installed.

Commits
-------

418dcc39d4 harden the config when using workflow guards
2017-03-17 12:27:05 -07:00
Christian Flothmann
418dcc39d4 harden the config when using workflow guards
This will forbid using the FrameworkBundle in 3.3 with previous releases
of the Workflow to avoid issues related to the GuardListener class not
being present. Additionally, it provides a useful exception in case the
guard option is used without the ExpressionLanguage component being
installed.
2017-03-17 18:55:12 +01:00
Fabien Potencier
3ae36f4552 feature #22024 [DI] Introduce "container.service_locator" tag, replaces ServiceLocatorArgument (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Introduce "container.service_locator" tag, replaces ServiceLocatorArgument

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

I first started working on adding this new "container.service_locator" tag, so here it is.
It allows defining and dumping service-locator services properly, where it wasn't possible previously (you had to create a DI extension to do so.)

Then I realized that this allowed us to entirely drop `ServiceLocatorArgument` and replace it with the more flexible `ServiceClosureArgument`.

This makes things simpler overall, see diff stat.

Commits
-------

5d230b5871 [DI] Introduce "container.service_locator" tag, replaces ServiceLocatorArgument
2017-03-17 10:07:04 -07:00
Romain Neutron
b0ba698111
[WebProfilerBundle] Handle Content-Security-Policy-Report-Only header correctly 2017-03-17 17:52:43 +01:00
Nicolas Grekas
5d230b5871 [DI] Introduce "container.service_locator" tag, replaces ServiceLocatorArgument 2017-03-17 17:49:32 +01:00
Fabien Potencier
207d068a40 minor #22039 Skip abstract definitions in compiler passes (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

Skip abstract definitions in compiler passes

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

Commits
-------

fc1ba0d64a Skip abstract definitions in compiler passes
2017-03-17 09:47:45 -07:00
Fabien Potencier
4836007172 minor #22029 [DI] Remove useless state from ServiceLocator (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Remove useless state from ServiceLocator

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

One less state to manage for the engine, and allows to deal with non-shared services.

Commits
-------

e0a5eecf2a [DI] Remove useless state from ServiceLocator
2017-03-17 09:46:28 -07:00
Fabien Potencier
ab1d9383b9 bug #21523 #20411 fix Yaml parsing for very long quoted strings (RichardBradley)
This PR was squashed before being merged into the 2.7 branch (closes #21523).

Discussion
----------

#20411 fix Yaml parsing for very long quoted strings

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

This is a second fix for the issue discussed in #20411. My first PR (#21279) didn't fix the bug in all cases, sorry.

If a YAML string has too many spaces in the value, it can trigger a `PREG_BACKTRACK_LIMIT_ERROR` error in the Yaml parser.

There should be no behavioural change other than the bug fix

I have included a test which fails before this fix and passes after this fix.

I have also added checks that detect other PCRE internal errors and throw a more descriptive exception. Before this patch, the YAML engine would often give incorrect results, rather than throwing, on a PCRE `PREG_BACKTRACK_LIMIT_ERROR` error.

Commits
-------

c9a1c09182 #20411 fix Yaml parsing for very long quoted strings
2017-03-17 09:20:26 -07:00
Richard Bradley
c9a1c09182 #20411 fix Yaml parsing for very long quoted strings 2017-03-17 09:20:23 -07:00
Fabien Potencier
64466395ea bug #22006 [FrameworkBundle] remove translator helper if Translator is disabled (xabbuh)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle] remove translator helper if Translator is disabled

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/20928#issuecomment-274293396, #21374
| License       | MIT
| Doc PR        |

Commits
-------

25ea510ba4 remove translator helper if Translator is disabled
2017-03-17 09:19:12 -07:00
Fabien Potencier
ac109f154b bug #22001 [Doctrine Bridge] fix priority for doctrine event listeners (dmaicher)
This PR was merged into the 2.7 branch.

Discussion
----------

[Doctrine Bridge] fix priority for doctrine event listeners

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

This fixes handling the priorities for doctrine event listeners. As found out by @chapterjason in https://github.com/symfony/symfony/issues/21977 the priority was incorrectly handled as soon as a listener had more than one tag (so listening to multiple events).

With this changes all tagged listeners are globally sorted by priority (using the same stable sort approach as in the later available `PriorityTaggedServiceTrait`) and then added one by one to the event manager.

I also updated the tests a bit as it was not covering all cases.

We also have to extend the docs for it I think as it does not mention the `priority` and `lazy` option at all? http://symfony.com/doc/current/doctrine/event_listeners_subscribers.html

Commits
-------

9d9d4efb88 [Doctrine Bridge] fix priority for doctrine event listeners
2017-03-17 09:17:57 -07:00