bug #8997 [Security] Fixed problem with losing ROLE_PREVIOUS_ADMIN role. (pawaclawczyk)

This PR was squashed before being merged into the 2.3 branch (closes #8997).

Discussion
----------

[Security] Fixed problem with losing ROLE_PREVIOUS_ADMIN role.

<table>
  <tr>
    <td><b>Q</b></td>
    <td><b>A</b></td>
  </tr>
  <tr>
    <td>Bug fix?</td>
    <td>yes</td>
  </tr>
  <tr>
    <td>New feature</td>
    <td>no</td>
  </tr>
  <tr>
    <td>BC breaks?</td>
    <td>no</td>
  </tr>
  <tr>
    <td>Deprecations?</td>
    <td>no</td>
  </tr>
  <tr>
    <td>Tests pass?</td>
    <td>yes</td>
  </tr>
  <tr>
    <td>Fixed tickets</td>
    <td>#3085, #8974</td>
  </tr>
  <tr>
    <td>License</td>
    <td>MIT</td>
  </tr>
  <tr>
    <td>Doc PR</td>
    <td>n/a</td>
  </tr>
</table>

Problem occurs while user is impersonated. Authentication process generates new token and doeas not preserve role ```ROLE_PREVIOUS_ADMIN```. Ex. when parameter ```security.always_authenticate_before_granting``` is enabled.

Commits
-------

a7baa3b [Security] Fixed problem with losing ROLE_PREVIOUS_ADMIN role.
[Console] fixed column width when using the Table helper with some decoration in cells
[FrameworkBundle] removed some more dependencies on the request service
fix #9321 Crawler::addHtmlContent add gbk encoding support
use restore_error_handler instead of set_error_handler($previous)
fix some cs
bug #9323 [DomCrawler]fix #9321 Crawler::addHtmlContent add gbk encoding support (bronze1man)

This PR was submitted for the 2.2 branch but it was merged into the 2.3 branch instead (closes #9323).

Discussion
----------

[DomCrawler]fix #9321 Crawler::addHtmlContent add gbk encoding support

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

This is solution 1 in https://github.com/symfony/symfony/issues/9321#issuecomment-26508649

Commits
-------

30af288 fix some cs
9f20b24 use restore_error_handler instead of set_error_handler($previous)
53cb6ad [DomCrawler]fix #9321 Crawler::addHtmlContent add gbk encoding support
feature #9590 WebTestCase: Assume relative KERNEL_DIR is relative to phpunit.xml[.dist]? (mpdude)

This PR was merged into the 2.5-dev branch.

Discussion
----------

WebTestCase: Assume relative KERNEL_DIR is relative to phpunit.xml[.dist]?

When using the `KERNEL_DIR` setting in phpunit.xml[.dist] files for the `WebTestCase`, a relative path seems to be interpreted relative to the cwd.

That makes no difference in the probably most common case of having the phpunit config in the project's top level directory and just running `phpunit`. It makes a difference however when running it from a lower level dir and referencing the config with `-c ../../phpunit.xml`.

A conservative change would be to interpret the `KERNEL_DIR` as relative to cwd and only try it as relative to the phpunit.xml[.dist] file if the first path does not exist.

A more consistent approach would be to always have it (in case of relative paths) being relative to the config file. That might break things for folks who intentionally start phpunit from different directories to use different kernels.

The docs seem not to say anything about how it is supposed to used, the example values provided suggest using an absolute path.

Opinions?

Commits
-------

05dc0e1 Consider KERNEL_DIR setting as relative to the PhpUnit XML file if it does not point to a directory (relative to the current cwd)
bug #9889 [Console] fixed column width when using the Table helper with some decoration in cells (fabpot)

This PR was merged into the 2.3 branch.

Discussion
----------

[Console] fixed column width when using the Table helper with some decoration in cells

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

This PR fixes the same issue as #9366 but works in all situations (all kind of styles, when the string is shorter than any other one or larger than any other ones, ...).

I'm not very satisfied with the fix and especially the `computeLengthWithoutDecoration` method, but the whole helper should be rethought to make it stateless (out of the scope of this PR).

Commits
-------

5b4d057 [Console] fixed column width when using the Table helper with some decoration in cells
Merge branch '2.3' into 2.4

* 2.3:
  fix some cs
  use restore_error_handler instead of set_error_handler($previous)
  fix #9321 Crawler::addHtmlContent add gbk encoding support
  [Console] fixed column width when using the Table helper with some decoration in cells
  [Security] Fixed problem with losing ROLE_PREVIOUS_ADMIN role.
  Fix for cache-key conflict when having a \Traversable as choices
  [Security] removed obsolete comment

Conflicts:
	src/Symfony/Component/Console/Helper/TableHelper.php
	src/Symfony/Component/Security/Tests/Http/Firewall/ExceptionListenerTest.php
Merge branch '2.4'

* 2.4:
  fix some cs
  use restore_error_handler instead of set_error_handler($previous)
  fix #9321 Crawler::addHtmlContent add gbk encoding support
  [Console] fixed column width when using the Table helper with some decoration in cells
  [Security] Fixed problem with losing ROLE_PREVIOUS_ADMIN role.
  Fix for cache-key conflict when having a \Traversable as choices
  [Security] removed obsolete comment
[Validator] Added Doctrine cache
Skips test that need full lib-intl.
minor #9896 [Intl] Skip tests that need full lib-intl when there's no lib-intl (pamil)

This PR was submitted for the 2.3-dev branch but it was merged into the 2.3 branch instead (closes #9896).

Discussion
----------

[Intl] Skip tests that need full lib-intl when there's no lib-intl

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

`NumberFormatter::formatCurrency` executes indirectly `Symfony\Component\Intl\ResourceBundle\Reader::read()`, which has `$bundle = new \ResourceBundle($locale, $path)` - there's Fatal Error if `\ResourceBundle` isn't found. Added availability to run unit tests if `lib-intl` isn't installed.

Commits
-------

6614b66 Skips test that need full lib-intl.
feature #9892 [Validator] Added Doctrine cache (florianv)

This PR was merged into the 2.5-dev branch.

Discussion
----------

[Validator] Added Doctrine cache

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

I propose to keep the `CacheInterface` and deprecate only the `ApcCache`.
It will leave the classes depending on a `CacheInterface` unchanged and will allow to adapt new cache providers in the future.

Commits
-------

3c4de45 [Validator] Added Doctrine cache
Change of scope

When overriding the Symfony RoleHierarchy it would be great to be able to get access to the buildRoleMap-method and map-variable for more advanced usage.
minor #9374 Change of scope (djoos)

This PR was submitted for the 2.3 branch but it was merged into the 2.5-dev branch instead (closes #9374).

Discussion
----------

Change of scope

Hi,

when overriding the Symfony RoleHierarchy it would be great to be able to get access to the buildRoleMap-method and map-variable for more advanced usage.

Don't hesitate to ask for further clarification if necessary - thanks in advance for merging the PR!

Kind regards,
David

Commits
-------

621aaf1 Change of scope
adjusted behavior to always copy override on url files
Expand tree
Improved form tree