Commit Graph

20686 Commits

Author SHA1 Message Date
Fabien Potencier
90a7fa0ca1 minor #14032 [SecurityBundle] UserPasswordEncoderCommand: Improve & simplify the command usage (ogizanagi)
This PR was squashed before being merged into the 2.7 branch (closes #14032).

Discussion
----------

[SecurityBundle] UserPasswordEncoderCommand: Improve & simplify the command usage

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

Overlaps #14017 (might replace or follow it) . Sorry if it is considered as a duplicate, but the debate has evolved, and I think the arguments ordering isn't the best nor single way to improve this command usage anymore.
Thank you @saro0h for having considered the mentioned issues and spent time on it.

# Salt option & salt generation

Thanks to @ircmaxell & @inanimatt, we came to the conclusion that the use-cases for the `salt` option/argument are pretty arguable. So I suggest to get rid of it: **a salt will always be generated by the command.**

### Generated salt
The generated salt is now in the Table output:
`security:encode-password test -n`
![screenshot 2015-03-30 a 21 38 21](https://cloud.githubusercontent.com/assets/2211145/6905081/d96f3ea4-d725-11e4-9b7c-83de8a75f28e.PNG)

The "Generated salt" row and the last comment about the salt aren't present if the new `empty-salt` option is provided (see below).

# New empty-salt option

As some encoders might generate their own built-in salts (like the `BCryptPasswordEncoder`) and some custom encoders could do the same (or not require a salt at all), I suggest a new option: `empty-salt`.
This option will not provide any salt to the configured encoder, which will generate its own, then.

With the interactive way, the user will always be asked confirmation for the salt generation if the `empty-salt` option isn't set:

`security:encode-password password`
![screenshot 2015-03-30 a 21 38 43](https://cloud.githubusercontent.com/assets/2211145/6905072/c53df984-d725-11e4-9a1a-81c3a363b5fe.PNG)

### bcrypt encoder

As the `BCryptPasswordEncoder` is shipped with the security component, and listening to @inanimatt valuable comments in #13988, I introduced a second commit (0cdb546) making an exception for the `bcrypt` encoder, and always set the `empty-salt` option with it.
We're aware that's not ideal from a OO design perspective, but far better from a DX one. If not desired, I will revert it.
Anyway I think https://github.com/symfony/symfony/issues/13988#issuecomment-85068382 and other comments about the `PasswordEncoder` API and salt generation should be considered for 3.0.

A note is added when bcrypt encoder is detected without the `empty-salt` option:
`security:encode-password password "Custom\Class\Bcrypt\User" -n`
![screenshot 2015-03-30 a 19 46 36](https://cloud.githubusercontent.com/assets/2211145/6905066/b53edb52-d725-11e4-87e9-636bf177299a.PNG)

# Default user-class

The default `user-class` is set to `Symfony\Component\Security\Core\User\User`.
I think this makes sense, as in the previous version of the command, the Symfony\Component\Security\Core\User\User was configured in the setAutocompleterValues and set the $value to Symfony\Component\Security\Core\User\User if null.

Asking the question to the user with the interactive command would have been useful only if the user was able to pick one encoder from a choice list.

# Arguments order / make arguments options

When we had both `salt` and `user-class` as arguments, the command looked like:
```sh
security:encode-password [password] [user-class] [salt]
```
All arguments were optional, for the interactive command purpose (The command asked the user for missing arguments).
But, as they were arguments, we had to provide each of them in the proper order. That meant we couldn't provide a salt without defining the optional user-class.
So I suggested using options instead of arguments for both user-class & salt.

But as the `salt` option/argument is removed, now I don't feel the need for the `user-class` to be an option.
Indeed, the new command short version will look like the following:
```sh
#Default user-class: Symfony\Component\Security\Core\User\User
security:encode-password password

#Another user-class:
security:encode-password password "AppBundle\Model\User"
```

Making the user-class an option IMO isn't a necessity anymore, and will only lengthen the command:
```sh
security:encode-password password --user-class="AppBundle\Model\User"
```

## Bonus:
- [The new command documentation](https://cloud.githubusercontent.com/assets/2211145/6845201/48a66382-d3b2-11e4-8227-b799215a2783.PNG). Thanks to @javiereguiluz.
- [Full interactivity output](https://cloud.githubusercontent.com/assets/2211145/6906381/d7753ce4-d72e-11e4-8547-2ef35c6257e9.PNG)

Commits
-------

b3f6340 [SecurityBundle] UserPasswordEncoderCommand: Improve & simplify the command usage
2015-04-07 12:27:23 +02:00
ogizanagi
b3f634039b [SecurityBundle] UserPasswordEncoderCommand: Improve & simplify the command usage 2015-04-07 12:27:20 +02:00
Fabien Potencier
d7866d44ef bug #14213 [WebProfilerBundle] Fixed profiler logger panel view (maximecolin)
This PR was merged into the 2.7 branch.

Discussion
----------

[WebProfilerBundle] Fixed profiler logger panel view

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

Fix profiler logger panel view

Commits
-------

c0ef552 Update logger.html.twig
2015-04-07 12:24:27 +02:00
Fabien Potencier
5a95d03d10 bug #14136 Fixed the line length of the new Symfony Styles (javiereguiluz)
This PR was squashed before being merged into the 2.7 branch (closes #14136).

Discussion
----------

Fixed the line length of the new Symfony Styles

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

**After/Before screenshots**

![example_1](https://cloud.githubusercontent.com/assets/73419/6919599/be6b2cc4-d7b8-11e4-99dc-0848a3cb94cf.png)

![example_2](https://cloud.githubusercontent.com/assets/73419/6919603/c031478c-d7b8-11e4-9887-13dcd8635434.png)

![example_3](https://cloud.githubusercontent.com/assets/73419/6919606/c2498ab6-d7b8-11e4-89ef-1e0e5db9425a.png)

And now my question: is there any way to get the terminal dimensions from SymfonyStyles class without having to copy/paste the code found on \Console\Application?

Commits
-------

e9c7912 Fixed the line length of the new Symfony Styles
2015-04-07 11:31:02 +02:00
Javier Eguiluz
e9c7912f57 Fixed the line length of the new Symfony Styles 2015-04-07 11:31:00 +02:00
Nicolas Grekas
aa82fb065d Fix composer.json dependencies 2015-04-06 19:55:01 +02:00
Abdellatif Ait boudad
874346ffeb bug #14236 [Translation][Profiler] reduce memory usage for collected messages. (aitboudad)
This PR was merged into the 2.7 branch.

Discussion
----------

[Translation][Profiler] reduce memory usage for collected messages.

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

for 1000 translated messages:

![selection_025](https://cloud.githubusercontent.com/assets/1753742/7006976/7df77336-dc7d-11e4-8e35-78d3bc42d324.png)

Commits
-------

21526ea [Translation][Profiler] reduce memory usage for collected messages.
2015-04-06 18:43:11 +01:00
Abdellatif Ait boudad
cc13ae45f2 feature #13443 [Translation][Command][FrameworkBundle] Enable translation debugging in directories (xelaris)
This PR was merged into the 2.7 branch.

Discussion
----------

[Translation][Command][FrameworkBundle] Enable translation debugging in directories

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

This PR follows up #13340 and enables not only to inspect Bundles, but also directories, like the `app/` directory.

Additionally it harmonizes the TranslationDebugCommand and TranslationUpdateCommand to expect an optional bundle name or a directory and fall back to kernel root dir if none of them is given.

Commits
-------

2662244 [FrameworkBundle] Enable translation debugging in directories
2015-04-06 17:05:53 +01:00
Abdellatif Ait boudad
21526ea583 [Translation][Profiler] reduce memory usage for collected messages. 2015-04-06 16:49:58 +01:00
Alexander Schwenn
2662244eb8 [FrameworkBundle] Enable translation debugging in directories
Harmonize TranslationDebugCommand and TranslationUpdateCommand to
expect an optional bundle name or a directory and fall back to kernel
root dir if none of them is given.
2015-04-06 17:04:12 +02:00
Nicolas Grekas
1d5f786a6b [Form] Add conflict with symfony/twig-bridge <2.7 2015-04-06 14:29:38 +02:00
Nicolas Grekas
98c67be970 [TwigBundle] Require symfony/http-kernel < 3.0 2015-04-06 14:12:11 +02:00
Nicolas Grekas
62ac4f39c9 [Bridge\Doctrine] Fix declaration of legacy tests 2015-04-06 11:55:30 +02:00
Nicolas Grekas
a79b57bd46 [Form] Add missing checks for testable features 2015-04-06 11:39:54 +02:00
Nicolas Grekas
60d3c34592 minor #14225 [Form] Make tested features configurable (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Make tested features configurable

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

This adds some flexibility to AbstractLayoutTest so that it can be used by lower versions of components.
It will fix the remaining failing test on 2.6 with deps=high

Commits
-------

c584b3c [Form] Make tested features configurable
2015-04-06 11:03:23 +02:00
Nicolas Grekas
c584b3c697 [Form] Make tested features configurable 2015-04-05 23:37:27 +02:00
Tobias Schultze
472f534435 fix upgrade readme syntax 2015-04-05 23:36:11 +02:00
Nicolas Grekas
d1be9d04d7 minor #14223 [Form] Fix BC break introduced in #14050 (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Fix BC break introduced in #14050

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

Commits
-------

f3dbb5d [Form] Fix BC break introduced in #14050
2015-04-05 20:44:45 +02:00
Nicolas Grekas
f3dbb5dea2 [Form] Fix BC break introduced in #14050 2015-04-05 20:38:35 +02:00
Nicolas Grekas
607dedde35 minor #14221 Fix symfony/form dependend components (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

Fix symfony/form dependend components

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

Because both the FrameworkBundle and the Doctrine bridge use the new choice list feature of 2.7, they are incompatible with Form below 2.7

Commits
-------

278f5c9 Fix symfony/form dependend components
2015-04-05 19:48:08 +02:00
Nicolas Grekas
69eae1d206 minor #14222 [Form] Fix declaration of legacy tests (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Fix declaration of legacy tests

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

Commits
-------

4a74aba [Form] Fix declaration of legacy tests
2015-04-05 19:45:50 +02:00
Nicolas Grekas
4a74aba4e8 [Form] Fix declaration of legacy tests 2015-04-05 19:42:33 +02:00
Nicolas Grekas
278f5c9872 Fix symfony/form dependend components 2015-04-05 19:12:53 +02:00
Nicolas Grekas
fc0dd83c17 minor #14214 [Bridge\PhpUnit] Relax silencing rule and fix phpunit runtime detection (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Bridge\PhpUnit] Relax silencing rule and fix phpunit runtime detection

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

This PR removes the need to call `$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);` in tests that are already tagged as legacy. We needed them while drafting our deprecation policy, but that's only burden to me now.

This PR also fixes the way we detect if phpunit is running the test suite for projects that have phpunit in their composer.json's require-dev

Commits
-------

8dc9be3 [Bridge\PhpUnit] Relax silencing rule and fix phpunit runtime detection
2015-04-05 18:11:54 +02:00
Nicolas Grekas
2b6d08749b minor #14216 [HttpKernel] Require symfony/debug < 3.0 (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[HttpKernel] Require symfony/debug < 3.0

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

The deprecated Exception\FlattenException relies on symfony/debug < 3.0

Commits
-------

ea312e7 [HttpKernel] Require symfony/debug < 3.0
2015-04-05 17:51:22 +02:00
Nicolas Grekas
ea312e744d [HttpKernel] Require symfony/debug < 3.0 2015-04-05 12:03:21 +02:00
Nicolas Grekas
8dc9be3db0 [Bridge\PhpUnit] Relax silencing rule and fix phpunit runtime detection 2015-04-05 11:41:58 +02:00
Nicolas Grekas
045433c7c4 Merge branch '2.6' into 2.7
* 2.6:
  [VarDumper] Towards PHP7 support

Conflicts:
	src/Symfony/Component/VarDumper/Caster/ExceptionCaster.php
	src/Symfony/Component/VarDumper/Tests/CliDumperTest.php
	src/Symfony/Component/VarDumper/Tests/HtmlDumperTest.php
2015-04-05 09:48:59 +02:00
Maxime COLIN
c0ef55219d Update logger.html.twig 2015-04-04 23:40:04 +02:00
Fabien Potencier
80546293af bug #14204 [VarDumper] Towards PHP7 support (nicolas-grekas)
This PR was merged into the 2.6 branch.

Discussion
----------

[VarDumper] Towards PHP7 support

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

That's a start

Commits
-------

df484da [VarDumper] Towards PHP7 support
2015-04-04 20:55:32 +02:00
Fabien Potencier
af548e4948 feature #14198 Automatically start server:run if server:start failed (WouterJ)
This PR was merged into the 2.7 branch.

Discussion
----------

Automatically start server:run if server:start failed

After this PR, `server:start` will ask the user if it wants to start `server:run` automatically. If yes, the `server:run` command is executed and the server is started. If no, the command exits with `1`.

Example of Yes:
```
$ php app/console server:start
This command needs the pcntl extension to run.
You can either install it or use the server:run command instead to run the built-in web server.
Do you want to start server:run immediately? [Yn]
Server running on http://127.0.0.1:8000

Quit the server with CONTROL-C.
```
Example of No:
```
$ php app/console server:start
This command needs the pcntl extension to run.
You can either install it or use the server:run command instead to run the built-in web server.
Do you want to start server:run immediately? [Yn] n

$ ...
```

I've created this PR, because documentation currently still has to promote `server:run` to be safe. You don't want to tell people, "use `server:start`" and have them getting an error immediately (please note that starting the server is probably the first action with Symfony). Example: https://github.com/symfony/symfony-demo/pull/17

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

Commits
-------

f95d89c Automatically start server:run if server:start failed
2015-04-04 20:53:42 +02:00
Abdellatif Ait boudad
4d1344c6a9 bug #14210 [Translation][Profiler] fixed Collect empty Messages. (aitboudad)
This PR was merged into the 2.7 branch.

Discussion
----------

[Translation][Profiler] fixed Collect empty Messages.

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

Commits
-------

e965e59 [Translation][Profiler] fixed Collect empty Messages.
2015-04-04 18:24:59 +01:00
Abdellatif Ait boudad
e965e59920 [Translation][Profiler] fixed Collect empty Messages. 2015-04-04 17:28:09 +01:00
Nicolas Grekas
df484dadfc [VarDumper] Towards PHP7 support 2015-04-04 17:06:57 +02:00
Fabien Potencier
33ff623cb0 Merge branch '2.6' into 2.7
* 2.6:
  Fix currently broken tests
2015-04-04 14:23:51 +02:00
Fabien Potencier
c29f779ede bug #14205 Fix currently broken tests (mpdude)
This PR was submitted for the 2.7 branch but it was merged into the 2.6 branch instead (closes #14205).

Discussion
----------

Fix currently broken tests

Glitch from 8f72338513

Commits
-------

1122160 Fix currently broken tests
2015-04-04 14:23:37 +02:00
Matthias Pigulla
1122160d9e Fix currently broken tests 2015-04-04 14:23:36 +02:00
Abdellatif Ait boudad
fb514b6f30 feature #13651 [2.7][Form][choice] added choice_translation_domain to avoid trans options. (aitboudad)
This PR was merged into the 2.7 branch.

Discussion
----------

[2.7][Form][choice] added choice_translation_domain to avoid trans options.

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

see https://github.com/symfony/symfony/issues/12941#issuecomment-72904531

Commits
-------

5a33c2c [Form][choice] added choice_translation_domain to avoid trans options.
2015-04-04 10:11:30 +01:00
Abdellatif Ait boudad
04ad2a73b2 feature #14185 [Translation][Profiler]added the number of times a translation has been used. (aitboudad)
This PR was merged into the 2.7 branch.

Discussion
----------

[Translation][Profiler]added the number of times a translation has been used.

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

Commits
-------

b470a5b [Translation][Profiler]  added the number of times a translation has been used.
2015-04-04 10:06:11 +01:00
Abdellatif Ait boudad
5a33c2ca2e [Form][choice] added choice_translation_domain to avoid trans options. 2015-04-03 23:13:58 +01:00
Abdellatif Ait boudad
b470a5bfb6 [Translation][Profiler] added the number of times a translation has been used. 2015-04-03 20:54:19 +01:00
Fabien Potencier
be0c98efaf minor #14200 [Form] Updated CHANGELOG and UPGRADE files (webmozart)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] Updated CHANGELOG and UPGRADE files

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

This PR includes the changes from #14050 in the CHANGELOG/UPGRADE files.

Commits
-------

6863ba5 [Form] Updated CHANGELOG and UPGRADE files
2015-04-03 19:03:03 +02:00
Fabien Potencier
53fa5e375d feature #13717 Deprecated precision option in favor of scale (WouterJ)
This PR was merged into the 2.7 branch.

Discussion
----------

Deprecated precision option in favor of scale

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

Scale is the number of digits to the right of the decimal point in a number, precision isn't. See the referenced ticket for more context.

Commits
-------

2a2f7e2 Deprecated precision option in favor of scale
2015-04-03 19:01:25 +02:00
Bernhard Schussek
8945bcce77 minor #14202 [DoctrineBridge] Removed useless code (webmozart)
This PR was merged into the 2.7 branch.

Discussion
----------

[DoctrineBridge] Removed useless code

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

This PR removes a useless (duplicate) check introduced in #14050.

Commits
-------

d851a05 [DoctrineBridge] Removed useless code
2015-04-03 18:23:44 +02:00
Bernhard Schussek
d851a0550a [DoctrineBridge] Removed useless code 2015-04-03 17:48:01 +02:00
Fabien Potencier
d0676afa72 feature #14159 [Debug] Add symfony_debug_backtrace() and use it when dealing with fatal errors (jpauli, nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Debug] Add symfony_debug_backtrace() and use it when dealing with fatal errors

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

This takes a subset of #12159 that would be great in 2.7, and uses it to gather back traces of fatal errors when possible.

Commits
-------

5cbd9fe [Debug] Updated CHANGELOG
beb88f7 [Debug] Use symfony_debug_backtrace() in FatalErrorException when available
6487b6e [Debug] Add debug extension to the test suite
eacdc62 [Debug] Add symfony_debug_backtrace() that works with fatal errors
2015-04-03 17:40:20 +02:00
Nicolas Grekas
5cbd9fe207 [Debug] Updated CHANGELOG 2015-04-03 17:33:45 +02:00
Nicolas Grekas
beb88f7590 [Debug] Use symfony_debug_backtrace() in FatalErrorException when available 2015-04-03 17:33:45 +02:00
Nicolas Grekas
6487b6e07b [Debug] Add debug extension to the test suite 2015-04-03 17:33:45 +02:00
Julien Pauli
eacdc626ae [Debug] Add symfony_debug_backtrace() that works with fatal errors 2015-04-03 17:33:43 +02:00