Commit Graph

15413 Commits

Author SHA1 Message Date
Fabien Potencier
181e460984 minor #10241 [DependencyInjection] made some perf improvements (fabpot)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[DependencyInjection] made some perf improvements

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

This PR optimizes the creation of dumped containers drastically (thanks @jpauli for the hint).

The Container class generated by the PHP dumper does not include the `getDefaultParameters()` method anymore. It does not seem like a big deal to me as I fail to see a use case where someone would override this method.

Commits
-------

e1a3ef8 [DependencyInjection] made some perf improvements
2014-09-26 07:01:55 +02:00
Alex Bakhturin
10f9135f63 [Finder] [Iterator] Make the tests less fragile 2014-09-26 06:59:53 +02:00
grifx
707623cb16 Update the Controller to be consistent
We are always using $this->container->get() and now we're using the short-cut sometimes to access to a service.
It could be nice to stay with $this->container->get(), so for those who copy and paste the Controller to create a ControllerUtils, they wont have to change it (in fact neither ControllerUtils::get() nor ControllerUtils::has() exists).
See: http://www.whitewashing.de/2013/06/27/extending_symfony2__controller_utilities.html
2014-09-26 11:35:02 +10:00
Fabien Potencier
c06e7546ad feature #7142 [2.3] Update src/Symfony/Component/HttpFoundation/Request.php (datibbaw)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[2.3] Update src/Symfony/Component/HttpFoundation/Request.php

This makes `getContentType()` work when a regular form is submitted. It would return `"form"`

Commits
-------

c81ec4d Update src/Symfony/Component/HttpFoundation/Request.php
2014-09-25 21:49:28 +02:00
Jacob Dreesen
1226dc121f [Security] fix typo 2014-09-25 21:08:05 +02:00
Fabien Potencier
37711c74c1 feature #11453 [Config] Allow extra hint in exception message (WouterJ)
This PR was squashed before being merged into the 2.6-dev branch (closes #11453).

Discussion
----------

[Config] Allow extra hint in exception message

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

Commits
-------

3062b3e [Config] Allow extra hint in exception message
2014-09-25 20:11:49 +02:00
WouterJ
3062b3ef96 [Config] Allow extra hint in exception message 2014-09-25 20:11:47 +02:00
Fabien Potencier
7c24188f02 [FrameworkBundle] added a compiler pass for expression language providers 2014-09-25 19:08:39 +02:00
Fabien Potencier
4195a91d46 [Routing] added support for custom expression language functions 2014-09-25 19:08:39 +02:00
Fabien Potencier
1a39046e8b [Security] added support for custom expression language functions 2014-09-25 19:08:39 +02:00
Fabien Potencier
79bcd52b6b [DependencyInjection] added support for custom expression language functions 2014-09-25 19:08:38 +02:00
Fabien Potencier
184742c7a9 [ExpressionLanguage] added ExpressionFunction and ExpressionFunctionProviderInterface 2014-09-25 19:08:38 +02:00
Fabien Potencier
15dfb0614e feature #12036 [Debug] Add link to the output of debug function (lyrixx)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Debug] Add link to the output of debug function

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

![link](https://cloud.githubusercontent.com/assets/408368/4403994/98f89526-44ab-11e4-8fa8-85b58afb738a.png)
![lin2](https://cloud.githubusercontent.com/assets/408368/4403998/abbabee6-44ab-11e4-9117-f786718dfb37.png)

Commits
-------

dadd2fe [Debug] Add link to the output of debug function
2014-09-25 17:51:11 +02:00
Bernhard Schussek
69deac3014 Merge branch '2.5'
* 2.5:
  [Validator] Added ConstraintValidator::buildViolation() helper for BC with 2.4 API
  [Validator] Fixed LegacyValidator when only a constraint is validated

Conflicts:
	src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php
	src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php
	src/Symfony/Component/Validator/Constraints/RangeValidator.php
2014-09-25 17:49:37 +02:00
Grégoire Pineau
dadd2fe6c6 [Debug] Add link to the output of debug function 2014-09-25 16:41:33 +02:00
Fabien Potencier
af0aa501e8 feature #11993 [Security] make it possible to override the default success/failure handler (fabpot)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Security] make it possible to override the default success/failure handler

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #5432, #9272, #10417, #11926
| License       | MIT
| Doc PR        | symfony/symfony-docs#4258

Overriding the default success/failure handler of the security firewalls is possible via the `success_handler` and `failure_handler` setting but this approach is not flexible as it does not allow you to get the options/provider key.

To sum up the problem:

* Overriding the default success/failure handler is possible via a service;
* When not overridden, the default success/failure handler gets options and the provider key;
* Those options and the provider key are injected by the factory as they are dynamic (they depend on the firewall and the provider key), so getting those options/provider key is not possible for a custom service that is only configured via the container configuration;
* Extending the default handler does not help as the injection mechanism is only triggered when no custom provider is set;
* Wrapping the default handler is not possible as the service id is dynamic.

... and of course we need to keep BC and make it work for people extending the default handler but also for people just using the interface.

Instead of the current PR, I propose this slightly different approach. It's not perfect, but given the above constraint, I think this is an acceptable trade-of.

So, several use cases:

 * Using the default handler (no change);
 * Using a custom handler that implements `AuthenticationSuccessHandlerInterface` directly and does not need any options (no change);
 * Using a custom handler that needs the options/provider key (that's the new use case this PR supports).

This PR introduces 2 new classes that wrap custom handlers. If those classes define the `setOptions()` and/or `setProviderKey()` methods, they are automatically called with the correct arguments. Yours handler does not need to extend the default handler `DefaultAuthentication*Handler`, but doing so helps as the setters are already defined there.

Commits
-------

810eeaf [Security] made it possible to override the default success/failure handler (take 2)
36116fc [Security] made it possible to override the default success/failure handler
2014-09-25 16:21:08 +02:00
Fabien Potencier
d7615e70d2 bug #12016 [Validator] Added ConstraintValidator::buildViolation() helper for BC with the 2.4 API (webmozart)
This PR was merged into the 2.5 branch.

Discussion
----------

[Validator] Added ConstraintValidator::buildViolation() helper for BC with the 2.4 API

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

This PR adds a `buildViolation()` helper method to the base `ConstraintValidator` to remove the API checks (2.4 vs. 2.5) from the constraint validator implementations. Once the 2.4 API is removed, this helper method will be removed as well.

**Todos**

- [x] Backport changes from #12021

Commits
-------

6b0c24a [Validator] Added ConstraintValidator::buildViolation() helper for BC with 2.4 API
2014-09-25 16:01:10 +02:00
Fabien Potencier
07b234e1c7 bug #12031 [Validator] Fixed LegacyValidator when only a constraint is validated (webmozart)
This PR was merged into the 2.5 branch.

Discussion
----------

[Validator] Fixed LegacyValidator when only a constraint is validated

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

The 2.5-BC API is currently broken for the following use case:

```php
$validator->validate($value, $constraint);
```

This is fixed now.

Commits
-------

1d48206 [Validator] Fixed LegacyValidator when only a constraint is validated
2014-09-25 15:54:04 +02:00
Eric GELOEN
ea4ae74011 [Form][DateTime] Propagate invalid_message & invalid_message parameters to date & time sub widgets 2014-09-25 15:00:50 +02:00
Bernhard Schussek
b4dcd500dd feature #9033 [Form] Choice children can be template customized like collection (adrienbrault)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Form] Choice children can be template customized like collection

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

I wanted to customize the template of a children of a choice field. I learned it was not currently possible, though it is with the collection type. So this should let people be able to customize the template for all the choice children at once.

Ie:

```jinja
{% block _user_colors_entry_widget %}
```

Still have to fix the tests

Commits
-------

4e6b27f [Form] Choice children can be template customized like collection
2014-09-25 13:44:59 +02:00
Bernhard Schussek
6b0c24adf7 [Validator] Added ConstraintValidator::buildViolation() helper for BC with 2.4 API 2014-09-25 12:25:17 +02:00
Bernhard Schussek
88a25fc817 Merge branch '2.5'
* 2.5:
  [Command] Set the process title as late as possible
  [Form] Removed constructor argument from FormTypeHttpFoundationExtension for forward compatibility with 2.5
  [Validator] Simplified testing of violations
  remove obsolete test file
  [FrameworkBundle] output failed matched path for clarification
  bug #10242 Missing checkPreAuth from RememberMeAuthenticationProvider
  [Validator] Fixed StaticMethodLoaderTest to actually test something
  [Form] Fixed ValidatorTypeGuesser to guess properties without constraints not to be required
  Use request format from request in twig ExceptionController
  fixed bug
  added the possibility to return null from SimplePreAuthenticationListener
  [Form] Moved POST_MAX_SIZE validation from FormValidator to request handler
  [Form] Add a form error if post_max_size has been reached.
  Response::isNotModified returns true when If-Modified-Since is later than Last-Modified
  [WebProfilerBundle] turbolinks compatibility

Conflicts:
	src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php
2014-09-25 12:18:55 +02:00
Fabien Potencier
da4e85e1c6 bug #12030 Fix expression language in the container when using the "container" variable (fabpot)
This PR was squashed before being merged into the 2.4 branch (closes #12030).

Discussion
----------

Fix expression language in the container when using the "container" variable

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

See #11995 for the description of the problem.

Commits
-------

2b2f0df Fix expression language in the container when using the "container" variable
2014-09-25 11:55:41 +02:00
Fabien Potencier
2b2f0df27e Fix expression language in the container when using the "container" variable 2014-09-25 11:55:38 +02:00
Grégoire Pineau
44997d35af [Command] Set the process title as late as possible
To be able to customize to process title in the `initialize`
method of the current command with some arguments or option
2014-09-25 11:53:56 +02:00
Bernhard Schussek
c48ae250ac Merge branch '2.4' into 2.5
* 2.4:
  [Form] Removed constructor argument from FormTypeHttpFoundationExtension for forward compatibility with 2.5
  [Validator] Simplified testing of violations
  remove obsolete test file
  [FrameworkBundle] output failed matched path for clarification
  bug #10242 Missing checkPreAuth from RememberMeAuthenticationProvider
  [Validator] Fixed StaticMethodLoaderTest to actually test something
  [Form] Fixed ValidatorTypeGuesser to guess properties without constraints not to be required
  Use request format from request in twig ExceptionController
  fixed bug
  added the possibility to return null from SimplePreAuthenticationListener
  [Form] Moved POST_MAX_SIZE validation from FormValidator to request handler
  [Form] Add a form error if post_max_size has been reached.
  Response::isNotModified returns true when If-Modified-Since is later than Last-Modified
  [WebProfilerBundle] turbolinks compatibility

Conflicts:
	src/Symfony/Component/Form/Extension/Core/Type/FormType.php
	src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php
	src/Symfony/Component/Form/Extension/Validator/Util/ServerParams.php
	src/Symfony/Component/Security/Core/Tests/Authentication/Provider/RememberMeAuthenticationProviderTest.php
	src/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php
2014-09-25 11:52:29 +02:00
Fabien Potencier
efb1237b72 Merge branch '2.3' into 2.4
* 2.3:
  [Form] Removed constructor argument from FormTypeHttpFoundationExtension for forward compatibility with 2.5
  [Validator] Simplified testing of violations
2014-09-25 11:38:53 +02:00
Fabien Potencier
87123f6e1d minor #12015 [Validator] Simplified testing of violations (webmozart)
This PR was merged into the 2.3 branch.

Discussion
----------

[Validator] Simplified testing of violations

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

I simplified the assertion of violations in preparation of a replacement PR for #7276.

Commits
-------

8e5537b [Validator] Simplified testing of violations
2014-09-25 11:38:09 +02:00
Bernhard Schussek
6cbc862e19 [Form] Removed constructor argument from FormTypeHttpFoundationExtension for forward compatibility with 2.5 2014-09-25 11:29:33 +02:00
Bernhard Schussek
8e5537b8a5 [Validator] Simplified testing of violations 2014-09-25 11:17:44 +02:00
Fabien Potencier
43b83cf8db Merge branch '2.3' into 2.4
* 2.3:
  remove obsolete test file
  [FrameworkBundle] output failed matched path for clarification
  bug #10242 Missing checkPreAuth from RememberMeAuthenticationProvider
  [Validator] Fixed StaticMethodLoaderTest to actually test something
  [Form] Fixed ValidatorTypeGuesser to guess properties without constraints not to be required
  Use request format from request in twig ExceptionController
  [Form] Moved POST_MAX_SIZE validation from FormValidator to request handler
  [Form] Add a form error if post_max_size has been reached.
  Response::isNotModified returns true when If-Modified-Since is later than Last-Modified
  [WebProfilerBundle] turbolinks compatibility

Conflicts:
	src/Symfony/Component/Form/CHANGELOG.md
	src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php
	src/Symfony/Component/Security/Core/Tests/Authentication/Provider/RememberMeAuthenticationProviderTest.php
2014-09-25 10:51:47 +02:00
Bernhard Schussek
1d48206b45 [Validator] Fixed LegacyValidator when only a constraint is validated 2014-09-25 09:57:44 +02:00
Fabien Potencier
cc396fffde feature #10694 [Security] Call AuthenticationManager in AnonymousAuthenticationListener (Kacper Gunia)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Security] Call AuthenticationManager in AnonymousAuthenticationListener

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

Commits
-------

78fa5e2 Call AuthenticationManager in AnonymousAuthenticationListener
2014-09-25 09:10:47 +02:00
Fabien Potencier
499c1ddb95 fixed a unit test 2014-09-25 09:09:09 +02:00
Fabien Potencier
fc1592a8c8 feature #11949 [Console] More consistent application description (secondtruth)
This PR was squashed before being merged into the 2.6-dev branch (closes #11949).

Discussion
----------

[Console] More consistent application description

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

Commits
-------

28edd30 [Console] More consistent application description
2014-09-25 09:07:34 +02:00
Christian Neff
28edd30007 [Console] More consistent application description 2014-09-25 09:07:30 +02:00
Fabien Potencier
108f929a14 feature #11951 New php library structure made easier (pyrech)
This PR was merged into the 2.6-dev branch.

Discussion
----------

New php library structure made easier

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

[This article](https://medium.com/@christophewillemsen/stop-making-bundles-think-bundles-deadd27b88c0) from @ikwattro gives some good ideas on how to ease the creation of a PHP package:
- which is not a bundle usable only on a symfony full stack framework
- without requiring to maintain 2 repos (one for the lib and the other for the bundle)

The only drawback is that Symfony requires the DI extension to be on a given location. So I created a new method Bundle#getContainerExtensionClass than can be easily overwritten if you want to move the Extension class in another directory.

Commits
-------

8eda6b5 New php library structure made easier
2014-09-25 09:05:01 +02:00
Fabien Potencier
d671406ae5 minor #12017 [Validator] Fixed StaticMethodLoaderTest to actually test something (webmozart)
This PR was merged into the 2.3 branch.

Discussion
----------

[Validator] Fixed StaticMethodLoaderTest to actually test something

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

This test is not testing anything, except for whether PHP throws a strict standards error when invalid code is loaded.

I disabled error reporting for this test, so that the actual functionality (ignoring static+abstract functions) is tested.

Commits
-------

1b1303a [Validator] Fixed StaticMethodLoaderTest to actually test something
2014-09-25 09:03:01 +02:00
Fabien Potencier
240648ddcb minor #12013 [FrameworkBundle] Added unit-tests for GlobalVariables::getUser() (iltar)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[FrameworkBundle] Added unit-tests for GlobalVariables::getUser()

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

Tests added should explain that `getUser()` should return `null` when a string is found as user. If this is not correct, a PR should be made. However, this would result in a huge BC break due to people using `{% if app.user %}` which would return `null` if an anonymous token was found. If this suddenly returns a string, this check will fail.

While at it, I have also added `getUser()` tests to verify the unhappy flow is working. These tests uncovered that  if `$container->get('security.token_storage')` fails, it will throw an exception rather than return `null`. This issue is now fixed.

List of changes
--------------------
- The old `testGetUser` has been refactored to be tested with multiple variations of return types to verify the return type to work as the code tells.
- `get('security.token_storage')` is now only executed if `has('security.token_storage')` returns true

@fabpot I think this PR should be merged before 2.6, because it fixes an uncaught exception bug in my previous PR which splits the security context

Commits
-------

3f055f7 Fixed a bug and added unit-tests for GlobalVariables
2014-09-25 08:52:12 +02:00
Fabien Potencier
45ac2c4522 minor #12026 [FrameworkBundle] output failed matched path for clarification (Tobion)
This PR was merged into the 2.3 branch.

Discussion
----------

[FrameworkBundle] output failed matched path for clarification

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

Because cygwin resolves the path behind the scenes, it is otherwise very unclear what path is actually used for matching.

Commits
-------

8d13af7 [FrameworkBundle] output failed matched path for clarification
2014-09-25 08:43:41 +02:00
Fabien Potencier
1104112c04 feature #12022 [HttpKernel] Extract method to instantiate controller in ControllerResolver (danharper)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[HttpKernel] Extract method to instantiate controller in ControllerResolver

Replaces #10814 to merge into `master` instead of `2.3`.

---

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

Currently it's required to duplicate the entirety of the `getController()` and `createController()` methods just to replace the call to `new` (e.g. with container resolution, instead).

Now it's possible to just override the `instantiateController()` method.

Commits
-------

88274df [HttpKernel] Extract method to make callable controller in ControllerResolver
2014-09-25 08:41:43 +02:00
Tobias Schultze
83f556f0f9 remove obsolete test file 2014-09-25 02:08:46 +03:00
Tobias Schultze
8d13af77db [FrameworkBundle] output failed matched path for clarification 2014-09-25 01:57:27 +03:00
Abdellatif Ait boudad
6e1b47c3fd [FrameworkBundle]Ignore LoggingTranslatorPass if there is no Translator definition. 2014-09-24 22:15:22 +01:00
Fabien Potencier
e1a3ef8b3f [DependencyInjection] made some perf improvements 2014-09-24 17:32:45 +02:00
Mathieu Morlon
a38d1cd8bf bug #10242 Missing checkPreAuth from RememberMeAuthenticationProvider 2014-09-24 17:03:18 +02:00
Iltar van der Berg
3f055f706c Fixed a bug and added unit-tests for GlobalVariables 2014-09-24 16:46:33 +02:00
Fabien Potencier
cc04ce15c0 feature #9708 [Serializer] PropertyNormalizer: a new normalizer that maps an object's properties to an array (mnapoli)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Serializer] PropertyNormalizer: a new normalizer that maps an object's properties to an array

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        | if PR is deemed mergeable, I'll write the docs

This PR adds a new Normalizer for the Serializer component: **`PropertyNormalizer`**.

Currently the only normalizer is `GetSetMethodNormalizer`, which calls getters and setters. This new serializer uses the properties values directly.

This is especially useful if you write a webservice and take/return very simple DTO (Data Transfer Objects) which role is only to act like a "named" `stdClass`. Every property is public (the class doesn't contain any logic), and mapping that to an array is pretty easy.

This normalizer takes into account public, but also *private* and *protected* properties.

FYI I've based most of the code of `GetSetMethodNormalizer`.

Commits
-------

78ceed1 [Serializer] Added PropertyNormalizer, a new normalizer that maps an object's properties to an array
2014-09-24 16:31:38 +02:00
Bernhard Schussek
1b1303a8d8 [Validator] Fixed StaticMethodLoaderTest to actually test something 2014-09-24 16:07:14 +02:00
Fabien Potencier
bc8ee6f497 bug #12004 [Form] Fixed ValidatorTypeGuesser to guess properties without constraints not to be required (webmozart)
This PR was merged into the 2.3 branch.

Discussion
----------

[Form] Fixed ValidatorTypeGuesser to guess properties without constraints not to be required

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

Consider the following entity:

```php
class Author
{
    /**
     * @Assert\NotBlank
     */
    private $name;

    private $age;
}
```

Right now, the "required" HTML attribute is set for both fields (since the default value of the "required" option is true). IMO this is wrong.

With this fix, the ValidatorTypeGuesser guesses `false` for the "required" option unless a NotNull/NotBlank constraint is present.

Commits
-------

fd77b09 [Form] Fixed ValidatorTypeGuesser to guess properties without constraints not to be required
2014-09-24 14:19:03 +02:00
Bernhard Schussek
fd77b09fba [Form] Fixed ValidatorTypeGuesser to guess properties without constraints not to be required 2014-09-24 14:11:43 +02:00
Fabien Potencier
c2e3ee84b4 feature #12000 [WebProfilerBundle] Show AJAX requests in the symfony profiler toolbar (Burgov, fabpot, stof)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[WebProfilerBundle] Show AJAX requests in the symfony profiler toolbar

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

Adds AJAX requests in the web debug toolbar.
See #8896 for the original discussion.

![image](https://cloud.githubusercontent.com/assets/47313/4384087/43d1feb2-43b0-11e4-99c9-3e50e19e623f.png)

Commits
-------

16d1b35 optimized JS for the AJAX section of the toolbar
2e708d7 made minor tweaks to JS code
8e4c603 replaced the AJAX icon with a smaller one
b66f39a removed hack
9c74fcc removed uneeded web_profiler.debug_toolbar.excluded_ajax_paths parameter in the container
d43edaf [WebProfilerBundle] improved the ajax section of the WDT
37f7dd7 [WebProfilerBundle] Show AJAX requests in the symfony profiler toolbar
2014-09-24 13:56:29 +02:00
Christophe Coevoet
16d1b35958 optimized JS for the AJAX section of the toolbar 2014-09-24 13:54:08 +02:00
Fabien Potencier
71b8c396a1 feature #12005 [Validator] Added "payload" option to all constraints for attaching domain-specific data (webmozart)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Validator] Added "payload" option to all constraints for attaching domain-specific data

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

The "payload" option can be used to pass whatever data should be attached to a constraint for an application:

```php
/**
 * Domain-specific error codes
 * @NotNull(payload="100")
 */

/**
 * Structured domain-specific data
 * @NotNull(payload={"display": "inline", "highlight": false})
 */
```

The term "payload" is borrowed from JSR-303.

Commits
-------

e8b7c6d [Validator] Added "payload" option to all constraints for attaching domain-specific data
2014-09-24 13:45:32 +02:00
Loick Piera
8eda6b5b5e New php library structure made easier 2014-09-24 12:42:02 +02:00
Fabien Potencier
1ebf82f88b feature #12008 [DependencyInjection] Add a new Syntax to define factories as callables (realityking, fabpot)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[DependencyInjection] Add a new Syntax to define factories as callables

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

From the original PR #9839:

"This pull requests adds a new syntax to define factories based on the syntax for configurators. This is more flexible than the old syntax (factoryMethod and either of factoryClass or factoryService), as it also allows for functions as factories.

Since the service is now a Reference to a Definition it also allows us to inline factories for a small performance improvement and better encapsulation.

Lastly this prevents a bug where a private factory is simple removed because it's not referenced in the graph.

I did not change any of the existing definitions (there's one use of a factory in FrameworkBundle) or automatically use the new internal representation when parsing YAML or XML definitions because this could introduce subtle B/C issues.
"

Commits
-------

187aeee fixed CS
bd8531d added a new Syntax to define factories as callables.
2014-09-24 11:28:39 +02:00
Abdellatif AitBoudad
e371bd7739 [Translation][changelog] fix typo. 2014-09-24 09:44:29 +01:00
Abdellatif Ait boudad
b7770bcfd0 [Translation] added LoggingTranslator. 2014-09-24 10:36:39 +02:00
Fabien Potencier
187aeeeaf7 fixed CS 2014-09-24 10:31:33 +02:00
Fabien Potencier
a7f867f984 removed non-tests 2014-09-24 09:55:31 +02:00
Iltar van der Berg
b967787185 Split of the SecurityContext to AuthorizationChecker and TokenStorage 2014-09-24 09:31:49 +02:00
Vyacheslav Salakhutdinov
24c5ba4df3 Use request format from request in twig ExceptionController 2014-09-24 09:29:50 +02:00
Rouven Weßling
bd8531d2d8 added a new Syntax to define factories as callables. 2014-09-24 08:27:41 +02:00
Fabien Potencier
6ad5d31dd8 bug #11924 [Form] Moved POST_MAX_SIZE validation from FormValidator to request handler (rpg600, webmozart)
This PR was merged into the 2.3 branch.

Discussion
----------

[Form] Moved POST_MAX_SIZE validation from FormValidator to request handler

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

Commits
-------

759ae1a [Form] Moved POST_MAX_SIZE validation from FormValidator to request handler
4780210 [Form] Add a form error if post_max_size has been reached.
2014-09-24 08:12:14 +02:00
Fabien Potencier
810eeafa6e [Security] made it possible to override the default success/failure handler (take 2) 2014-09-24 08:04:46 +02:00
Fabien Potencier
2e708d75e2 made minor tweaks to JS code 2014-09-24 08:00:56 +02:00
Fabien Potencier
8e4c603bc5 replaced the AJAX icon with a smaller one 2014-09-24 07:57:33 +02:00
Fabien Potencier
faa8e98063 fixed bug 2014-09-24 07:52:20 +02:00
Fabien Potencier
4ee2e93109 feature #12003 [Form] Renamed the option "empty_value" to "placeholder" (webmozart)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Form] Renamed the option "empty_value" to "placeholder"

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

This PR is changing the "empty_value" option to the more understandable name "placeholder".

In a subsequent PR, the "placeholder" option should also be added to all types that support the "placeholder" HTML5 attribute.

Commits
-------

2b440f3 [Form] Renamed the option "empty_value" to "placeholder"
2014-09-23 18:59:59 +02:00
Fabien Potencier
1b49368617 feature #10640 VarDumper and DebugBundle (jpauli, nicolas-grekas, ruian, moux2003, tony-co, romainneutron, oscherler, lyrixx)
This PR was merged into the 2.6-dev branch.

Discussion
----------

VarDumper and DebugBundle

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

From a user land point of view, this PR creates a global `dump()` function that is to be used instead of `var_dump()`. The component can be used standalone in any dev workflow. Please see the [provided README](https://github.com/symfony/symfony/pull/10640/files?short_path=52d526f#diff-52d526f19bc9e3825c80e7694755409c) for details.

When used with the Framework bundle, variables passed to `dump()` are dumped in a new dedicated panel in the web toolbar. The function is also available in twig templates.

Regarding the implementation, I'm pretty sure you'll find a lot to comment. As I'm sure of nothing else, not even the names of things, please do.

I tried to organize this PR in several commits, from the most fundamental algorithm to pure Symfony glue.
I suggest you follow this order while progressing in the review and the discussion around this PR, so that we can together validate commits one after the other.

Don't hesitate to fork the PR and submit PR on it, I'll cherry-pick your patches.

TODO:
- [x] open a doc PR: https://github.com/symfony/symfony-docs/pull/4243
- [x] open a PR on the Standard edition: https://github.com/symfony/symfony-standard/pull/710
- [x] prefix the CSS classes
- [x] tests for the DebugBundle + other Symfony glue classes
- [x] inline css and js for compat with e.g. Silex
- [x] finish and merge nicolas-grekas/Patchwork-Dumper#5 for better UX
- [x] show a dump excerpt on hovering the icon in the toolbar
- [x] verify README and comments
- [x] validate interfaces/names (Caster / Cloner / Dumper)
- [x] validate new VarDumper component + DebugBundle
- [x] validate Resource/ext/ vs independent repos.
- [x] test and define behavior after KernelEvents::RESPONSE
- [x] update dependencies between components/bundles and composer.json files
- [x] no hard dep on iconv

Not for this PR but might be worth later:
- show a light stack trace + timing + memory at debug() calls
- create a "theme" concept for custom colors/UX

Commits
-------

80fd736 [DebugBundle] Enhance some comments
2e167ba [TwigBridge] add Twig dump() function + tests and fixes
0f8d30f [VarDumper] Replace \e with \x1B in CliDumper to support colour in PHP < 5.4
d43ae82 [VarDumper] Add workaround to https://bugs.php.net/65967
a8d81e4 [DebugBundle] Inlined assets to avoid installation issues
5f59811 [DebugBundle] Add doc example for Twig usage
e4e00ef [TwigBridge] DumpNode and Token parser
de05cd9 [DebugBundle] enhance dump excerpts
49f13c6 [HttpKernel] add tests for DumpDataCollector
081363c [HttpKernel] tests for DumpListener
0d8a942 [VarDumper] add Stub objects for cutting cleanly and dumping consts
c8746a4 [DebugBundle] add tests for twig and for the bundle
8d5d970 [DebugBundle] adjust after review
eb98c81 [DebugBundle] dump() + better Symfony glue
9dea601 [DebugBundle] global dump() function for daily use
297d373 [VarDumper] README, LICENSE and composer.json
a69e962 [VarDumper] tests for HtmlDumper
5eaa187 [VarDumper] tests for CliDumper
e6dde33 [VarDumper] HTML variant of the CLI dumper
fa81544 [VarDumper] CLI dedicated dumper and related abstract
1d5e3f4 [VarDumper] interface for dumping collected variables
0266072 [VarDumper] casters for DOM objects
c426d8b [VarDumper] casters for Doctrine objects
0a92c08 [VarDumper] casters for PDO related objects
da3e50a [VarDumper] casters for SPL data structures
c91bc83 [VarDumper] casters for exceptions representation
3ddbf4b [VarDumper] add casters for per class/resource custom state extraction
5b7ae28 [VarDumper] symfony_debug ext. fast and memory efficient cloning algo
07135a0 [VarDumper] algo to clone any PHP variable to a breadth-first queue
4bf9300 [Debug] a README for the debug extension
eec5c92 [Debug] Symfony debug extension
2014-09-23 18:54:24 +02:00
Fabien Potencier
b66f39ab2d removed hack 2014-09-23 17:52:03 +02:00
Fabien Potencier
9c74fccacf removed uneeded web_profiler.debug_toolbar.excluded_ajax_paths parameter in the container 2014-09-23 17:52:03 +02:00
Fabien Potencier
d43edaf6a1 [WebProfilerBundle] improved the ajax section of the WDT 2014-09-23 17:52:02 +02:00
Bart van den Burg
37f7dd7483 [WebProfilerBundle] Show AJAX requests in the symfony profiler toolbar 2014-09-23 17:52:02 +02:00
Bernhard Schussek
e8b7c6dd24 [Validator] Added "payload" option to all constraints for attaching domain-specific data 2014-09-23 17:29:30 +02:00
Bernhard Schussek
2b440f3847 [Form] Renamed the option "empty_value" to "placeholder" 2014-09-23 16:46:44 +02:00
Grégoire Pineau
80fd736142 [DebugBundle] Enhance some comments 2014-09-23 16:26:00 +02:00
Nicolas Grekas
2e167ba351 [TwigBridge] add Twig dump() function + tests and fixes 2014-09-23 16:26:00 +02:00
Nicolas Grekas
de05cd97b9 [DebugBundle] enhance dump excerpts 2014-09-23 16:25:59 +02:00
Nicolas Grekas
49f13c6eab [HttpKernel] add tests for DumpDataCollector 2014-09-23 16:25:59 +02:00
Nicolas Grekas
081363cbd4 [HttpKernel] tests for DumpListener 2014-09-23 16:25:59 +02:00
Nicolas Grekas
0d8a942cfa [VarDumper] add Stub objects for cutting cleanly and dumping consts 2014-09-23 16:25:59 +02:00
Nicolas Grekas
c8746a43c9 [DebugBundle] add tests for twig and for the bundle 2014-09-23 16:25:59 +02:00
Nicolas Grekas
8d5d970eea [DebugBundle] adjust after review 2014-09-23 16:25:59 +02:00
Nicolas Grekas
eb98c81754 [DebugBundle] dump() + better Symfony glue 2014-09-23 16:25:59 +02:00
Nicolas Grekas
9dea601234 [DebugBundle] global dump() function for daily use 2014-09-23 16:25:57 +02:00
Fabien Potencier
ea6ce1c8af fixed typo 2014-09-23 16:20:22 +02:00
adenkejawen
e85cb7fe2a added the possibility to return null from SimplePreAuthenticationListener 2014-09-23 16:11:05 +02:00
Nicolas Grekas
297d3734f8 [VarDumper] README, LICENSE and composer.json 2014-09-23 14:30:52 +02:00
Nicolas Grekas
a69e962209 [VarDumper] tests for HtmlDumper 2014-09-23 14:30:52 +02:00
Nicolas Grekas
5eaa187f8b [VarDumper] tests for CliDumper 2014-09-23 14:30:52 +02:00
Nicolas Grekas
e6dde33940 [VarDumper] HTML variant of the CLI dumper 2014-09-23 14:30:52 +02:00
Nicolas Grekas
fa81544075 [VarDumper] CLI dedicated dumper and related abstract 2014-09-23 14:30:52 +02:00
Nicolas Grekas
1d5e3f4dc5 [VarDumper] interface for dumping collected variables 2014-09-23 14:30:52 +02:00
Nicolas Grekas
0266072bb3 [VarDumper] casters for DOM objects 2014-09-23 14:30:52 +02:00
Nicolas Grekas
c426d8bc09 [VarDumper] casters for Doctrine objects 2014-09-23 14:30:52 +02:00
Nicolas Grekas
0a92c08699 [VarDumper] casters for PDO related objects 2014-09-23 14:30:51 +02:00
Nicolas Grekas
da3e50a2bf [VarDumper] casters for SPL data structures 2014-09-23 14:30:51 +02:00
Nicolas Grekas
c91bc83c86 [VarDumper] casters for exceptions representation 2014-09-23 14:30:51 +02:00
Nicolas Grekas
3ddbf4b6b9 [VarDumper] add casters for per class/resource custom state extraction 2014-09-23 14:30:51 +02:00
Nicolas Grekas
5b7ae2862f [VarDumper] symfony_debug ext. fast and memory efficient cloning algo 2014-09-23 14:30:51 +02:00
Nicolas Grekas
07135a0959 [VarDumper] algo to clone any PHP variable to a breadth-first queue 2014-09-23 14:30:51 +02:00
Nicolas Grekas
4bf9300c09 [Debug] a README for the debug extension 2014-09-23 14:30:51 +02:00
Julien Pauli
eec5c92c35 [Debug] Symfony debug extension 2014-09-23 14:30:51 +02:00
Bernhard Schussek
759ae1a7a1 [Form] Moved POST_MAX_SIZE validation from FormValidator to request handler 2014-09-23 14:27:03 +02:00
Fabien Potencier
c3feed6df2 minor #11504 [WebProfilerBundle] turbolinks compatibility (DraCzris)
This PR was merged into the 2.3 branch.

Discussion
----------

[WebProfilerBundle] turbolinks compatibility

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

Fix profiler when using turbolinks. (Without this, profiler is rendered without assets)

Commits
-------

c65b4c7 [WebProfilerBundle] turbolinks compatibility
2014-09-23 12:52:48 +02:00
Fabien Potencier
aa594450d2 feature #11716 [OptionsResolver] Added a light-weight, low-level API for basic option resolving (webmozart)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[OptionsResolver] Added a light-weight, low-level API for basic option resolving

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

See [the updated documentation](https://github.com/webmozart/symfony-docs/blob/issue11705/components/options_resolver.rst) for details on the usage of the simple API.

The most important motivation for this change is DX and speed. The basic features of the component should be easily usable in a wide variety of use cases without impacting performance.

For DX reasons, I added the static methods to the `Options` class, which makes the code concise and easy to read and understand:

```php
use Symfony\Component\OptionsResolver\Options;

$options = Options::validateRequired($options, 'format');

$options = Options::validateTypes($options, array(
    'format' => array('string', 'int'),
    'calendar' => 'int',
));

$options = Options::validateValues($options, array(
    'calendar' => array(
        \IntlDateFormatter::GREGORIAN,
        \IntlDateFormatter::TRADITIONAL,
    ),
));

$options = Options::resolve($options, array(
    'format' => null,
    'calendar' => \IntlDateFormatter::GREGORIAN,
));
```

If you need to distribute the option configuration, this PR also extracts the configuration part of the `OptionsResolver` class into a new class `OptionsConfig`, which can be passed around. When the configuration is complete, pass the config object to `Options::resolve()` as second argument:

```php
$config = new OptionsConfig();

$config->setDefaults(array(
    'format' => \IntlDateFormatter::MEDIUM,
    'calendar' => \IntlDateFormatter::GREGORIAN,
));

$options = Options::resolve($options, $config);
```

Consequently - since `OptionsResolver` extends `OptionsConfig` - the two following statements now become identical:

```php
$options = $resolver->resolve($options);
$options = Options::resolve($options, $resolver);
```

Commits
-------

9066025 [OptionsResolver] Added a light-weight, low-level API for basic option resolving
2014-09-23 12:46:07 +02:00
rpg600
47802105d3 [Form] Add a form error if post_max_size has been reached. 2014-09-23 12:20:25 +02:00
Sergey Kolodyazhnyy
42ec76e9d0 Response::isNotModified returns true when If-Modified-Since is later than Last-Modified 2014-09-23 12:19:50 +02:00
Bernhard Schussek
ad171be6e9 [Form] Changed "allow_html5" to "html5" 2014-09-23 12:15:17 +02:00
Fabien Potencier
0050b8d458 feature #10698 [Security] Added a REMOTE_USER based listener to security firewalls (Maxime Douailin)
This PR was squashed before being merged into the 2.6-dev branch (closes #10698).

Discussion
----------

[Security] Added a REMOTE_USER based listener to security firewalls

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | /
| License       | MIT
| Doc PR        | symfony/symfony-docs#3912
TODO
- [x] submit changes to the documentation

I've seen myself implementing a few times a REMOTE_USER based authentication listener, as a large part of security modules for Apache (Kerberos, CAS, and more) are providing the username via an environment variable.

So I thought this could benefit the whole community if directly included in the framework. It is very similar to the X509AuthenticationListener, and basing the RemoteUserAuthenticationListener on the AbstractPreAuthenticatedListener is relevant and very convenient.

Using the X509AuthenticationListener could be possible, but it is confusing to use it directly when your authentication is not certificate based.

Please let me know if I need to update anything.

Regards

Commits
-------

a2872f2 [Security] Added a REMOTE_USER based listener to security firewalls
2014-09-23 11:54:13 +02:00
Maxime Douailin
a2872f21b9 [Security] Added a REMOTE_USER based listener to security firewalls 2014-09-23 11:54:11 +02:00
Fabien Potencier
1fb8f8817a feature #11183 [Security] add an AbstractVoter implementation (Inoryy)
This PR was squashed before being merged into the 2.6-dev branch (closes #11183).

Discussion
----------

[Security] add an AbstractVoter implementation

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

The idea is to reduce boilerplate required to create custom Voter, doing most of the work for the developer and guiding him on the path by providing simple requirements via abstract methods that will be called by the AbstractVoter.

P.S. This is meant to be a [DX Initiative](https://github.com/symfony/symfony/issues?labels=DX&state=open) improvement.

Commits
-------

d3bafc6 [Security] add an AbstractVoter implementation
2014-09-23 11:51:23 +02:00
Roman Marintšenko
d3bafc6b48 [Security] add an AbstractVoter implementation 2014-09-23 11:51:18 +02:00
Fabien Potencier
36116fccf6 [Security] made it possible to override the default success/failure handler 2014-09-23 11:07:07 +02:00
skafandri
7d6fbd99a2 [Console][Command][LogicException] The command name cannot be empty. #11991 2014-09-23 11:01:06 +02:00
Fabien Potencier
d059b1edae fixed CS 2014-09-23 08:31:13 +02:00
Fabien Potencier
0da03cf98b feature #8291 [Form] Add allow_html5 option to date and time FormType to disable HTML5 input type (csanquer)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Form] Add allow_html5 option to date and time FormType to disable HTML5 input type

[Form] added allow_html5 option to date and time FormType to disable HTML5 input type when widget is set to single_text

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

With this little patch we can have a single text widget without HTML5 date input type which is required when using some javascript date or time picker .

Commits
-------

392d6c7 add allow_html5 option to date and time FormType to disable HTML5 date input when widget is set to single_text
2014-09-23 08:30:39 +02:00
Fabien Potencier
8ac12257f3 fixed CS 2014-09-23 08:15:49 +02:00
Fabien Potencier
8e8488092f feature #11815 Added some methods to improve the handling of auto_mapping feature (goetas)
This PR was squashed before being merged into the 2.6-dev branch (closes #11815).

Discussion
----------

Added some methods to improve the handling of auto_mapping feature

| Q             | A
| ------------- | ---
| Bug fix?      |no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?  | yes
| Fixed tickets | https://github.com/doctrine/DoctrineBundle/issues/60
| License       | MIT

This PR is a part that is required by:
* https://github.com/doctrine/DoctrineMongoDBBundle/pull/267
* https://github.com/doctrine/DoctrineBundle/pull/321

The proposed PRs are an alternative to https://github.com/symfony/symfony/pull/11650 and https://github.com/doctrine/DoctrineBundle/pull/322

Commits
-------

2e30a43 Added some methods to improve the handling of auto_mapping feature
2014-09-23 08:15:19 +02:00
Asmir Mustafic
2e30a431d0 Added some methods to improve the handling of auto_mapping feature 2014-09-23 08:15:16 +02:00
Fabien Potencier
ef399b1071 fixed some unit tests 2014-09-23 07:29:08 +02:00
Fabien Potencier
7096c8d769 Merge branch '2.5'
* 2.5:
  typo fixed in AbstractProcessTest (getoutput() => getOutput())
  Avoid question mark and asterisk in folder names to prevent windows filesystem issues.
  [Translation] [Config] Clear libxml errors after parsing XML file
  check for the Validator if forms are enabled
  Clear json_last_error
  Fix JsonSerializable namespace
  Catch exceptions to restore the error handler
  [HttpFoundation] Silent only JSON errors
2014-09-23 07:25:18 +02:00
Fabien Potencier
1c254a4f09 Merge branch '2.4' into 2.5
* 2.4:
  typo fixed in AbstractProcessTest (getoutput() => getOutput())
  Avoid question mark and asterisk in folder names to prevent windows filesystem issues.
  [Translation] [Config] Clear libxml errors after parsing XML file
2014-09-23 07:25:11 +02:00
Fabien Potencier
924d06adf6 Merge branch '2.3' into 2.4
* 2.3:
  typo fixed in AbstractProcessTest (getoutput() => getOutput())
  Avoid question mark and asterisk in folder names to prevent windows filesystem issues.
  [Translation] [Config] Clear libxml errors after parsing XML file

Conflicts:
	src/Symfony/Component/Config/Util/XmlUtils.php
2014-09-23 07:24:59 +02:00
Fabien Potencier
e47e4fa56d bug #11989 [Finder][Urgent] Remove asterisk and question mark from folder name in test to prevent windows file system issues. (Adam)
This PR was merged into the 2.3 branch.

Discussion
----------

[Finder][Urgent] Remove asterisk and question mark from folder name in test to prevent windows file system issues.

Bugfix: Yes
Fixed tickets: #11984 , #11985
Related tickets: #11970

Commit #11970 prevented Symphony from being checked out via windows due to invalid characters in a folder name within the tests.

The issue was reported in #11984  and was attempted to be fixed in #11985 but wasn't due to still including the question mark.

Please accept this ASAP as it entirely breaks any composer that relies on it.

Commits
-------

5fbb278 Avoid question mark and asterisk in folder names to prevent windows filesystem issues.
2014-09-23 07:24:00 +02:00
Yevgen Kovalienia
36998bb629 typo fixed in AbstractProcessTest (getoutput() => getOutput()) 2014-09-23 07:16:08 +02:00
Fabien Potencier
3a3fb05cdf bug #11908 [Translation] [Config] Clear libxml errors after parsing xliff file (pulzarraider)
This PR was merged into the 2.3 branch.

Discussion
----------

[Translation] [Config] Clear libxml errors after parsing xliff file

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

If libxml_use_internal_errors is set to `true` before parsing xliff file, the libxml errors are not cleared correctly. An error `Validation failed: no DTD found !` occurs in libxml errors after parsing and it's available outside the xliff parser (can break other functionality that use `libxml_get_errors` function).

Commits
-------

fab61ef [Translation] [Config] Clear libxml errors after parsing XML file
2014-09-23 07:15:05 +02:00
Adam
5fbb278b7a Avoid question mark and asterisk in folder names to prevent windows filesystem issues.
A previous commit introduced a folder with a question mark and an asterisk which are invalid NTFS folder name characters and prevented checkout on those systems.
2014-09-23 03:52:24 +00:00
Andrej Hudec
fab61effaf [Translation] [Config] Clear libxml errors after parsing XML file 2014-09-22 20:11:23 +02:00
Fabien Potencier
33b30a839f bug #11839 [FrameworkBundle] check if the Validator component is present when forms are enabled (xabbuh)
This PR was merged into the 2.5 branch.

Discussion
----------

[FrameworkBundle] check if the Validator component is present when forms are enabled

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

The `Symfony\Component\Validator\Validation` class is used in the
`FrameworkExtension` class. Therefore, it is required to have the
Validator component installed in production as well but not only when
being in a development environment.

Commits
-------

ed41da1 check for the Validator if forms are enabled
2014-09-22 18:56:03 +02:00
Christian Flothmann
ed41da1c9c check for the Validator if forms are enabled
When the Form component is enabled, the container extension class
automatically enables the Validator component which therefore has to
be enabled. The container extension now throws an exception when forms
are enabled, but the Validator component is not present.
2014-09-22 18:53:46 +02:00
Fabien Potencier
9752a7600a feature #11078 [WIP] [TwigBundle] [Exception] Make return value similar to error.json.twig (clemens-tolboom)
This PR was squashed before being merged into the 2.6-dev branch (closes #11078).

Discussion
----------

[WIP] [TwigBundle] [Exception] Make return value similar to error.json.twig

| Q             | A
| ------------- | ---
| Bug fix?      | I guess this is a bug
| New feature?  | The exception structure changes for the default
| BC breaks?    | The exception structure changes for the default
| Deprecations? | [yes|no]
| Tests pass?   | [yes|no]
| Fixed tickets |
| License       | MIT
| Doc PR        |

The result for `error.json.twig` and `exception.json.twig` differ making the client forced to check for it's result.

We think the structure should be the same to make the ie a javascript client try to respond similar for --env=dev|prod

Commits
-------

4a59f98 [WIP] [TwigBundle] [Exception] Make return value similar to error.json.twig
2014-09-22 18:01:06 +02:00
Clemens Tolboom
4a59f989a9 [WIP] [TwigBundle] [Exception] Make return value similar to error.json.twig 2014-09-22 18:01:04 +02:00
Jérôme Tamarelle
6d6a3af4ff Clear json_last_error 2014-09-22 17:58:58 +02:00
Jerome TAMARELLE
ef91f710e3 Fix JsonSerializable namespace 2014-09-22 17:58:58 +02:00
Jerome TAMARELLE
d952f9049e Catch exceptions to restore the error handler 2014-09-22 17:58:58 +02:00
Jerome TAMARELLE
ddf95c7adc [HttpFoundation] Silent only JSON errors 2014-09-22 17:58:58 +02:00
Fabien Potencier
e5e6f4d86d feature #11857 [Filesystem] Check number of bytes copied. (skigun)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Filesystem] Check number of bytes copied.

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

This only test local files (because of `filesize`), wonder if we should include the remote files using `get_headers` in order to get the Content-length for example. However, it will perform an additional request...

Here's a little benchmark for 500 copy from a remote origin file :
- Standard without check -> Time: 47.34 seconds, Memory: 3.75Mb
- Check with `get_headers` ->Time: 1.32 minutes, Memory: 3.75Mb

Commits
-------

81eca38 [Filesystem] Check number of bytes copied.
2014-09-22 17:54:44 +02:00
Fabien Potencier
a1f8d99a7e fixed CS 2014-09-22 17:52:38 +02:00
Fabien Potencier
2a9a342591 feature #11858 [DependencyInjection] Added exception to avoid fatal during compile in a frozen dumped container (ClementGautier)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[DependencyInjection] Added exception to avoid fatal during compile in a frozen dumped container

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

Commits
-------

2356eaa [DependencyInjection] Added exception to avoid fatal during compile in a frozen dumped container
2014-09-22 17:51:56 +02:00
Fabien Potencier
2104813ca2 Merge branch '2.5'
* 2.5:
  [2.3] Add missing development dependencies
  Fix @return docs on HttpCache::restoreResponseBody()
  [Finder] Escape location for regex searches
  Make sure HttpCache is a trusted proxy

Conflicts:
	src/Symfony/Component/Form/composer.json
2014-09-22 17:29:07 +02:00
Fabien Potencier
4fa670bfae Merge branch '2.4' into 2.5
* 2.4:
  [2.3] Add missing development dependencies
  Fix @return docs on HttpCache::restoreResponseBody()
  [Finder] Escape location for regex searches
  Make sure HttpCache is a trusted proxy
2014-09-22 17:28:36 +02:00
Fabien Potencier
8efff1b464 Merge branch '2.3' into 2.4
* 2.3:
  [2.3] Add missing development dependencies
  Fix @return docs on HttpCache::restoreResponseBody()
  [Finder] Escape location for regex searches
  Make sure HttpCache is a trusted proxy

Conflicts:
	src/Symfony/Bridge/Doctrine/composer.json
	src/Symfony/Bundle/FrameworkBundle/composer.json
	src/Symfony/Bundle/SecurityBundle/composer.json
	src/Symfony/Component/Form/composer.json
2014-09-22 17:28:09 +02:00
Fabien Potencier
4ac8adde5d minor #11340 [2.3] Add missing development dependencies (romainneutron)
This PR was squashed before being merged into the 2.3 branch (closes #11340).

Discussion
----------

[2.3] Add missing development dependencies

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

I've also added a run of the test suite in every component scope.

Commits
-------

3b02af9 [2.3] Add missing development dependencies
2014-09-22 17:12:11 +02:00
Romain Neutron
3b02af9f79 [2.3] Add missing development dependencies 2014-09-22 17:11:59 +02:00
Fabien Potencier
995da74f35 feature #11312 Make assets:install smarter with symlinks (Roy Van Ginneken)
This PR was squashed before being merged into the 2.6-dev branch (closes #11312).

Discussion
----------

Make assets:install smarter with symlinks

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

Commits
-------

6537333 Make assets:install smarter with symlinks
2014-09-22 15:51:42 +02:00
Roy Van Ginneken
6537333647 Make assets:install smarter with symlinks 2014-09-22 15:51:40 +02:00
Fabien Potencier
0811b29b63 feature #11852 [Console] add overwrite flag to ProgressBar helper to allow non-decorated output (kbond)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Console] add overwrite flag to ProgressBar helper to allow non-decorated output

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | yes, but not critical
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11542, #10011
| License       | MIT
| Doc PR        | symfony/symfony-docs#4206

By default, the `ProgressBar` helper overwrites the output to give the nice progress bar look.  To prevent the output from blowing up in non-decorated environments, the output was hidden in these environments (see #9846).

This PR enables using the `ProgressBar` in non-decorated environments by adding an `overwrite` flag.  When `false`, instead of overwriting the bar, it is rendered on a new line.  To prevent flooding the output, you can adjust the `redrawFrequency`.

By default, when using the `ProgressBar` in a non-decorated environment, the `overwrite` flag is set to false.  If a `max` is set, the `redrawFrequency` is set to a sensible default (10% of the max).  If a `max` isn't set, the bar is output for every advance so to prevent flooding, a sensible `redrawFrequency` should be manually set.

The only BC break is that output will now display where it didn't before.

Commits
-------

cdee6f6 add overwrite flag to allow non-decorated output
2014-09-22 15:46:08 +02:00
Fabien Potencier
902efb8a84 bug #11937 [HttpKernel] Make sure HttpCache is a trusted proxy (thewilkybarkid)
This PR was merged into the 2.3 branch.

Discussion
----------

[HttpKernel] Make sure HttpCache is a trusted proxy

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

Fixes #9292 by adding `127.0.0.1` as a trusted proxy when using `HttpCache` (assuming it hasn't been already).

Commits
-------

ca65362 Make sure HttpCache is a trusted proxy
2014-09-22 15:44:41 +02:00
Grégoire Pineau
ce62ccfcdd [FrameworkBundle] Added link on server:* commands 2014-09-22 15:27:18 +02:00
znerol
37dc57bda2 Fix @return docs on HttpCache::restoreResponseBody() 2014-09-22 15:25:52 +02:00
Fabien Potencier
677aefbbaa bug #11970 [Finder] Escape location for regex searches (ymc-dabe)
This PR was squashed before being merged into the 2.3 branch (closes #11970).

Discussion
----------

[Finder] Escape location for regex searches

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

If the location to start searching in contains a regex special char
like + or ? and the path restriction is a regular expresion with a start
limitation. No results will be found wtih at least GnuFindAdapter - e.g.:
```
use Symfony\Component\Finder\Finder;
use Symfony\Component\Finder\Adapter;

mkdir('/tmp/reg+ex/dir/subdir', 0777, true);

$finder = Finder::create()
    ->removeAdapters()
    ->addAdapter(new Adapter\GnuFindAdapter());
$finder->in('/tmp/reg+ex')->path('/^dir/');

print count($finder)."\n";
```

Expected result: 2
Actual result is: 0

This pull request consists of:
* a new test checking for this bug (0e81086a49425d0e12cff4f479fabeb97e9ed757)
* the actual fix (6595b6b2b71afc57ef08686b4584713c0e4e48ed)
* changes to comply with the coding standard (7f199c5b53b3c1f38b36dcc286d3b20ae877425b)

## How to reproduce
### Fastest way
1. Move or copy your local symfony clone into a location containing special regex chars:
  * `mv symfony symfony+regex`
2. Run tests in there
  * `cd symfony+regex && phpunit`

> Result: Some tests in the finder component will fail.

### Alternative: A new clone
1. Clone symfony in a directory containing at least one regex special char
  * `git clone https://github.com/symfony/symfony.git /tmp/symfony+regexchar`
2. As usual get composer, install dependencies and get phpunit
  * You might simply want to follow [this guide](http://symfony.com/doc/current/contributing/code/tests.html)
3. Run tests in there
   * `cd /tmp/symfony+regexchar && phpunit`

> Result: Some tests in the finder component will fail.

### Alternative: Apply the new test
1. Apply commit a29d1207ced2949c918357cf271200523960caef to your symfony clone
2. Run tests

> Result: The new test will fail.

Commits
-------

b63926b [Finder] Escape location for regex searches
2014-09-22 14:44:11 +02:00
Daniel Beyer
b63926b246 [Finder] Escape location for regex searches 2014-09-22 14:44:08 +02:00
Fabien Potencier
c85bed20e9 feature #10475 [Filesystem] Added a LockHandler (lyrixx)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Filesystem] Added a LockHandler

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

Code sample:

```php
    /**
     * {@inheritdoc}
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $lockHelper = new LockHandler('/tmp/acme/hello.lock');
        if (!$lockHelper->lock()) {
            $output->writeln('The command is already running in another process.');

            return 0;
        }

        $output->writeln(sprintf('Hello <comment>%s</comment>!', $input->getArgument('who')));

        for (;;) {
        }

        $output->writeln(sprintf('bye <comment>%s</comment>!', $input->getArgument('who')));

        $lockHelper->unlock();
    }
```

![process-lock](https://f.cloud.github.com/assets/408368/2443205/4f0bf3e8-ae30-11e3-9bd4-78e09e2973ad.png)

Commits
-------

9ad8957 [Filesystem] Added a lock handler
2014-09-22 14:37:50 +02:00
Fabien Potencier
aeef2bc5da feature #11961 [FrameworkBundle] Determine templating.engine.php scope as late as possible (lyrixx)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[FrameworkBundle] Determine templating.engine.php scope as late as possible

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

Commits
-------

169dadd [FrameworkBundle] Determine templating.engine.php scope as late as possible
2014-09-22 14:32:47 +02:00
Fabien Potencier
1a55995e89 feature #11311 [FrameworkBundle] Additional helper commands to control PHP's built-in web server (xabbuh)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[FrameworkBundle] Additional helper commands to control PHP's built-in web server

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

Basically, both the ``server:status`` and ``server:stop`` wouldn't be really reliable if you had stopped the web server by, for example, killing the process. But honestly I don't know how to platform-independently determine if a process is still running given its PID. Maybe such a way could be a good improvement for the Process component.

Commits
-------

b601454 new helper commands for PHP's built-in server
2014-09-22 14:29:55 +02:00
Fabien Potencier
05815adb22 Merge branch '2.5'
* 2.5:
  added missing use statements
  added missing use statement
  added missing use statement
  fixed CS
  [Process] fixed some volatile tests
  [HttpKernel] fixed a volatile test
  [HttpFoundation] fixed some volatile tests
  [Tests] PHPUnit Optimizations
  Use getPathname() instead of string casting to get BinaryFileReponse file path

Conflicts:
	src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php
	src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/full.php
	src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php
	src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php
	src/Symfony/Component/Process/Process.php
	src/Symfony/Component/Stopwatch/Stopwatch.php
	src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php
	src/Symfony/Component/Validator/Tests/Constraints/GreaterThanOrEqualValidatorTest.php
	src/Symfony/Component/Yaml/Parser.php
	src/Symfony/Component/Yaml/Tests/InlineTest.php
2014-09-22 13:59:59 +02:00
Fabien Potencier
405d8f9862 added missing use statements 2014-09-22 12:18:36 +02:00
Fabien Potencier
12711fda63 added missing use statement 2014-09-22 12:10:16 +02:00
Fabien Potencier
24c7aef6dd added missing use statement 2014-09-22 11:21:49 +02:00
Fabien Potencier
b91866f6c1 Merge branch '2.4' into 2.5
* 2.4:
  fixed CS
  [Process] fixed some volatile tests
  [HttpKernel] fixed a volatile test
  [HttpFoundation] fixed some volatile tests
  [Tests] PHPUnit Optimizations
  Use getPathname() instead of string casting to get BinaryFileReponse file path

Conflicts:
	src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php
	src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SessionController.php
	src/Symfony/Component/ClassLoader/Tests/ApcUniversalClassLoaderTest.php
	src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php
	src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php
	src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php
	src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php
	src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php
	src/Symfony/Component/HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php
	src/Symfony/Component/Process/Tests/AbstractProcessTest.php
	src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php
	src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php
	src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php
	src/Symfony/Component/Security/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php
	src/Symfony/Component/Security/Http/Tests/Firewall/SwitchUserListenerTest.php
	src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php
	src/Symfony/Component/Translation/Tests/Dumper/IcuResFileDumperTest.php
	src/Symfony/Component/Validator/Constraints/ChoiceValidator.php
	src/Symfony/Component/Validator/Constraints/CollectionValidator.php
	src/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/IsbnValidatorTest.php
	src/Symfony/Component/Validator/Tests/ValidationVisitorTest.php
	src/Symfony/Component/Yaml/Parser.php
2014-09-22 11:14:18 +02:00
Fabien Potencier
27e8c654db Merge branch '2.3' into 2.4
* 2.3:
  fixed CS
  [Process] fixed some volatile tests
  [HttpKernel] fixed a volatile test
  [HttpFoundation] fixed some volatile tests
  Use getPathname() instead of string casting to get BinaryFileReponse file path

Conflicts:
	src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php
	src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php
	src/Symfony/Bundle/FrameworkBundle/EventListener/SessionListener.php
	src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
	src/Symfony/Component/ClassLoader/Tests/ApcUniversalClassLoaderTest.php
	src/Symfony/Component/Config/Definition/ReferenceDumper.php
	src/Symfony/Component/Config/Tests/Definition/Dumper/YamlReferenceDumperTest.php
	src/Symfony/Component/Console/Application.php
	src/Symfony/Component/Console/Tests/ApplicationTest.php
	src/Symfony/Component/Filesystem/Exception/IOException.php
	src/Symfony/Component/Form/Extension/Templating/TemplatingExtension.php
	src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/NumberToLocalizedStringTransformerTest.php
	src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php
	src/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php
	src/Symfony/Component/HttpKernel/Tests/Fragment/RoutableFragmentRendererTest.php
	src/Symfony/Component/HttpKernel/Tests/Profiler/Mock/RedisMock.php
	src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php
	src/Symfony/Component/PropertyAccess/PropertyAccessor.php
	src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorCollectionTest.php
	src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php
	src/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php
	src/Symfony/Component/Routing/Tests/Annotation/RouteTest.php
	src/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php
	src/Symfony/Component/Serializer/Encoder/XmlEncoder.php
	src/Symfony/Component/Validator/Constraints/CollectionValidator.php
	src/Symfony/Component/Validator/Tests/ExecutionContextTest.php
2014-09-22 10:51:05 +02:00
Grégoire Pineau
169dadd289 [FrameworkBundle] Determine templating.engine.php scope as late as possible 2014-09-22 10:43:33 +02:00
Fabien Potencier
369aebf431 fixed CS 2014-09-22 10:32:35 +02:00
Fabien Potencier
f5d4515200 minor #11966 [HttpFoundation] fixed some volatile tests (fabpot)
This PR was merged into the 2.3 branch.

Discussion
----------

[HttpFoundation] fixed some volatile tests

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

Commits
-------

00c1b75 [Process] fixed some volatile tests
974bf01 [HttpKernel] fixed a volatile test
6020c43 [HttpFoundation] fixed some volatile tests
2014-09-21 09:12:05 +02:00
Fabien Potencier
00c1b759cd [Process] fixed some volatile tests 2014-09-20 10:00:00 +02:00
Fabien Potencier
974bf01eb3 [HttpKernel] fixed a volatile test 2014-09-20 09:56:12 +02:00
Fabien Potencier
6020c43191 [HttpFoundation] fixed some volatile tests 2014-09-20 09:53:54 +02:00
Fabien Potencier
a469c560fb Merge branch '2.5'
* 2.5:
  [Debug] Restoring error handler before assertions
  Unit test fixes
  Fixed merge conflict in .travis.yml introduced in 687703a75e

Conflicts:
	src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php
2014-09-20 08:11:16 +02:00
Fabien Potencier
cd9ae6f0b5 minor #11963 Fixing unit tests (fejese)
This PR was merged into the 2.6-dev branch.

Discussion
----------

Fixing unit tests

[Validator] Fixing how default time zone is backed up during testing to not interfere with other tests
[HttpKernel] Fixing merge issue since 4677e92ffe

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

Commits
-------

5b3193a minor #11963 Unit test fixes [HttpKernel] Fixing unit test broken since merge 4677e92ffe [Validator] Fixing the way the default time zone is backed up
2014-09-20 08:06:06 +02:00
Grégoire Pineau
790127c22b [Tests] PHPUnit Optimizations 2014-09-20 02:33:54 +02:00
Grégoire Pineau
957fbb2cd9 [Tests] PHPUnit Optimizations 2014-09-20 02:32:06 +02:00
Endre Fejes
5b3193a85a minor #11963 Unit test fixes
[HttpKernel] Fixing unit test broken since merge 4677e92ffe
[Validator] Fixing the way the default time zone is backed up
2014-09-20 02:14:51 +02:00
Endre Fejes
51fa3efc0f [Debug] Restoring error handler before assertions 2014-09-19 22:54:50 +02:00
Fabien Potencier
ebfda57988 feature #11593 [FrameworkBundle] Add shortcut methods to controllers (Cydonia7)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[FrameworkBundle] Add shortcut methods to controllers

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

To-do list :
- [x] submit changes to the documentation

Added redirectToRoute, addFlash, isGranted and checkGranted to controllers. The code seems so simple I didn't feel like adding controller tests was needed since we're just shortcuting other services calls.

Commits
-------

74d8c9a Add redirectToRoute, addFlash, isGranted and denyAccessUnlessGranted shortcuts to controllers.
2014-09-19 08:11:11 +02:00
Endre Fejes
3c11fa50f8 Unit test fixes 2014-09-19 07:23:43 +02:00
nervo
e1eb788d2f Use getPathname() instead of string casting to get BinaryFileReponse file path 2014-09-17 13:01:47 +02:00
Fabien Potencier
4677e92ffe Merge branch '2.5'
* 2.5: (43 commits)
  [Form] Fix PHPDoc for builder setData methods The underlying data variable is typed as mixed whereas the methods paramers where typed as array.
  fixed CS
  [Intl] Improved bundle reader implementations
  [Console] guarded against invalid aliases
  switch before_script to before_install and script to install
  fixed typo
  [HttpFoundation] Request - URI - comment improvements
  [Validator] The ratio of the ImageValidator is rounded to two decimals now
  [Security] Added more tests
  remove `service` parameter type from XSD
  [Intl] Added exception handler to command line scripts
  [Intl] Fixed a few bugs in TextBundleWriter
  [Intl] Updated icu.ini up to ICU 53
  [Intl] Removed non-working $fallback argument from ArrayAccessibleResourceBundle
  Use separated function to resolve command and related arguments
  [SwiftmailerBridge] Bump allowed versions of swiftmailer
  [FrameworkBundle] Remove invalid markup
  [Intl] Added "internal" tag to all classes under Symfony\Component\Intl\ResourceBundle
  Remove routes for removed WebProfiler actions
  [Security] Fix usage of unexistent method in DoctrineAclCache.
  ...

Conflicts:
	src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php
	src/Symfony/Component/HttpKernel/HttpCache/Esi.php
	src/Symfony/Component/HttpKernel/Kernel.php
	src/Symfony/Component/Translation/Tests/Dumper/XliffFileDumperTest.php
	src/Symfony/Component/Yaml/Parser.php
	src/Symfony/Component/Yaml/Tests/InlineTest.php
2014-09-17 11:54:14 +02:00
Fabien Potencier
687703a75e Merge branch '2.4' into 2.5
* 2.4: (39 commits)
  [Form] Fix PHPDoc for builder setData methods The underlying data variable is typed as mixed whereas the methods paramers where typed as array.
  fixed CS
  [Intl] Improved bundle reader implementations
  [Console] guarded against invalid aliases
  switch before_script to before_install and script to install
  fixed typo
  [HttpFoundation] Request - URI - comment improvements
  [Validator] The ratio of the ImageValidator is rounded to two decimals now
  [Security] Added more tests
  remove `service` parameter type from XSD
  [Intl] Added exception handler to command line scripts
  [Intl] Fixed a few bugs in TextBundleWriter
  [Intl] Updated icu.ini up to ICU 53
  [Intl] Removed non-working $fallback argument from ArrayAccessibleResourceBundle
  Use separated function to resolve command and related arguments
  [SwiftmailerBridge] Bump allowed versions of swiftmailer
  [FrameworkBundle] Remove invalid markup
  [Intl] Added "internal" tag to all classes under Symfony\Component\Intl\ResourceBundle
  Remove routes for removed WebProfiler actions
  [Security] Fix usage of unexistent method in DoctrineAclCache.
  ...

Conflicts:
	.travis.yml
	src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php
	src/Symfony/Component/HttpKernel/Kernel.php
	src/Symfony/Component/Process/PhpExecutableFinder.php
2014-09-17 11:50:16 +02:00
Fabien Potencier
1be7acd100 Merge branch '2.3' into 2.4
* 2.3: (35 commits)
  [Form] Fix PHPDoc for builder setData methods The underlying data variable is typed as mixed whereas the methods paramers where typed as array.
  fixed CS
  [Intl] Improved bundle reader implementations
  [Console] guarded against invalid aliases
  switch before_script to before_install and script to install
  fixed typo
  [HttpFoundation] Request - URI - comment improvements
  [Security] Added more tests
  remove `service` parameter type from XSD
  [Intl] Added exception handler to command line scripts
  [Intl] Fixed a few bugs in TextBundleWriter
  [Intl] Updated icu.ini up to ICU 53
  [Intl] Removed non-working $fallback argument from ArrayAccessibleResourceBundle
  Use separated function to resolve command and related arguments
  [SwiftmailerBridge] Bump allowed versions of swiftmailer
  [FrameworkBundle] Remove invalid markup
  [Intl] Added "internal" tag to all classes under Symfony\Component\Intl\ResourceBundle
  Remove routes for removed WebProfiler actions
  [Security] Fix usage of unexistent method in DoctrineAclCache.
  backport more error information from 2.6 to 2.3
  ...

Conflicts:
	.travis.yml
	src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php
	src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php
	src/Symfony/Component/HttpKernel/Kernel.php
	src/Symfony/Component/Process/PhpExecutableFinder.php
2014-09-17 11:45:32 +02:00
thewilkybarkid
ca65362b9b Make sure HttpCache is a trusted proxy 2014-09-16 19:36:21 +01:00
Steffen Roßkamp
c207d1dde2 [Form] Fix PHPDoc for builder setData methods
The underlying data variable is typed as mixed whereas the methods
paramers where typed as array.
2014-09-16 11:11:47 +02:00
Fabien Potencier
d853c0d43b minor #11820 [Security] Uniform AccessDecisionManager decide behaviour (mTorres)
This PR was merged into the 2.3 branch.

Discussion
----------

[Security] Uniform AccessDecisionManager decide behaviour

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

This PR uniforms the way the 3 decision policies (affirmative, consensus, unanimous) are handled in the Security\Core\Authoritzation\AccessDecisionManager.php

See #10170

Commits
-------

938ae4b [Security] Added more tests
2014-09-16 08:36:20 +02:00
Fabien Potencier
4fd0cf3927 fixed CS 2014-09-16 07:12:27 +02:00
Fabien Potencier
036726cf62 bug #11513 [Translation] made XliffFileDumper support CDATA sections. (hhamon)
This PR was merged into the 2.3 branch.

Discussion
----------

[Translation] made XliffFileDumper support CDATA sections.

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

Commits
-------

9926845 [Translation] made XliffFileDumper support CDATA sections.
2014-09-16 07:11:43 +02:00
Bernhard Schussek
f776e0c3d2 bug #11907 [Intl] Improved bundle reader implementations (webmozart)
This PR was merged into the 2.3 branch.

Discussion
----------

[Intl] Improved bundle reader implementations

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

This PR extracts bundle reader improvements from #9206.

The code is internal and used for resource bundle generation only, so I did not care about BC too much.

Commits
-------

c3cce5c [Intl] Improved bundle reader implementations
2014-09-15 22:32:55 +02:00
Bernhard Schussek
c3cce5c694 [Intl] Improved bundle reader implementations 2014-09-15 22:29:25 +02:00
Fabien Potencier
9046c483ed feature #10388 [FrameworkBundle] [Command] Event Dispatcher Debug - Display registered listeners (matthieuauger)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[FrameworkBundle] [Command] Event Dispatcher Debug - Display registered listeners

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

------------------------------------------
[Update] The PR has been updated in order to comply with @stof comments.

Current status :
- [x] New event dispatcher Descriptor
- [x] Manage all callables
- [x] Unit tests
- [x] Text description
- [x] XML description
- [x] Json description
- [x] Markdown description

-----------------------------------------
Hi. In some big applications with lots of events, it's often hard to debug which classes listen to which events, and what is the order of theses listeners. This PR allows to run

- *event-dispatcher:debug* which displays all configured listeners + the events they listen to

![capture d cran de 2014-03-07 20 13 56](https://f.cloud.github.com/assets/1172099/2361104/40a86a62-a62d-11e3-9ccd-360a8d75b2a4.png)

- *event-dispatcher:debug* **event** which displays configured listeners for this specific event (order by priority desc)

![capture d cran de 2014-03-07 20 14 31](https://f.cloud.github.com/assets/1172099/2361100/31e0d12c-a62d-11e3-963b-87623d05642c.png)

The output is similar to *container:debug* command and is available in all supported formats (txt, xml, json and markdown).

I found another PR with same goal (#8234), but the approach looks too complicated to me plus I think we should fetch the listeners directly with the event_dispatcher.

Commits
-------

ce53c8a [FrameworkBundle] Add Event Dispatcher debug command
2014-09-15 22:12:45 +02:00
Thierry Marianne
908101413f [Console] guarded against invalid aliases 2014-09-15 21:15:42 +02:00
Fabien Potencier
f12890c0db bug #11799 [YAML] fix handling of empty sequence items (xabbuh)
This PR was merged into the 2.3 branch.

Discussion
----------

[YAML] fix handling of empty sequence items

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

When a line contains only a dash it cannot safely be assumed that it contains a nested list or an embedded mapping. If the next line starts with a dash at the same indentation, the current line's item is to be treated as `null`.

Commits
-------

fc85435 fix handling of empty sequence items
2014-09-15 20:23:23 +02:00
Bernhard Schussek
d35fd52b7a bug #11906 [Intl] Fixed a few bugs in TextBundleWriter (webmozart)
This PR was merged into the 2.3 branch.

Discussion
----------

[Intl] Fixed a few bugs in TextBundleWriter

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

See the included test cases for more information. This code was extracted from #9206.

Commits
-------

7b4a35a [Intl] Fixed a few bugs in TextBundleWriter
2014-09-15 20:17:36 +02:00
Bernhard Schussek
6ebb017b79 feature #11343 [Twig][Form] Moved twig.form.resources to a higher level (stefanosala)
This PR was merged into the 2.6-dev branch.

Discussion
----------

[Twig][Form] Moved twig.form.resources to a higher level

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

Commits
-------

ab0b5e6 [Twig][Form] Moved configuration key twig.form.resources to twig.form_themes
2014-09-15 20:15:30 +02:00
Fabien Potencier
15aec880ab fixed typo 2014-09-15 20:08:07 +02:00
1emming
59505714b3 [HttpFoundation] Request - URI - comment improvements 2014-09-15 20:07:32 +02:00
Bernhard Schussek
709db6fd75 [Validator] The ratio of the ImageValidator is rounded to two decimals now 2014-09-15 19:37:41 +02:00
Marc Torres
938ae4bf0d [Security] Added more tests 2014-09-15 19:24:27 +02:00
Bernhard Schussek
ba218540b1 bug #11459 [Form][Validator] All index items after children are to be considered grand-children when resolving ViolationPath (Andrew Moore)
This PR was merged into the 2.3 branch.

Discussion
----------

[Form][Validator] All index items after children are to be considered grand-children when resolving ViolationPath

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | unsure, see note below
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11458
| License       | MIT
| Doc PR        | -

#### Possible BC Break
The old behavior had unit test cases specifically testing the case of a grand-children form. However, this behavior is not documented anywhere and the fix seems to have no adverse effects on form validation. `Symfony\Component\Form\FormInterface` implements `ArrayAccess`, therefore, semantically speaking, `children[direct_child].children[grand_children]` and `children[direct_child][grand_children]` are equivalent. `offsetGet` is expected to fetch an element from `children`. I do not see why both were not considered equivalent when resolving the ViolationPath.

This commit will indeed change how some errors are mapped. However since the old mapping is (in my opinion) a bug...

Commits
-------

c64a75f [Form][Validator] All index items after children are to be considered grand-children when resolving ViolationPath (fixes #11458)
2014-09-15 19:17:27 +02:00
Bernhard Schussek
cee0ff8d64 bug #11715 [Form] FormBuilder::getIterator() now deals with resolved children (issei-m)
This PR was merged into the 2.3 branch.

Discussion
----------

[Form] FormBuilder::getIterator() now deals with resolved children

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

I think FormBuilder::getIterator() should resolve children before makes an iterator because it seems to be used in same purpose with FormBuilder::all().
What do you think?

Commits
-------

0deb505 [Form] FormBuilder::getIterator() now deals with resolved children
2014-09-15 17:17:27 +02:00
Bernhard Schussek
05c720734b feature #11917 [Validator] Add ClassMetadata plural methods for convinience (jakzal)
This PR was squashed before being merged into the 2.6-dev branch (closes #11917).

Discussion
----------

[Validator] Add ClassMetadata plural methods for convinience

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

I realised there's no specific place to document this methods, as the code examples always include all the formats. I think it's enough if IDE autocompletes these methods.

Commits
-------

0fd6769 [Validator] Add ClassMetadata plural methods for convinience
2014-09-15 16:53:41 +02:00