Commit Graph

15463 Commits

Author SHA1 Message Date
Fabien Potencier
da9bee08e4 [Console] added a compact layout for the table helper 2013-10-02 09:34:37 +02:00
Fabien Potencier
e9ea73311f [Console] added an exception when the padding char is empty to avoid a PHP error in the table helper 2013-10-02 09:34:00 +02:00
Fabien Potencier
04d767db56 fixed CS 2013-10-01 19:34:40 +02:00
Fabien Potencier
e47677edd5 minor #8487 [FrameworkBundle] The config:dump-reference command shows the list of bundles with the table helper (saro0h)
This PR was merged into the master branch.

Discussion
----------

[FrameworkBundle] The config:dump-reference command shows the list of bundles with the table helper

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no

Commits
-------

31c6c62 [FrameworkBundle] The config:dump-reference command shows the list of bundles with the table helper
2013-10-01 19:32:30 +02:00
Fabien Potencier
f8f8816e4b Merge branch '2.3'
* 2.3:
  Fix: duplicate usage of Symfony\Component\HttpFoundation\Response
  [Form] add support for Length and Range constraint in order to replace MaxLength, MinLength, Max and Min constraints in next release (2.3)
  Revert "merged branch Tobion/flattenexception (PR #9111)"
  [Form] check the required output timezone against the actual timezone of the input datetime object, rather than the expected timezone supplied

Conflicts:
	src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php
2013-10-01 16:17:10 +02:00
Fabien Potencier
82f6a62bb3 Merge branch '2.2' into 2.3
* 2.2:
  Fix: duplicate usage of Symfony\Component\HttpFoundation\Response
2013-10-01 16:16:42 +02:00
Fabien Potencier
ffe2fb9993 bug #9190 Fix: duplicate usage of Symfony\Component\HttpFoundation\Response (realsim)
This PR was submitted for the master branch but it was merged into the 2.2 branch instead (closes #9190).

Discussion
----------

Fix: duplicate usage of Symfony\Component\HttpFoundation\Response

Duplicate usage of Symfony\Component\HttpFoundation\Response causes an error:
> PHP Fatal error:  Cannot use Symfony\Component\HttpFoundation\Response as Response because the name is already in use in src/Symfony/Component/Security/Http/Authorization/AccessDeniedHandlerInterface.php on line 17

Commits
-------

e602c09 Fix: duplicate usage of Symfony\Component\HttpFoundation\Response
2013-10-01 16:15:08 +02:00
simpson
70cbfc3180 Fix: duplicate usage of Symfony\Component\HttpFoundation\Response 2013-10-01 16:15:07 +02:00
Fabien Potencier
31fb8c7cc3 feature #7887 [FrameworkBundle] adds routing/container descriptors (jfsimon)
This PR was squashed before being merged into the master branch (closes #7887).

Discussion
----------

[FrameworkBundle] adds routing/container descriptors

The goal of this PR is to add descriptors (as in #7454) for routing and container. This will permit add a `--format` option to `router:debug` and `container:debug` commands (with `txt`, `json`, `xml` and `md` formats).

Commits
-------

22f9bc8 [FrameworkBundle] adds routing/container descriptors
2013-10-01 16:13:14 +02:00
Jean-François Simon
22f9bc887e [FrameworkBundle] adds routing/container descriptors 2013-10-01 16:13:13 +02:00
Fabien Potencier
47d080dbd6 feature #8835 [Console] Fixed verbose option when passing verbosity level as option value (deguif)
This PR was squashed before being merged into the master branch (closes #8835).

Discussion
----------

[Console] Fixed verbose option when passing verbosity level as option value

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

Currently passing a verbosity level to verbose option on console doesn't work unless using the shotcuts _-v_, _-vv_, _-vvv_.

This also fix _accept_value_ in the xml generated by __console help --xml__ for people using the xml output ;)

Commits
-------

a28eb8b [Console] Fixed verbose option when passing verbosity level as option value
2013-10-01 15:40:57 +02:00
François-Xavier de Guillebon
a28eb8b561 [Console] Fixed verbose option when passing verbosity level as option value 2013-10-01 15:34:25 +02:00
Fabien Potencier
b0687c8d81 Merge branch '2.2' into 2.3
* 2.2:
  [Form] add support for Length and Range constraint in order to replace MaxLength, MinLength, Max and Min constraints in next release (2.3)
  [Form] check the required output timezone against the actual timezone of the input datetime object, rather than the expected timezone supplied
2013-10-01 14:47:27 +02:00
Fabien Potencier
a2d6419762 bug #9188 [2.2][Form] add support for Length and Range constraint in ValidatorTypeGuesser (franek)
This PR was merged into the 2.2 branch.

Discussion
----------

[2.2][Form] add support for Length and Range constraint in ValidatorTypeGuesser

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

MaxLength, MinLength, Min and Max constraints are deprecated on 2.2. Will be removed in 2.3.

Add support for type guessing of Length and Range constraints.

fix #9132 on 2.2 branch

Commits
-------

89a0404 [Form] add support for Length and Range constraint in order to replace MaxLength, MinLength, Max and Min constraints in next release (2.3)
2013-10-01 14:45:50 +02:00
Fabien Potencier
abb765f135 minor #8927 [Templating] fix logic regarding template references and many phpdocs (Tobion)
This PR was squashed before being merged into the master branch (closes #8927).

Discussion
----------

[Templating] fix logic regarding template references and many phpdocs

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

this clarifies the expected types and exceptions by much. and it fixes some logic flaws.
- missing info/methods in interfaces
- respecting Twig_LoaderInterface only accepting strings, not objects

related to fabpot/Twig#1183 but does not depend on it

Commits
-------

f6c12bd [Templating] fix logic regarding template references and many phpdocs
2013-10-01 14:37:06 +02:00
Tobias Schultze
f6c12bd6de [Templating] fix logic regarding template references and many phpdocs 2013-10-01 14:37:05 +02:00
franek
89a040434e [Form] add support for Length and Range constraint in order to replace MaxLength, MinLength, Max and Min constraints in next release (2.3) 2013-10-01 14:21:02 +02:00
Fabien Potencier
10a88cd2cd feature #9186 [Console] Throw an exception if the command does not contain aliases (lyrixx)
This PR was merged into the master branch.

Discussion
----------

[Console] Throw an exception if the command does not contain aliases

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

It can only happend if the constructor has been overridden

Commits
-------

7e5c901 [Console] Throw an exception if the command does not contain aliases
2013-10-01 12:30:10 +02:00
Grégoire Pineau
7e5c9011c9 [Console] Throw an exception if the command does not contain aliases
It can only happend if the constructor has been overridden
2013-10-01 12:29:09 +02:00
Fabien Potencier
554d57b399 bug#9146 [RC][Form] Let null values clear fields in PATCH requests (alex88)
This PR was merged into the master branch.

Discussion
----------

[RC][Form] Let null values clear fields in PATCH requests

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

I've changed the way form checks wherever or not to submit childs by checking submitted data with array_key_exists and not with just isset.

This way in PATCH requests values are not processed when they are not in array and not also when the value is null. Currently there is no way to null a value with a PATCH request, even passing it null.

This can lead to some BC breaks depending on how users used form in their code.

Commits
-------

f5812c5 [Form] Let null values to unset fields in PATCH requests
2013-10-01 10:38:18 +02:00
Fabien Potencier
112fa5eeed feature#8637 [DomCrawler] Allowed internal validation of ChoiceFormField to be disabled (pylebecq)
This PR was squashed before being merged into the master branch (closes #8637).

Discussion
----------

[DomCrawler] Allowed internal validation of ChoiceFormField to be disabled

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

Hi,

Here is a quite basic attempt to be able to disable the internal validation of the ChoiceFormField. It's pretty basic.
Feel free to tell me what you think guys. Maybe I should check the `validationDisabled` property at the beginning of the `containsOption()` method ?
I'll make the documentation PR as soon as the implementation will be validated.

Regards.

Commits
-------

739bf71 [DomCrawler] Allowed internal validation of ChoiceFormField to be disabled
2013-10-01 10:36:55 +02:00
Pierre-Yves LEBECQ
739bf715c7 [DomCrawler] Allowed internal validation of ChoiceFormField to be disabled 2013-10-01 10:36:54 +02:00
Alessandro Tagliapietra
f5812c5e40 [Form] Let null values to unset fields in PATCH requests 2013-10-01 10:31:32 +02:00
Fabien Potencier
b85b78f24a bug#9183 [Security] Fixed test cases of the Csrf sub-component (bschussek)
This PR was merged into the master branch.

Discussion
----------

[Security] Fixed test cases of the Csrf sub-component

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

Commits
-------

7c7d86e [Security] Fixed test cases of the Csrf sub-component
2013-10-01 10:20:34 +02:00
Bernhard Schussek
7c7d86e369 [Security] Fixed test cases of the Csrf sub-component 2013-10-01 10:18:52 +02:00
Fabien Potencier
2cd6e002c7 feature#8957 [HttpFoundation] added a way to override the Request class (fabpot)
This PR was merged into the master branch.

Discussion
----------

[HttpFoundation] added a way to override the Request class

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #7461, #7453
| License       | MIT
| Doc PR        | symfony/symfony-docs#3021

This is an alternative implementation for #7461.

I've also reverted #7381 and #7390 as these changes are not needed anymore.

Todo:

 - [ ] add some tests

Commits
-------

464439d [HttpFoundation] added a way to override the Request class
2013-10-01 07:05:57 +02:00
Fabien Potencier
464439d195 [HttpFoundation] added a way to override the Request class 2013-09-30 22:35:02 +02:00
Fabien Potencier
d80e840b7f [Console] added some tests for previous merge (refs #8626) 2013-09-30 21:59:36 +02:00
Fabien Potencier
ad7be73e40 feature#8626 [Console] pass command name automatically if required by the application (xabbuh)
This PR was submitted for the 2.2 branch but it was merged into the master branch instead (closes #8626).

Discussion
----------

[Console] pass command name automatically if required by the application

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

Commits
-------

50c8050 [Console] pass command name automatically if required by the application
2013-09-30 21:44:36 +02:00
Christian Flothmann
81aead238b pass command name automatically if required by the application 2013-09-30 21:44:35 +02:00
Fabien Potencier
426559f65e feature#9119 [HttpFoundation] Add a way to avoid the session be written at each request (adrienbrault)
This PR was merged into the master branch.

Discussion
----------

[HttpFoundation] Add a way to avoid the session be written at each request

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no (maybe the DI config ?)
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/3017

Commits
-------

38f02ea [HttpFoundation] Add a way to avoid the session be written at each request
2013-09-30 21:42:39 +02:00
Adrien Brault
38f02eacbf [HttpFoundation] Add a way to avoid the session be written at each request 2013-09-30 12:03:12 -07:00
Fabien Potencier
1893478dd5 feature#9119 [HttpFoundation] Add a way to avoid the session be written at each request (adrienbrault)
This PR was merged into the master branch.

Discussion
----------

[HttpFoundation] Add a way to avoid the session be written at each request

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no (maybe the DI config ?)
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/3017

Commits
-------

191418d [HttpFoundation] Add a way to avoid the session be written at each request
2013-09-30 19:51:08 +02:00
Adrien Brault
191418d24d [HttpFoundation] Add a way to avoid the session be written at each request 2013-09-30 10:45:51 -07:00
Fabien Potencier
c886612c99 fixed some unit tests 2013-09-30 19:16:09 +02:00
Fabien Potencier
c741c5838d fixed typos 2013-09-30 17:49:53 +02:00
Fabien Potencier
bdcdc6eddb feature#9170 Decoupled TraceableEventDispatcher from the Profiler (fabpot)
This PR was merged into the master branch.

Discussion
----------

Decoupled TraceableEventDispatcher from the Profiler

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

This PR removes the Profiler dependency on the TraceableEventDispatcher. That makes things more decoupled and cleaner. This PR also cleans up how profiles are stored; a Profile is now always stored only once.

I've created a `LateDataCollectorInterface` that is implemented for data collector that needs to get information from data that are available very late in the request process (when the request and the response are not even available anymore). The `lateCollect()` method is called just before the profile is stored.

We have 3 data collectors that implement that interface:

 * Time: As the traceable event dipsatcher gets inject timing information via the stopwatch about all events (including the `terminate` one), we need to get events from the stopwatch as late as possible.
 * Event: The traceable event dispatcher gathers all called listeners to determine non-called ones. To be able to accurately do that for all events (including the `terminate` one), we need to get the data as late as possible.
 * Memory: We want to get the memory as late as possible to get the most accurate number as possible

I'm not very happy with the name and as always, better suggestions would be much appreciated.

This is an extract from #9168

Commits
-------

5cedea2 [HttpKernel] added LateDataCollectorInterface
9c4bc9a [HttpKernel] decoupled TraceableEventDispatcher and Profiler
2013-09-30 17:42:20 +02:00
Fabien Potencier
0f80916313 feature#6554 [Security] Added Security\Csrf sub-component with better token generation (bschussek)
This PR was merged into the master branch.

Discussion
----------

[Security] Added Security\Csrf sub-component with better token generation

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

**Update September 27, 2013**

This PR simplifies the CSRF mechanism to generate completely random tokens. A random token is generated once per ~~intention~~ token ID and then stored in the session. Tokens are valid until the session expires.

Since the CSRF token generator depends on `StringUtils` and `SecureRandom` from Security\Core, and since Security\Http currently depends on the Form component for token generation, I decided to add a new Security\Csrf sub-component that contains the improved CSRF token generator. Consequences:

* Security\Http now depends on Security\Csrf instead of Form
* Form now optionally depends on Security\Csrf
* The configuration for the "security.secure_random" service and the "security.csrf.*" services was moved to FrameworkBundle to guarantee BC

In the new Security\Csrf sub-component, I tried to improve the naming where I could do so without breaking BC:

* CSRF "providers" are now called "token generators"
* CSRF "intentions" are now called "token IDs", because that's really what they are

##### TODO

- [ ] The documentation needs to be checked for references to the configuration of the application secret. Remarks that the secret is used for CSRF protection need to be removed.
- [ ] Add aliases "csrf_token_generator" and "csrf_token_id" for "csrf_provider" and "intention" in the SecurityBundle configuration
- [x] Make sure `SecureRandom` never blocks for `CsrfTokenGenerator`

Commits
-------

7f02304 [Security] Added missing PHPDoc tag
2e04e32 Updated Composer dependencies to require the Security\Csrf component where necessary
bf85e83 [FrameworkBundle][SecurityBundle] Added service configuration for the new Security CSRF sub-component
2048cf6 [Form] Deprecated the CSRF implementation and added an optional dependency to the Security CSRF sub-component instead
85d4959 [Security] Changed Security HTTP sub-component to depend on CSRF sub-component instead of Form
1bf1640 [Security] Added CSRF sub-component
2013-09-30 17:35:08 +02:00
Fabien Potencier
164c1cbfec feature#9171 [Form] Rewrite boolean attributes to match HTML spec (bschussek)
This PR was merged into the master branch.

Discussion
----------

[Form] Rewrite boolean attributes to match HTML spec

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

Same as #7856

> 'The presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value.' - http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#boolean-attribute

This commit modifies widget_container_attributes and widget_attributes so that:

* `true` values render as the attribute name with the attribute name repeated as the value
* `false` values are not rendered

The comparison is strict using sames() in twig.

Previously `false` values would have been rendered as `some-attribute=""` which according to the spec would actually make them a boolean attribute and therefore equal to true.

Commits
-------

b85577b [Form] Improved test coverage of widget_attributes and widget_container_attributes blocks
8e4c2a7 [Form] Rewrite boolean attributes to match HTML spec
2013-09-30 15:57:18 +02:00
Bernhard Schussek
7f02304654 [Security] Added missing PHPDoc tag 2013-09-30 15:41:48 +02:00
Bernhard Schussek
2e04e32c8f Updated Composer dependencies to require the Security\Csrf component where necessary 2013-09-30 14:39:06 +02:00
Bernhard Schussek
b85577bb96 [Form] Improved test coverage of widget_attributes and widget_container_attributes blocks 2013-09-30 14:32:22 +02:00
Leevi Graham
8e4c2a7e65 [Form] Rewrite boolean attributes to match HTML spec
'The presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value.'

- http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#boolean-attribute
2013-09-30 14:07:49 +02:00
Fabien Potencier
e281d7748e bug#8809 [Form] enforce correct timezone (Burgov)
This PR was merged into the 2.2 branch.

Discussion
----------

[Form] enforce correct timezone

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | not sure if this is a BC break...
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

I'm using the Form component to handle JSON requests which come from AJAX requests. The JSON is formed by the Angular toJson method

A typical request would be:
```
{
  name: "Some name"
  start: "2013-08-21T05:00:00.000Z"
  end: "2013-08-21T15:00:00.000Z"
}
```

Note that in this case, what I entered in my input boxes are 7:00 for start and 17:00 for end times. As you can see, Angular (or Chrome, I'm not sure), converts this to the "Z" timezone. Since I cannot enforce the correct timezone client side, the timezone will differ from the one configured in the DateTimeType, however, instead of resulting in either an error or a conversion to the correct timezone, I get a datetime object in the wrong timezone, eventually resulting in wrong values in the database.

By checking the required output timezone against the actual timezone of the input datetime object, rather than the expected timezone supplied, this problem is solved.

Commits
-------

b0349a1 [Form] check the required output timezone against the actual timezone of the input datetime object, rather than the expected timezone supplied
2013-09-30 12:22:54 +02:00
Fabien Potencier
e0d3573454 Revert "merged branch Tobion/flattenexception (PR #9111)"
This reverts commit 53b2048c4c, reversing
changes made to c60a8e962b.
2013-09-30 11:54:26 +02:00
Fabien Potencier
5cedea2c07 [HttpKernel] added LateDataCollectorInterface 2013-09-30 10:54:48 +02:00
Fabien Potencier
9c4bc9a0ed [HttpKernel] decoupled TraceableEventDispatcher and Profiler 2013-09-30 10:52:26 +02:00
Fabien Potencier
59409b47c8 fixed wrong merge 2013-09-29 21:54:28 +02:00
Fabien Potencier
d10dec9bf3 Merge branch '2.3'
* 2.3:
  fixed Client when using the terminable event
  Fix problem with Windows file links (backslash in JavaScript string)
  [Security] fixed wrong phpdoc
  [DependencyInjection] Prevented inlining of lazy loaded private service definitions.
  [Routing] removed extra argument
  [HttpFoundation] Header `HTTP_X_FORWARDED_PROTO` can contain various values Some proxies use `ssl` instead of `https`, as well as Lighttpd mod_proxy allows value chaining (`https, http`, where `https` is always first when request is encrypted).
  Added doc comments

Conflicts:
	src/Symfony/Component/Routing/Router.php
	src/Symfony/Component/Security/Http/Firewall.php
2013-09-29 21:43:28 +02:00
Fabien Potencier
bc256f9da4 Merge branch '2.2' into 2.3
* 2.2:
  fixed Client when using the terminable event
  Fix problem with Windows file links (backslash in JavaScript string)
  [Security] fixed wrong phpdoc
  [Routing] removed extra argument
  [HttpFoundation] Header `HTTP_X_FORWARDED_PROTO` can contain various values Some proxies use `ssl` instead of `https`, as well as Lighttpd mod_proxy allows value chaining (`https, http`, where `https` is always first when request is encrypted).
  Added doc comments

Conflicts:
	src/Symfony/Component/HttpFoundation/Request.php
2013-09-29 21:41:41 +02:00