Commit Graph

31060 Commits

Author SHA1 Message Date
Dany Maillard
3d58ab5bad [Console] Fix bar width with multilines ProgressBar's format 2017-04-25 10:15:09 -04:00
Fabien Potencier
81f48b80f3 bug #22435 [Console] Fix dispatching throwables from ConsoleEvents::COMMAND (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Console] Fix dispatching throwables from ConsoleEvents::COMMAND

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

Exceptions thrown by `ConsoleEvents::COMMAND` listeners should be trigger `ConsoleEvents::EXCEPTION` events.
(best reviewed [ignoring whitespaces](https://github.com/symfony/symfony/pull/22435/files?w=1))

Commits
-------

6d6b04ae97 [Console] Fix dispatching throwables from ConsoleEvents::COMMAND
2017-04-25 10:03:21 -04:00
Fabien Potencier
b9ee33fd03 bug #22457 [DI] Allow service subscribers to leverage autowiring to know where their locator should be injected (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Allow service subscribers to leverage autowiring to know where their locator should be injected

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

Commits
-------

e407b3d42e [DI] Allow service subscribers to leverage autowiring to know where the locator should be injected
2017-04-25 09:50:48 -04:00
Fabien Potencier
63dca040e6 bug #22487 [Process] Fix BC break: "exec" should remain an internal "detail" (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Process] Fix BC break: "exec" should remain an internal "detail"

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

Commits
-------

eedcece20b [Process] Fix BC break: "exec" should remain an internal "detail"
2017-04-25 09:44:56 -04:00
Nicolas Grekas
60c51d9775 minor #22507 Fix Framework UPGRADE notice about trusted proxies (sstok)
This PR was squashed before being merged into the 3.3-dev branch (closes #22507).

Discussion
----------

Fix Framework UPGRADE notice about trusted proxies

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

The `framework.trusted_proxies` configuration is not really removed (it gives an error) but that's only to help with the upgrade process. So I think mentioning it's removed is enough.

Commits
-------

ae94d01 Fix Framework UPGRADE notice about trusted proxies
2017-04-25 09:36:18 -04:00
Sebastiaan Stok
ae94d019c1 Fix Framework UPGRADE notice about trusted proxies 2017-04-25 09:36:16 -04:00
Fabien Potencier
11ac234bb7 bug #22500 [DotEnv] Don't override existing $_SERVER vars (Pierstoval, javiereguiluz)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DotEnv] Don't override existing $_SERVER vars

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

As of #22493 I decided to make a PR in order to add a specific test just for this behavior and make sure we never touch `$_SERVER` predefined variables.

Commits
-------

e5758317b1 Update a test value for consistency
0a95d89ed7 Minor changes to make tests more readable
3bf7e490b0 [DotEnv] Don't override existing $_SERVER vars
2017-04-25 09:21:28 -04:00
Alex Rock Ancelet
e5758317b1
Update a test value for consistency 2017-04-24 12:32:00 +02:00
Javier Eguiluz
0a95d89ed7
Minor changes to make tests more readable 2017-04-24 12:31:34 +02:00
Alex Rock Ancelet
3bf7e490b0
[DotEnv] Don't override existing $_SERVER vars 2017-04-24 12:31:34 +02:00
Lukas Kahwe Smith
045a36b303
add Request type json check in json_login 2017-04-24 08:23:15 +02:00
Fabien Potencier
3471b58318 bug #22496 [DI] Fix inlining conflict by restricting IteratorArgument to Reference[] (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Fix inlining conflict by restricting IteratorArgument to Reference[]

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

`Reference` found in `ArgumentInterface::getValue()` are currently not inlined.
While trying to do so (hint: I failed), I noticed that the current code is broken for `IteratorArgument` which can contain anonymous `Definition` for now, which are then not inlined correctly.

This PR restricts `IteratorArgument` to arrays of `Reference`, and improves a few related things found while doing it.

(fabbot failure is false positive)

Commits
-------

4d3dce1c0f [DI] Fix inlining conflict by restricting IteratorArgument to Reference[]
2017-04-23 15:36:34 -07:00
Fabien Potencier
93b7530f20 bug #22478 [Serializer] XmlEncoder: fix negative int and large numbers handling (dunglas)
This PR was merged into the 2.7 branch.

Discussion
----------

[Serializer] XmlEncoder: fix negative int and large numbers handling

| Q             | A
| ------------- | ---
| Branch?       | 2.7 <!-- 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 | #22329, #22333 <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | n/a

Alternative to #22333.

* Negative integers are now handled
* Float are now handled
* Large numbers are converted to float (as the `JsonEncoder` and native PHP functions like `ceil` do)

@vlastv, I've adapted your test. Can you check if it fixes your problem?

Commits
-------

1eeadb0c98 [Serializer] XmlEncoder: fix negative int and large numbers handling
2017-04-23 15:32:35 -07:00
Fabien Potencier
3d4b212a09 bug #22494 [Security] Fix json_login default success/failure handling (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Security] Fix json_login default success/failure handling

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

This makes the `json_login` listener default configuration stateless oriented by:

- Not using the default (redirect based) failure handler, it returns a 401 (json) response containing the failure reason instead
- Not using the default (redirect based) success handler, just let the original request continue instead (reaching the targeted resource without being redirected).
- Setting `require_previous_session` to `false` by default (I have to set it on `form-login` each time I want it to be stateless)
- Removing the options related to redirections (`default_target_path`, `login_path`, ...) from the listener factory, if one wants redirections then one has to write its own handlers, not the inverse

Commits
-------

9749618ff5 Fix json_login default success/failure handling
2017-04-23 15:21:45 -07:00
Fabien Potencier
dc924363fe bug #22491 Fixed the rendering of exceptions inside the profiler (javiereguiluz)
This PR was merged into the 3.3-dev branch.

Discussion
----------

Fixed the rendering of exceptions inside the profiler

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

In #22448 we tried to reuse the same CSS styles as the new exception pages. But that's not enough because it doesn't look good:

![before](https://cloud.githubusercontent.com/assets/73419/25250100/a287b4bc-2614-11e7-88e7-e0ef89eac1ff.png)

---

This PR goes a bit further and tweaks the exception styles slightly to better integrate them. Same page as before:

![after_1](https://cloud.githubusercontent.com/assets/73419/25250131/b8d16cf4-2614-11e7-93b4-187248849103.png)

It should also work reasonably well when the exception message is very long:

![after_2](https://cloud.githubusercontent.com/assets/73419/25250144/c25eab38-2614-11e7-99e2-843548d12810.png)

Commits
-------

73d81de6d2 Fixed the rendering of exceptions inside the profiler
2017-04-21 18:44:26 -06:00
Nicolas Grekas
4d3dce1c0f [DI] Fix inlining conflict by restricting IteratorArgument to Reference[] 2017-04-21 14:38:43 +02:00
Nicolas Grekas
5cabf880d6 [DI] Add missing check in PhpDumper 2017-04-21 13:48:46 +02:00
Robin Chalas
9749618ff5 Fix json_login default success/failure handling 2017-04-21 10:18:17 +02:00
Robin Chalas
883723ef53 Show private aliases in debug:container 2017-04-21 00:49:45 +02:00
Javier Eguiluz
73d81de6d2 Fixed the rendering of exceptions inside the profiler 2017-04-20 21:57:39 +02:00
Fabien Potencier
59f3f34cc8 minor #22485 [HttpKernel] sync upgrade files (xabbuh)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[HttpKernel] sync upgrade files

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

Commits
-------

a90e46188f sync upgrade files
2017-04-20 11:34:39 -06:00
Fabien Potencier
26bc96ea77 fixed CS 2017-04-20 11:21:47 -06:00
Fabien Potencier
f730ffae49 feature #22234 [DI] Introducing autoconfigure: automatic _instanceof configuration (weaverryan)
This PR was squashed before being merged into the 3.3-dev branch (closes #22234).

Discussion
----------

[DI] Introducing autoconfigure: automatic _instanceof configuration

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes (mostly, a continuation of a new feature)
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/issues/7538

This is a proposal to allow the user to opt into some automatic `_instanceof` config. Suppose I want to auto-tag all of my voters and event subscribers

```yml
# current
services:
    _defaults:
        autowire: true

    _instanceof:
        Symfony\Component\Security\Core\Authorization\Voter\VoterInterface:
            tags: [security.voter]

        Symfony\Component\EventDispatcher\EventSubscriberInterface:
            tags: [kernel.event_subscriber]

    # services using the above tags
    AppBundle\Security\PostVoter: ~
    AppBundle\EventListener\CheckRequirementsSubscriber: ~
```

If I'm registering a service with a class that implements `VoterInterface`, when would I ever *not* want that to be tagged with `security.voter`? Here's the proposed code:

```yml
# proposed
services:
    _defaults:
        autowire: true
        autoconfigure: true

    # services using the auto_configure_instanceof functionality
    AppBundle\Security\PostVoter: ~
    AppBundle\EventListener\CheckRequirementsSubscriber: ~
```

The user must opt into this and it only applies locally to this configuration file. It works because each enabled bundle would have the opportunity to add one or more "automatic instanceof" definitions - e.g. SecurityBundle would add the `security.voter` instanceof config, FrameworkBundle would add the `kernel.event_subscriber` instanceof config, etc.

For another example, you can check out the proposed changes to `symfony-demo` - symfony/symfony-demo#483 - the `_instanceof` section is pretty heavy: 81694ac21e/app/config/services.yml (L20)

Thanks!

Commits
-------

18627bf9f6 [DI] Introducing autoconfigure: automatic _instanceof configuration
2017-04-20 11:20:32 -06:00
Ryan Weaver
18627bf9f6 [DI] Introducing autoconfigure: automatic _instanceof configuration 2017-04-20 11:20:30 -06:00
Fabien Potencier
ad86e2dff0 feature #21502 Persist app bootstrapping logs for logger datacollector (ScullWM, nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

Persist app bootstrapping logs for logger datacollector

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

Logs generated during the container build are catched by the BufferingLogger with a special flag.

They are persist by the LoggerDataCollector and are available in the logger profiler.
In the profiler toolbar, the "container build" logs increment the current logs counter (even if the container was previously built).

<img width="540" alt="capture d ecran 2017-02-01 a 20 56 40" src="https://cloud.githubusercontent.com/assets/1017746/22523826/0bc12e4a-e8c1-11e6-830f-7f6238ea7423.png">

<img width="1022" alt="capture d ecran 2017-02-01 a 20 57 55" src="https://cloud.githubusercontent.com/assets/1017746/22523859/2c48a698-e8c1-11e6-9bdb-d85f3e692938.png">

The BufferingLogger now require the cachePath and the filesystem to persist a (unique) container build logs.
If the current workflow is ok, I will update the test coverage (actually they fail). Maybe we can display the appDevDebugProjectContainerCompiler.log content in that logger profile.

Commits
-------

2fd18b5503 [VarDumper] Fine tune dumping log messages
ce3ef6a96e Persist app bootstrapping logs for logger datacollector
2017-04-20 11:12:40 -06:00
Fabien Potencier
f9bb4dccb8 minor #22480 [DI] Reduce memory overhead of id normalization (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Reduce memory overhead of id normalization

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

Commits
-------

1dd3285c91 [DI] Reduce memory overhead of id normalization
2017-04-20 11:03:47 -06:00
Nicolas Grekas
eedcece20b [Process] Fix BC break: "exec" should remain an internal "detail" 2017-04-20 19:01:24 +02:00
Fabien Potencier
589d9aa74f minor #22436 Fixed formatting in Security section (in UPGRADE-3.0.md) (zelazowy)
This PR was merged into the 3.3-dev branch.

Discussion
----------

Fixed formatting in Security section (in UPGRADE-3.0.md)

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

Added space (yeah...) to Security section fixing text and code format.

Commits
-------

3bde16c84a Fixed formatting in Security section
2017-04-20 09:41:38 -06:00
Nicolas Grekas
f80631eb0b minor #22486 [FrameworkBundle] clarify constraint for the Asset component (xabbuh)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[FrameworkBundle] clarify constraint for the Asset component

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

The conflict rule already forbids installing releases before 3.3 of the
Asset component. This will bring the constraint in the `require-dev`
section inline with the conflict rule.

Commits
-------

35fe02f clarify constraint for the Asset component
2017-04-20 16:35:59 +02:00
Christian Flothmann
35fe02f101 clarify constraint for the Asset component
The conflict rule already forbids installing releases before 3.3 of the
Asset component. This will bring the constraint in the `require-dev`
section inline with the conflict rule.
2017-04-20 15:59:31 +02:00
Christian Flothmann
a90e46188f sync upgrade files 2017-04-20 15:57:24 +02:00
Nicolas Grekas
c97b08e6c0 [FrameworkBundle] Restore 3.2-like behavior for FormPass, to help BC with Sonata 2017-04-20 15:25:36 +02:00
Nicolas Grekas
1dd3285c91 [DI] Reduce memory overhead of id normalization 2017-04-20 10:02:26 +02:00
Fabien Potencier
9c0067b19f bug #22322 [Console] Fix fatal error when logging console.error without command (chalasr)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[Console] Fix fatal error when logging console.error without command

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

Happens now that the console.error event is dispatched on command not found, I  ran into using `server:run` on 3.3 without `web-server-bundle` enabled:

> PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function getName() on null

In this case, this first tries to cast the event input as string (less good than when the command name is available, there're extra quotes around the command name) and, if can't be casted, uses a generic message.

Commits
-------

97129fc611 Fix fatal error when logging console.error without a command
2017-04-19 17:40:30 -06:00
Kévin Dunglas
1eeadb0c98
[Serializer] XmlEncoder: fix negative int and large numbers handling 2017-04-19 22:42:09 +02:00
Nicolas Grekas
a84f59e644 Merge branch '3.2'
* 3.2:
  fix merge
2017-04-19 22:29:26 +02:00
Nicolas Grekas
8fcc9e6638 fix merge 2017-04-19 22:29:12 +02:00
Nicolas Grekas
04ae502b0d Merge branch '3.2'
* 3.2:
  Make .travis.yml more readable
  Fold Travis CI output by component
  [VarDumper] Minor tweaks to html/css dumps
  Add trhows PHPDoc in Application::run
  [Debug] Set exit status to 255 on error
  [HttpFoundation] Store IANA's RNG files in the repository
  [PropertyInfo] Remove a useless call to count() in SerializerExtractor
  [PropertyInfo] Prevent returning int values in some cases.
  [HttpFoundation] Fix getClientIp @return docblock
  Add @throws phpdoc
  unify PHPUnit config files
2017-04-19 22:25:39 +02:00
Nicolas Grekas
fc195dc4f9 Merge branch '2.8' into 3.2
* 2.8:
  Make .travis.yml more readable
  Fold Travis CI output by component
  Add trhows PHPDoc in Application::run
  [Debug] Set exit status to 255 on error
  [HttpFoundation] Store IANA's RNG files in the repository
  [PropertyInfo] Remove a useless call to count() in SerializerExtractor
  [PropertyInfo] Prevent returning int values in some cases.
  [HttpFoundation] Fix getClientIp @return docblock
  Add @throws phpdoc
  unify PHPUnit config files
2017-04-19 22:17:50 +02:00
Nicolas Grekas
9af7354e13 Merge branch '2.7' into 2.8
* 2.7:
  Make .travis.yml more readable
  Fold Travis CI output by component
  Add trhows PHPDoc in Application::run
  [Debug] Set exit status to 255 on error
  [HttpFoundation] Store IANA's RNG files in the repository
  [HttpFoundation] Fix getClientIp @return docblock
  Add @throws phpdoc
  unify PHPUnit config files
2017-04-19 21:56:30 +02:00
Nicolas Grekas
e407b3d42e [DI] Allow service subscribers to leverage autowiring to know where the locator should be injected 2017-04-19 21:52:02 +02:00
Roland Franssen
ba650783f5 [SecurityBundle] Enhance FirewallContext::getListeners() 2017-04-19 20:32:53 +02:00
Fabien Potencier
bc6128b486 minor #22461 Fold Travis CI output by component (maidmaid, nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

Fold Travis CI output by component

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

Trying some tweaks on top of #22252

Commits
-------

cf87678a2e Make .travis.yml more readable
7a9b086d56 Fold Travis CI output by component
2017-04-19 10:46:17 -06:00
Fabien Potencier
df155dd5b4 bug #22470 [SecurityBundle] conditionally register user checker FQCN alias (xabbuh)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[SecurityBundle] conditionally register user checker FQCN alias

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

Commits
-------

eede70a8a2 conditionally register user checker FQCN alias
2017-04-19 10:21:45 -06:00
Fabien Potencier
610a2385f6 feature #22459 [HttpKernel] Fix deprecation of Extension::addClassesToCompile() / AddClassesToCachePass (nicolas-grekas)
This PR was merged into the 3.3-dev branch.

Discussion
----------

[HttpKernel] Fix deprecation of Extension::addClassesToCompile() / AddClassesToCachePass

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

As done in https://github.com/symfony/symfony/pull/20735

Commits
-------

f4b5784dd9 [HttpKernel] Fix deprecation of Extension::addClassesToCompile() / AddClassesToCachePass
2017-04-19 10:18:46 -06:00
Christian Flothmann
eede70a8a2 conditionally register user checker FQCN alias 2017-04-19 15:35:51 +02:00
Nicolas Grekas
cf87678a2e Make .travis.yml more readable 2017-04-19 14:51:17 +02:00
Nicolas Grekas
0c73c5d1f3 [Cache] Keep only hit/miss (not values) in TraceableAdapter/Cache 2017-04-19 11:39:36 +02:00
Fabien Potencier
6c7bceda81 bug #22425 [Security] Allow to set a check_path on json_login listener (chalasr)
This PR was squashed before being merged into the 3.3-dev branch (closes #22425).

Discussion
----------

[Security] Allow to set a check_path on json_login listener

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

The listener should allow to restrict authentication to a given check_path, as stated in the docs http://symfony.com/doc/master/security/json_login_setup.html

Commits
-------

9f7eb618a4 [Security] Allow to set a check_path on json_login listener
2017-04-18 16:20:19 -06:00
Robin Chalas
9f7eb618a4 [Security] Allow to set a check_path on json_login listener 2017-04-18 16:20:11 -06:00