Commit Graph

9394 Commits

Author SHA1 Message Date
Eriksen Costa
61e353942e [Form][Locale] updated minimum ICU version to 4.0 2012-08-07 12:17:01 -03:00
Eriksen Costa
0d442c7653 [Locale] as of ICU 4.8+, slash ("/") and dash ("-") are interchangeable, you can use any of them in a date/time pattern 2012-08-07 12:17:01 -03:00
Eriksen Costa
90d6dc3791 [Locale] fixed tests 2012-08-07 12:17:00 -03:00
Eriksen Costa
5fd4eb1c3a [Locale] updated ICU data paths 2012-08-07 12:17:00 -03:00
Eriksen Costa
64ccee7f98 [Locale] updated ICU data 2012-08-07 12:16:59 -03:00
Eriksen Costa
0d0a8d4649 [Locale] updated script to generate separated data directories for different ICU releases 2012-08-07 12:16:57 -03:00
Grégoire Pineau
039264d2d2 [Console] Fixed tests about message exception when command is not available 2012-08-07 16:24:01 +02:00
Grégoire Pineau
a4d2d31a9d [Console] Added tests for message exception when command is not available
These tests fail
2012-08-07 16:24:01 +02:00
Bilal Amarni
5ad75c71f3 updated method name in a comment 2012-08-07 17:22:46 +03:00
Fabien Potencier
b91a4a8368 merged branch sun/yaml-indent (PR #5157)
Commits
-------

3e1a1ab Force the value of Dumper::setIndentation($num) to be of type integer.
5be7237 Added Yaml\Dumper::setIndentation() method to allow a custom indentation level of nested nodes.

Discussion
----------

[Yaml] Allow custom indentation level for nested nodes

YAML does not specify an absolute indentation level, but a consistent indentation of nested nodes only: http://yaml.org/spec/current.html#indentation%20space/

Projects that are generally using 2 spaces for indentation should be able to retain consistency with their coding standards by supplying a custom value for the new $indent parameter for Yaml::dump() and Dumper::dump().

The new parameter is a backwards-compatible API addition and defaults to the previous default of 4 (which was changed from 2 via PR #2242 only recently).

The old $indent parameter is renamed to $level, and remains to be used internally only.

---------------------------------------------------------------------------

by travisbot at 2012-08-03T00:24:22Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/2024289) (merged 56331202 into b1618d21).

---------------------------------------------------------------------------

by travisbot at 2012-08-03T00:29:02Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/2024315) (merged eeae28a4 into b1618d21).

---------------------------------------------------------------------------

by travisbot at 2012-08-03T02:41:42Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/2024905) (merged 9a82c438 into b1618d21).

---------------------------------------------------------------------------

by fabpot at 2012-08-03T07:53:50Z

This is indeed a BC break as the method signature changed in a non-BC way.

---------------------------------------------------------------------------

by fabpot at 2012-08-03T08:35:51Z

I think I would prefer to have a static method to be able to change the number of spaces to use on a global basis. It makes more sense and would prevent the BC break. What do you think?

---------------------------------------------------------------------------

by sun at 2012-08-03T13:23:23Z

Thanks for your feedback! — Took some time to think through the static proposal.  Here's what I think:

1. The call from DependencyInjection\Dumper\YamlDumper truly was a unexpected/nasty surprise for me.  That is, because it passes a parameter to Yaml\Dumper that is documented for internal use only, and the surrounding YamlDumper code generally hard-codes lots of assumptions of where exactly the nodes/collections will be output in the dumped YAML structure.  (I think that code can be simplified, cleaned up, and made faster at the same time (hence the todo), but indeed, that probably belongs into a separate issue.)
1. The essential problem with a static is closely bound to that though; a static property value for the indentation would "stick" and thus hi-jack the DependencyInjection\Dumper\YamlDumper, as it hard-codes and thus expects 4 spaces (contrary to any custom indentation).
1. Most code uses Yaml\Yaml as utility/helper service directly, so there'd be no clean way to prime the static with a custom value, aside from subclassing the entire thing - in which case this entire issue would sorta become moot, because at the point you're subclassing, you can as well go the extra mile and replace the entire Yaml\Dumper::dump() to implant the custom indentation level...
1. Another option would be to use a non-static Yaml\Dumper::$indent property, supplied through the constructor; i.e.:

        public function __construct($indent = 4)

  ...or alternatively, ::setIndentation(). Essentially requiring people to use and instantiate Yaml\Dumper directly, if they want to use a custom indentation.
1. Though in the end, I don't want to sound pedantic, but I *do* wonder a bit about the exact extent of the `@api` tags, as well as `@param`s that are explicitly documented as "internal use only"... :)  That is, because only Yaml\Yaml is tagged with `@api`, but nothing in Yaml\Dumper.  The same sorta applies to DependencyInjection\Dumper\YamlDumper::dump(), which is tagged with `@api`, but the :.addService() method being adjusted accordingly here is not.  So essentially, when taking those tags (plus the param's description) seriously and in a nitpicky way, then there is no BC break, since no one should rely on their exact implementation... ;)  (I perfectly realize that this is a long shot :))

So... depending on the final stance on the last point, I'd either move forward with the current proposal in this PR.  Otherwise, I'd suggest the non-static property on Yaml\Dumper - in which case we'd likely try to swap out the static Symfony\Component\Yaml\Yaml helper with a Drupal\Component\Yaml\Yaml in order to always instantiate the dumper with the custom indentation.  What do you think?

---------------------------------------------------------------------------

by sun at 2012-08-04T22:57:21Z

Alright.  While I believe I made some good points in my last comment, I've taken the fully backwards-compatible path:

- added the new $indent parameter only to Yaml::dump()
- added a new Dumper::$intendation property and Dumper::setIndentation() method, to control the indentation level within the scope of a single Dumper instance only.

Do you think this is acceptible? :)

---------------------------------------------------------------------------

by travisbot at 2012-08-05T06:16:22Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/2039120) (merged 5be7237b into c99f9d29).

---------------------------------------------------------------------------

by travisbot at 2012-08-07T07:51:04Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/2055164) (merged 3e1a1abd into c99f9d29).

---------------------------------------------------------------------------

by sun at 2012-08-07T07:53:18Z

Only one environment failed, and the [test failure](http://travis-ci.org/#!/symfony/symfony/jobs/2055165/L203) seems unrelated to this PR.
2012-08-07 10:09:45 +02:00
Fabien Potencier
13454efe30 merged branch jfsimon/issue-5196 (PR #5197)
Commits
-------

c2207da [Console] Removed unused phpunit annotation.
c0c61da [Console] Added current style appliance for all styled text.
696a653 [Console] Removed text transformation for empty styles.
c7e324a [Console] Added test for non style tag formatting.

Discussion
----------

[Console] Non style tags dont disturb formatting anymore

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes

Fixes issue #5196.

---------------------------------------------------------------------------

by travisbot at 2012-08-06T19:35:20Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/2050455) (merged c0c61da0 into 842b599c).

---------------------------------------------------------------------------

by travisbot at 2012-08-07T07:47:31Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/2055153) (merged c2207da6 into 842b599c).
2012-08-07 10:07:43 +02:00
sun
3e1a1abd5d Force the value of Dumper::setIndentation($num) to be of type integer. 2012-08-07 09:40:56 +02:00
Jan Marek
890aea2ffe FileLocatorInterface used in typehint instead of FileLocator 2012-08-07 10:39:30 +03:00
jfsimon
c2207da6ab [Console] Removed unused phpunit annotation. 2012-08-07 09:37:46 +02:00
Jean-François Simon
af0149d638 [Console] Added some precision in OutputInterface::write docblock. 2012-08-06 21:34:56 +02:00
Jean-François Simon
c0c61da0be [Console] Added current style appliance for all styled text. 2012-08-06 21:23:53 +02:00
Jean-François Simon
696a65370e [Console] Removed text transformation for empty styles. 2012-08-06 21:22:20 +02:00
Jean-François Simon
c7e324af90 [Console] Added test for non style tag formatting. 2012-08-06 21:21:07 +02:00
hidenorigoto
1a4a4ee93c [DependencyInjection] Fixed a frozen constructor of a container with no parameters 2012-08-07 01:03:17 +09:00
Fabien Potencier
3d32a0bcc2 merged branch beberlei/ConfigFileLoaderTypeMissing (PR #5193)
Commits
-------

b3cf36a [Config] Missing type argument passed to loader.

Discussion
----------

[Config] Missing type argument passed to loader.

In FileLoader the $type is not passed to the child loader.

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT

---------------------------------------------------------------------------

by travisbot at 2012-08-06T14:22:30Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/2047982) (merged b3cf36af into 89dce2df).
2012-08-06 16:50:56 +02:00
Fabien Potencier
842b599c50 merged branch lsmith77/bundle_inheritance_in_config_dump_reference (PR #5126)
Commits
-------

cdfbe72 handle inheritance in config:dump-reference when a bundle name is passed to the command

Discussion
----------

handle inheritance in config:dump-reference

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: ?
Fixes the following tickets: -
License of the code: MIT

Currently when passing in a bundle name that identifies a bundle that is a parent to another bundle, it will not return the reference for the requested bundle, but for the inheriting (even if that bundle has no configuration class).

F.e.
app/console config:dump-reference SymfonyCmfBlockBundle

will fail if there is a Bundle SandboxBlockBundle that has SymfonyCmfBlockBundle set as the parent.
2012-08-06 16:48:36 +02:00
Benjamin Eberlei
b3cf36af9e [Config] Missing type argument passed to loader.
In FileLoader the $type is not passed to the child loader.
2012-08-06 16:02:40 +02:00
Fabien Potencier
0ccda38775 merged branch Garfield-fr/master (PR #5015)
Commits
-------

f1c4b8b [Doctrine Bridge] Added a parameter ignoreNull on Unique entity to allow a nullable value on field. Added Test

Discussion
----------

[Doctrine Bridge] Added parameter ignoreNull to accept a nullable value on field

In my last project, i use this syntax to test unicity on 2 fields, but it fail because the validator stop if value is null. I dropped the test on validator and my unicity work fine.

```
@UniqueEntity(fields={"username", "deletedAt"})
```

It's possible to add this PR on Bridge.

Thanks

Bertrand

---------------------------------------------------------------------------

by stof at 2012-07-23T08:14:19Z

This is wrong. RDBMS allow several null values in a unique column and this change will break it.

---------------------------------------------------------------------------

by henrikbjorn at 2012-07-23T08:17:08Z

@stof seems weird indeed it would return if any of the values are null. Makes sense to do a query where the field `IS NULL` or whatever the find method does.

---------------------------------------------------------------------------

by stof at 2012-07-23T08:18:50Z

@henrikbjorn if you do a query with IS NULL, the validator would force to have only 1 entity with a null field whereas it is not the behavior of the DB-level constraint.

---------------------------------------------------------------------------

by henrikbjorn at 2012-07-23T08:20:41Z

In this case i suspect that he wants to achieve a `WHERE username = "henrikbjorn" AND deletedAt IS NULL` which would be valid right? Currently it just returns if any of the fields are null and the validation is never done.

---------------------------------------------------------------------------

by bschussek at 2012-07-23T08:27:24Z

I suggest to make this configurable as the handling of NULL values in UNIQUE columns [differs between SQL implementations](http://forums.mysql.com/read.php?22,53591,53591#msg-53591).

---------------------------------------------------------------------------

by Garfield-fr at 2012-07-23T08:52:53Z

@stof What the correct solution to test my unicity with deletedAt == null ?

I use this definition: @ORM\Column(name="deleted_at", type="datetime", nullable=true)

---------------------------------------------------------------------------

by Garfield-fr at 2012-07-23T20:28:44Z

In my local repository, i added a new parameter "$authorizedNullField" on UniqueEntity.php and tested this on UniqueEntityValidator.php:

Code: https://gist.github.com/4122efbe569e3c2c95c0

What about that ?

Thanks for your help

---------------------------------------------------------------------------

by stof at 2012-07-23T20:45:30Z

yep, this would be good (except for the naming which seems weird)

---------------------------------------------------------------------------

by Garfield-fr at 2012-07-23T20:46:44Z

No problem to change this. I don't find a good name for this ?

---------------------------------------------------------------------------

by stof at 2012-07-23T20:47:57Z

what about ``allowMultipleNull`` (defaulting to ``true`` for BC) ?

---------------------------------------------------------------------------

by Garfield-fr at 2012-07-23T20:51:30Z

Why multiple ? This option is for one or many. what about `allowNullable` ?

---------------------------------------------------------------------------

by stof at 2012-07-23T20:52:44Z

@Garfield-fr the current behavior allows having multiple null values without failing to the unique constraint

---------------------------------------------------------------------------

by Garfield-fr at 2012-07-23T20:56:07Z

ok. I make `allowMultipleNull`.

It's ok with that: https://gist.github.com/cae8d43780c45a5011ed

Thanks

---------------------------------------------------------------------------

by bschussek at 2012-07-23T20:58:12Z

What about `uniqueNull` (`false` by default)? `ignoreNull` (`true` by default)? I find `allowMultipleNull` a bit cumbersome.

---------------------------------------------------------------------------

by stof at 2012-07-23T20:58:26Z

no it is not. You have an issue in the validator. You have an extra negation.

Please update your PR

---------------------------------------------------------------------------

by Garfield-fr at 2012-07-23T21:01:59Z

@stof `ignoreNull` is ok for you ?

---------------------------------------------------------------------------

by stof at 2012-07-23T21:10:24Z

yes

---------------------------------------------------------------------------

by fabpot at 2012-08-05T07:48:03Z

Is it mergeable now? Is yes, @Garfield-fr Can you squash your commits?

---------------------------------------------------------------------------

by travisbot at 2012-08-05T08:43:23Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/2039523) (merged 19ae3cf9 into c20c1d18).

---------------------------------------------------------------------------

by stof at 2012-08-05T12:09:02Z

@Garfield-fr when squashing the commits, you need to force the push as you are rewriting the history. You should not have merged with your remote branch

---------------------------------------------------------------------------

by Garfield-fr at 2012-08-05T12:10:15Z

What's the right solution for resolve this ?

---------------------------------------------------------------------------

by stof at 2012-08-05T12:11:09Z

@Garfield-fr reset your local branch to the squashed commit and force the push

---------------------------------------------------------------------------

by Garfield-fr at 2012-08-05T12:14:09Z

@stof Thanks for your help

---------------------------------------------------------------------------

by travisbot at 2012-08-05T12:19:06Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/2040210) (merged f1c4b8b4 into 20d2e5a1).
2012-08-06 10:17:10 +02:00
Fabien Potencier
ca9f5e8db3 merged branch modi/master (PR #5186)
Commits
-------

83269a4 update zh_CN translations of Form Component

Discussion
----------

update zh_CN translations of Form Component

---------------------------------------------------------------------------

by travisbot at 2012-08-06T01:45:01Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/2044024) (merged 83269a46 into 20d2e5a1).
2012-08-06 09:40:57 +02:00
modi
83269a46cb update zh_CN translations of Form Component 2012-08-06 09:36:49 +08:00
Christophe Coevoet
85187ec266 [DoctrineBridge] Fixed the testsuite 2012-08-05 14:43:59 +02:00
Fran Moreno
3d5b1dbfff [Validator] Updated Catalonian translations y fixed typos in Spanish 2012-08-05 12:26:28 +02:00
Bertrand Zuchuat
f1c4b8b415 [Doctrine Bridge] Added a parameter ignoreNull on Unique entity to allow a nullable value on field. Added Test 2012-08-05 10:35:10 +02:00
sun
5be7237b69 Added Yaml\Dumper::setIndentation() method to allow a custom indentation level of nested nodes.
YAML does not specify an absolute indentation level, but a consistent indentation of nested nodes only: http://www.yaml.org/spec/1.2/spec.html#space/indentation/

Projects that are generally using 2 spaces for indentation should be able to retain consistency with their coding standards by supplying a custom value for the new $indent parameter added to Yaml::dump(), or the new Dumper::setIndentation() method.

The new parameter is a backwards-compatible API addition and defaults to the previous default of 4 (which was changed from 2 via PR #2242 only recently).
2012-08-05 08:07:18 +02:00
Tobias Schultze
0706d18adc [Routing] fixed 4 bugs in the UrlGenerator 2012-08-05 05:44:00 +02:00
Fabien Potencier
c99f9d29cd fixed merge 2012-08-04 12:08:20 +02:00
Fabien Potencier
d6374ae531 bumped Symfony version to 2.1.0-DEV 2012-08-04 12:04:35 +02:00
Fabien Potencier
443e77ddec updated VERSION for 2.1.0-RC1 2012-08-04 11:32:21 +02:00
Fabien Potencier
7a75a1160b merged branch EvanK/master (PR #5132)
Commits
-------

aa890ae validateOptionTypes checking existence of key rather than value
c6a9638 OptionsResolver#validateOptionTypes should check if option value exists before checking its type; added corresponding test

Discussion
----------

[OptionsResolver] validateOptionTypes raises error for optional, nonexistant option values

The [`OptionsResolver#validateOptionTypes`](https://github.com/symfony/OptionsResolver/blob/master/OptionsResolver.php#L315) method should check if a given option value exists before trying to test its type:

```php
<?php
// Two optional 'one' and 'two' options that, if they exist, must be a string and int respectively
$resolver = new OptionsResolver();
$resolver->setOptional(array('one', 'two'))->setAllowedTypes(array('one' => 'string', 'two' => 'int'));

// Correctly fails as wrong type
$resolver->resolve(array('one' => 1, 'two' => 'alpha'));

// Correctly succeeds
$resolver->resolve(array('one' => 'alpha', 'two' => 1));

// Raises error "Undefined index: two", see OptionsResolver.php line 315
$resolver->resolve(array('one' => 'alpha'));
```

---------------------------------------------------------------------------

by travisbot at 2012-08-01T01:46:50Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/2006049) (merged c6a9638a into b1618d21).

---------------------------------------------------------------------------

by ericclemmons at 2012-08-03T05:15:27Z

I hope this makes it in for the 2.1 release.  We have several types attempting to take advantage of the `OptionsResolver` component and want to help resolve this.

---------------------------------------------------------------------------

by stof at 2012-08-03T07:30:44Z

👍

---------------------------------------------------------------------------

by travisbot at 2012-08-03T17:25:12Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/2030053) (merged aa890aed into b1618d21).
2012-08-04 11:23:52 +02:00
Fabien Potencier
ed5153d810 merged branch franmomu/patch-2 (PR #5177)
Commits
-------

981da1a [Validator] Updated Spanish translations

Discussion
----------

[Validator] Updated Spanish translations

---------------------------------------------------------------------------

by travisbot at 2012-08-03T23:06:26Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/2032706) (merged 981da1a9 into be41ca35).
2012-08-04 11:19:37 +02:00
Fabien Potencier
aeaa69ae43 [HttpFoundation] fixed tests (refs #5175) 2012-08-04 11:18:38 +02:00
Fabien Potencier
3f51bc0a3d [HttpFoundation] fixed typo (refs #5175) 2012-08-04 11:17:35 +02:00
Fran Moreno
981da1a908 [Validator] Updated Spanish translations 2012-08-04 01:58:06 +03:00
chx
b00ea41769 StreamedResponse always sends a HTTP 1.1 response
SERVER_PROTOCOL is "Name and revision of the information protocol via which the page was requested; i.e. 'HTTP/1.0'"
2012-08-03 21:27:14 +03:00
Evan Kaufman
aa890aedfc validateOptionTypes checking existence of key rather than value 2012-08-03 12:17:58 -05:00
Fabien Potencier
be41ca353b merged branch cs278/master (PR #5172)
Commits
-------

d1aae0b [Form] Fix UnexpectedTypeException from HttpFoundation extension

Discussion
----------

[Form] Fix UnexpectedTypeException from HttpFoundation extension

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -

Fixes exception thrown by the `AbstractExtension` because the wrong method has been implemented.

```
Uncaught exception 'Symfony\\Component\\Form\\Exception\\UnexpectedTypeException' with message 'Expected argument of type "Symfony\\Component\\Form\\FormTypeInterface", "Symfony\\Component\\Form\\Extension\\HttpFoundation\\Type\\FormTypeHttpFoundationExtension" given' in vendor/symfony/form/Symfony/Component/Form/AbstractExtension.php:153
```

---------------------------------------------------------------------------

by stof at 2012-08-03T12:36:55Z

👍
2012-08-03 14:48:44 +02:00
Fabien Potencier
c5346610f3 Merge branch '2.0'
* 2.0:
  Fixes incorrect class used in src/Symfony/Bundle/FrameworkBundle/Console/Application.php
  [FrameworkBundle] added test for fix broken command registration
  corrected phpdoc
2012-08-03 14:44:30 +02:00
Fabien Potencier
89dce2df51 merged branch SamsonIT/fix_broken_command_registration (PR #5169)
Commits
-------

55a0b34 Fixes incorrect class used in src/Symfony/Bundle/FrameworkBundle/Console/Application.php
79c547f [FrameworkBundle] added test for fix broken command registration

Discussion
----------

[FrameworkBundle] fix broken command registration

fixed #5168, #5166

---------------------------------------------------------------------------

by travisbot at 2012-08-03T11:35:29Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/2027699) (merged 39e964b8 into fee3f4e1).

---------------------------------------------------------------------------

by travisbot at 2012-08-03T11:45:14Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/2027761) (merged 55a0b347 into fee3f4e1).

---------------------------------------------------------------------------

by xeross at 2012-08-03T11:45:45Z

Duplicate of #5166

---------------------------------------------------------------------------

by Burgov at 2012-08-03T11:47:54Z

@xeross that PR was opened on master instead of 2.0

---------------------------------------------------------------------------

by xeross at 2012-08-03T11:48:49Z

@Burgov Ah sorry, I got confused and thought this was another dupe
2012-08-03 14:43:49 +02:00
Fabien Potencier
982545350b merged branch lsmith77/container_builder_cosmetics (PR #5165)
Commits
-------

4563397 corrected phpdoc

Discussion
----------

corrected phpdoc

---------------------------------------------------------------------------

by travisbot at 2012-08-03T09:37:07Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/2026993) (merged 4563397c into fee3f4e1).
2012-08-03 14:40:59 +02:00
Chris Smith
d1aae0b106 [Form] Fix UnexpectedTypeException from HttpFoundation extension 2012-08-03 13:20:47 +01:00
smokeybear87
55a0b347a0 Fixes incorrect class used in src/Symfony/Bundle/FrameworkBundle/Console/Application.php
Issue must be related to commit 7a5f614240 (merged 2.0), specifically this file src/Symfony/Bundle/FrameworkBundle/Console/Application.php, lines 86-88. 

Presumably to do "instanceof Bundle" correct class has to be imported at the top of the file:

instead of 
use Symfony\Component\HttpKernel\Bundle;

this should be
use Symfony\Component\HttpKernel\Bundle\Bundle;
Conflicts:

	src/Symfony/Bundle/FrameworkBundle/Console/Application.php
2012-08-03 13:33:57 +02:00
Bart van den Burg
79c547f09c [FrameworkBundle] added test for fix broken command registration 2012-08-03 13:33:31 +02:00
lsmith77
4563397c0a corrected phpdoc 2012-08-03 11:27:08 +02:00
Fabien Potencier
48e384b6e0 merged branch vicb/doctrine_logger_2.1 (PR #5162)
Commits
-------

6097c80 [DoctrineBridge] Fix log of non utf8 data

Discussion
----------

[DoctrineBridge] Fix log of non utf8 data

relates to #5139 (fix #5115 for 2.1)

---------------------------------------------------------------------------

by travisbot at 2012-08-03T08:34:14Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/2026546) (merged 6097c804 into 6f32078b).
2012-08-03 11:14:28 +02:00
Fabien Potencier
7a5f614240 merged 2.0 2012-08-03 11:11:11 +02:00
Fabien Potencier
fee3f4e1ef merged branch vicb/doctrine_logger (PR #5139)
Commits
-------

a0709fc [DoctrineBridge] Fix log of non utf8 data

Discussion
----------

Doctrine logger - fix logging of binary data

fix #5115

---------------------------------------------------------------------------

by travisbot at 2012-08-01T11:21:07Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/2008862) (merged a0709fc3 into 1da896dc).

---------------------------------------------------------------------------

by stof at 2012-08-01T11:54:45Z

I see a way to fix it in a far better way: instead of json_encoding the parameters and appending them to the SQL, we could pass them as context to the logger (the optional second argument) as Monolog already handles normalizing the context (and in a better way silencing the error).
Btw, this would also make the log message better for rich logger as they would receive the array (for instance, the FirephpHandler is able to send the context as an array instead of a string as firebug is able to dump arrays)

---------------------------------------------------------------------------

by vicb at 2012-08-01T12:19:06Z

@stof you're right that would be much better. What about keeping this fix for 2.0 and use your suggestion for 2.1 (as the public `log` method prototype would change (to take the context as argument) ?

---------------------------------------------------------------------------

by stof at 2012-08-01T12:21:09Z

@vicb as the method is public, it need to be done in 2.1 only indeed. The next question being "why is it public ?" :)

---------------------------------------------------------------------------

by fabpot at 2012-08-03T07:47:39Z

So, what's the next step?

---------------------------------------------------------------------------

by vicb at 2012-08-03T07:48:38Z

I think this should be merged in 2.0 and then 2.1 should be updated with the suggestion from @stof

---------------------------------------------------------------------------

by fabpot at 2012-08-03T07:54:16Z

Can you provide a PR for 2.1 so that I merge both at the same time?
2012-08-03 10:46:13 +02:00
Fabien Potencier
6b94407e1c merged branch dlsniper/php-engine-escape-cache (PR #5117)
Commits
-------

22cb817 Caching variables for the PHP templating engine

Discussion
----------

[Templating] PHP templating engine speed-ups

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/dlsniper/symfony.png?branch=php-engine-escape-cache)](http://travis-ci.org/dlsniper/symfony)
Fixes the following tickets: ~
Todo: ~
License of the code: MIT
Documentation PR: ~

This PR should improve the speed for rendering the form present here: https://github.com/dlsniper/symfony-standard . On my computer, Ubuntu 12.04 Apache 2.2.22 + mod_php 5.3.10 default packages from Ubuntu on a core i7 I get about 30-40ms improvement / request with the first commit and with the second one I get a further smaller boost and also a small memory usage decrease.

---------------------------------------------------------------------------

by dlsniper at 2012-07-31T06:18:54Z

ping @bschussek This should help a bit more on the effort for optimizing the example provided for the Forms component.

If there's another example of complex form(s) let me know so that I can have a look on them as well. Thanks!

---------------------------------------------------------------------------

by travisbot at 2012-07-31T19:55:03Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/2003907) (merged 240152b9 into a172a812).

---------------------------------------------------------------------------

by dlsniper at 2012-08-02T07:41:03Z

@fabpot what do you think about this? or anyone else for that matter?

---------------------------------------------------------------------------

by travisbot at 2012-08-02T12:55:54Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/2018613) (merged 5e773e79 into a172a812).

---------------------------------------------------------------------------

by fabpot at 2012-08-03T07:42:31Z

Can you squash your commits?

---------------------------------------------------------------------------

by dlsniper at 2012-08-03T08:32:05Z

@fabpot Done

---------------------------------------------------------------------------

by travisbot at 2012-08-03T08:40:46Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/2026559) (merged 22cb8173 into 6f32078b).
2012-08-03 10:43:22 +02:00
Florin Patan
22cb8173b5 Caching variables for the PHP templating engine 2012-08-03 11:28:29 +03:00
lsmith77
3605c54f9d removed unused private property 2012-08-03 10:28:23 +02:00
lsmith77
d4a78a21de fix phpdoc statement of getAlias() 2012-08-03 10:28:07 +02:00
Victor Berchet
6097c804ce [DoctrineBridge] Fix log of non utf8 data 2012-08-03 10:23:47 +02:00
Fabien Potencier
13c60bdeaf merged branch henrikbjorn/2.0 (PR #5137)
Commits
-------

0b78fdf Only call registerCommand on bundles that is an instance of Bundle

Discussion
----------

Only call registerCommand on bundles that is an instance of Bundle

Fixes GH-5133

---------------------------------------------------------------------------

by travisbot at 2012-08-01T09:41:05Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/2008252) (merged 0b78fdff into 1da896dc).

---------------------------------------------------------------------------

by henrikbjorn at 2012-08-01T10:05:00Z

Build failed because of HTTP request error.

---------------------------------------------------------------------------

by lsmith77 at 2012-08-01T11:31:08Z

wondering if it would be good if you could include the commit from #5133 in this PR .. then we get the test and the fix at once.
2012-08-03 10:19:10 +02:00
Victor Berchet
a0709fc365 [DoctrineBridge] Fix log of non utf8 data 2012-08-01 13:10:42 +02:00
Henrik Bjørnskov
0b78fdffa4 Only call registerCommand on bundles that is an instance of Bundle
Fixes GH-5133
2012-08-01 11:35:03 +02:00
Josiah Truasheim
30bcb57286 Added a test case to demonstrate the fatal error occuring when a Bundle implementing BundleInterface only is registered in the kernel. 2012-08-01 09:25:05 +07:00
Evan Kaufman
c6a9638adb OptionsResolver#validateOptionTypes should check if option value exists before checking its type; added corresponding test
OptionsResolver#validateOptionsCompleteness would already have thrown exception if the option were required, so this should only affect something explicitly marked as optional
2012-07-31 20:34:40 -05:00
Fabien Potencier
b1618d210c merged branch vicb/doctrine_deps (PR #5127)
Commits
-------

4ae54e3 [Composer] Bumped doctrine/orm to 2.2.3

Discussion
----------

[Composer] Bumped doctrine/orm to 2.2.3

fix #4966

---------------------------------------------------------------------------

by stloyd at 2012-07-31T15:01:41Z

You should also _bump_ Security component [deps](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Security/composer.json#L28).

---------------------------------------------------------------------------

by vicb at 2012-07-31T15:05:03Z

The security does not depend on `doctrine/orm`
2012-07-31 17:06:32 +02:00
Victor Berchet
4ae54e39fc [Composer] Bumped doctrine/orm to 2.2.3 2012-07-31 16:51:24 +02:00
Fabien Potencier
ee2b8c474e merged branch bschussek/bootstrap (PR #5112)
Commits
-------

b982883 [Form] Moved FormHelper back to FrameworkBundle
cb62d05 [Form] [Validator] Fixed issues mentioned in the PR
2185ca8 [Validator] Added entry point "Validation" for more convenient usage outside of Symfony2
ed87361 [Form] Moved FormHelper creation to TemplatingExtension
87ccb6a [Form] Added entry point "Forms" for more convenient usage outside of Symfony

Discussion
----------

[Form] [Validator] Added more convenient entry points for stand-alone usage

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -

This PR greatly simplifies the usage of the Form and Validator component when used outside of Symfony2. Check out the below code to get an idea about the simplified usage:

```php
<?php

use Symfony\Component\Validator\Validation;
use Symfony\Component\Validator\Mapping\Cache\ApcCache;
use Symfony\Component\Form\Forms;
use Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationExtension;
use Symfony\Component\Form\Extension\Csrf\CsrfExtension;
use Symfony\Component\Form\Extension\Csrf\CsrfProvider\SessionCsrfProvider;
use Symfony\Component\Form\Extension\Templating\TemplatingExtension;
use Symfony\Component\Form\Extension\Validator\ValidatorExtension;
use Symfony\Component\HttpFoundation\Session;
use Symfony\Component\Templating\PhpEngine;

$session = new Session();
$secret = 'V8a5Z97e...';
$csrfProvider = new SessionCsrfProvider($session, $secret);
$engine = new PhpEngine(/* ... snap ... */);

$validator = Validation::createValidator();
// or
$validator = Validation::createValidatorBuilder()
    ->addXmlMapping('path/to/mapping.xml')
    ->addYamlMapping('path/to/mapping.yml')
    ->addMethodMapping('loadValidatorMetadata')
    ->enableAnnotationMapping()
    ->setMetadataCache(new ApcCache())
    ->getValidator();

$formFactory = Forms::createFormFactory();
// or
$formFactory = Forms::createFormFactoryBuilder()
    // custom types, if you're too lazy to create an extension :)
    ->addType(new PersonType())
    ->addType(new PhoneNumberType())
    ->addTypeExtension(new FormTypeHelpTextExtension())
    // desired extensions (CoreExtension is loaded by default)
    ->addExtension(new HttpFoundationExtension())
    ->addExtension(new CsrfExtension($csrfProvider))
    ->addExtension(new TemplatingExtension($engine, $csrfProvider, array(
        'FormBundle:Form'
    ))
    ->addExtension(new ValidatorExtension($validator))
    ->getFormFactory();

$form = $formFactory->createBuilder()
    ->add('firstName', 'text')
    ->add('lastName', 'text')
    ->add('age', 'integer')
    ->add('gender', 'choice', array(
        'choices' => array('m' => 'Male', 'f' => 'Female'),
    ))
    ->getForm();

if (isset($_POST[$form->getName()])) {
    $form->bind($_POST[$form->getName()]);

    if ($form->isValid()) {
        // do stuff
    }
}

return $engine->render('AcmeHelloBundle:Hello:index.html.php', array(
    'form' => $form->createView(),
));
```

---------------------------------------------------------------------------

by bschussek at 2012-07-30T10:08:42Z

I should maybe add a comment about the benefits of this change, in case they are not self-explanatory:

* class construction with default configuration is now a one-liner
* userland code is decoupled from core implementations → userland code doesn't break if we change constructor signatures
* easier to understand, since many core classes are now created internally
* easy to discover the possible settings → just look at (FormFactory|Validator)BuilderInterface
* usage of custom interface implementations is supported, just like before

---------------------------------------------------------------------------

by fabpot at 2012-07-31T08:18:53Z

The new syntax is great.

I have one comment though about this PR about support of PHP as a templating system (support for Twig is provided by the bridge and it was already easy to configure Twig as a templating system for forms -- see Silex for instance).

The `FormHelper` has been moved into the Form component. This helper is only useful when using the PHP templating system (which is not what we recommend people to use), but the default templates are still in the Framework bundle. So using the Form component as standalone with PHP as a templating system still requires to install the bundle to get access to the default templates. Am I missing something? Do we want to move the PHP templates to the Form component too?

---------------------------------------------------------------------------

by stof at 2012-07-31T08:28:28Z

@fabpot it is even worse than that: the FormHelper currently uses the theme by using ``$theme . ':' . $block . '.html.php`` IIRC. This is not compatible with the default template name parser of the component expecting a path. And the FrameworkBundle template name parser does not support accessing a template outside a bundle AFAIK.
So moving the templating to the component would require some refactoring in the FormHelper and the template name parser. However, I think it is worth it. Some people complained that using the form rendering (outside the full-stack framework) was requiring either setting up Twig with the bridge, or adding FrameworkBundle in the project (which means including most of the code of the full-stack framework). Having the Templating rendering in the standalone component could be a great idea

---------------------------------------------------------------------------

by fabpot at 2012-07-31T08:42:53Z

But then, I don't want to promote the Templating component or the PHP templating system. Twig is always a better alternative and this should be what people use most of the time, PHP being the rare exception.

Anyway, we are too close from the first 2.1 RC, so any big refactoring will have to wait for 2.2.

---------------------------------------------------------------------------

by stof at 2012-07-31T09:02:10Z

then maybe we should keep the FormHelper in FrameworkBundle for now as it is tied to the FrameworkBundle template name parser anyway currently.

---------------------------------------------------------------------------

by bschussek at 2012-07-31T14:22:35Z

> it it is even worse than that: the FormHelper currently uses the theme by using ``$theme . ':' . $block . '.html.php`` IIRC. This is not compatible with the default template name parser of the component expecting a path.

This is why the templates are still in FrameworkBundle. I think they should be moved too, but then we have to change

* the default theme to an absolute file path
* the FrameworkBundle name parser to accept absolute paths

I think this can wait until 2.2. Baby steps.

> I don't want to promote the Templating component or the PHP templating system.

We can both promote Twig while making Templating as easy to use as possible. If people want to use Templating, they probably have a reason. We don't have to make their lives more painful than necessary.

Btw: Templating is a *lot* faster for rendering forms than Twig. On Denis' form, Templating takes 1.15 seconds while Twig takes 2.

About moving the helpers, we have two choices:

* Move each helper to the respective component. This would not require new releases of the Templating component when we add more helpers in other component.

* Move all helpers to Templating. This does not make that much sense for Form, as then Form has support for Templating (TemplatingRendererEngine) and Templating has support for Form (FormHelper), which is a bit weird. I personally prefer a stacked architecture, where Templating is at the bottom and Form-agnostic, and Form (or any other component) builds upon that.

I'm fine with both approaches. I'll move FormHelper back to FrameworkBundle, and we can decide for a direction in 2.2.

---------------------------------------------------------------------------

by bschussek at 2012-07-31T14:36:30Z

Done.
2012-07-31 16:38:15 +02:00
Bernhard Schussek
b982883a85 [Form] Moved FormHelper back to FrameworkBundle 2012-07-31 16:35:46 +02:00
Fabien Potencier
4b521985f1 merged branch vicb/lenient_generator (PR #5114)
Commits
-------

03bbaaf [Routing] Add an interface for configuring strict_parameters

Discussion
----------

[RFC][Routing] Add an interface for configuring strict_parameters

This is a proposal to fix #4697 (related to #4592).

The main point left to discuss was the name of the interface, which is now `LenientInterface`. We could change the name to anything else is someone has a better idea.

@stof @Tobion what do you think ?

---------------------------------------------------------------------------

by stof at 2012-07-30T16:34:20Z

@vicb I already said I had no idea to name it, and it has not changed. :)
So let's wait for other people to see if they have a better idea

---------------------------------------------------------------------------

by breerly at 2012-07-30T16:38:38Z

Maybe `PermissibleInterface` or `PermissiveInterface`.

---------------------------------------------------------------------------

by Partugal at 2012-07-30T17:00:09Z

`StrictUrlGeneratorInterface`, `StrictParametersInterface` or `StrictInterface`

---------------------------------------------------------------------------

by pborreli at 2012-07-30T17:04:46Z

👍 for `PermissiveInterface`

---------------------------------------------------------------------------

by stof at 2012-07-30T17:07:59Z

yes, because the Router currently can only use this interface to set it to ``not-strict``. It assumes that the url generator is already strict by default (which is probably a bad assumption btw as the base class for the generated generator can be changed)

---------------------------------------------------------------------------

by pborreli at 2012-07-30T17:09:33Z

@stof thx, got it

---------------------------------------------------------------------------

by Partugal at 2012-07-30T17:10:03Z

this interface realize setting Strict by setStrictParameters, and get by getStrictParameters, and imho named it by `Strictable` is more logic

---------------------------------------------------------------------------

by pborreli at 2012-07-30T17:11:07Z

@Partugal let's try to find an english term :)

---------------------------------------------------------------------------

by Partugal at 2012-07-30T17:11:31Z

)

---------------------------------------------------------------------------

by breerly at 2012-07-30T17:15:23Z

@Partugal I like using "able" in interface names because it describes a behavior instead of a noun. This type of naming makes following the Interface Segregation Principle easy to follow. Good work.

---------------------------------------------------------------------------

by vicb at 2012-07-30T18:24:26Z

As explained by @stof I did not consider `StrictInterface` because as of now the interface is used to disabled the strict bevahior (which is enabled by default).

I am not satisfied with `PermissiveInterface` / `LenientInterface` because implementing this interface does not mean that the generator will be permissive but only that the behavior is configurable - yes I did consider `Configurable` but the term is a too vague.

---------------------------------------------------------------------------

by breerly at 2012-07-30T18:35:45Z

I see. Perhaps ```StrictConfigurableInterface``` would do the trick.

---------------------------------------------------------------------------

by Tobion at 2012-07-30T21:02:21Z

I think renaming strict_parameters to `strict_requirements` is the way to go because it determines how requirements are handled when generating a URL. Also we should allow another option:
strict_requirements = true: throw exception for mismatching requirements
strict_requirements = null: return null as URL for mismatching requirements and log it.
strict_requirements = false: return the URL with the given parameters without checking the requirements and don't log it.
(Maybe use constants for these).
The Interface I would then call `ConfigurableRequirementsInterface` or `RequirementsHandlingInterface`.

---------------------------------------------------------------------------

by vicb at 2012-07-31T07:23:24Z

Thanks all for the feeback, this is what is now implemented:

- A `ConfigurableRequirementsInterface` that should be implemented by generators that can be configure not to throw an exception when the parameters do not match the requirements,
- The interface has two methods: `setStrictRequirements()` and `isStrictRequirements()`,
- `setStrictRequirements()` always gets called to configure the generator (whatever the option value is)

Note: The Router option name has not changed (i.e. `strict_parameters`)

Does that fit everyone ?

---------------------------------------------------------------------------

by vicb at 2012-07-31T07:39:22Z

So the option name is now consistent (`strict_requirements`) with the interface. We should sync the change [in the standard edition](https://github.com/symfony/symfony-standard/blob/master/app/config/config.yml#L11) if we agree to merge this.

---------------------------------------------------------------------------

by fabpot at 2012-07-31T07:51:47Z

@vicb you forgot to rename the property in `UrlGenerator` as @stof mentioned above.

---------------------------------------------------------------------------

by vicb at 2012-07-31T07:59:57Z

@fabpot fixed. If the code is ok, I'll squash the commits and open a PR on symfony-standard
2012-07-31 16:16:14 +02:00
Victor Berchet
03bbaaf325 [Routing] Add an interface for configuring strict_parameters 2012-07-31 16:14:37 +02:00
lsmith77
cdfbe72be4 handle inheritance in config:dump-reference when a bundle name is passed to the command 2012-07-31 15:20:04 +02:00
Bilal Amarni
f84f5fd6b5 fixed typo 2012-07-31 16:07:47 +03:00
Fabien Potencier
788e5eb730 [HttpKernel] added a way to override the default response status code when handling an exception (closes #5043) 2012-07-31 10:32:57 +02:00
Bernhard Schussek
cb62d05f8d [Form] [Validator] Fixed issues mentioned in the PR 2012-07-30 16:22:02 +02:00
Bernhard Schussek
2185ca80e2 [Validator] Added entry point "Validation" for more convenient usage outside of Symfony2 2012-07-30 11:41:40 +02:00
Bernhard Schussek
ed8736140f [Form] Moved FormHelper creation to TemplatingExtension 2012-07-30 11:41:40 +02:00
Bernhard Schussek
87ccb6adb9 [Form] Added entry point "Forms" for more convenient usage outside of Symfony 2012-07-30 11:41:38 +02:00
Fabien Potencier
a172a81296 merged branch pborreli/browserkit (PR #5097)
Commits
-------

910b60d [BrowserKit] Added some tests, removed dead code

Discussion
----------

[BrowserKit] Added some tests

Code coverage : 99.68%
2012-07-30 11:17:59 +02:00
Fabien Potencier
cbd03ec4c6 merged branch vicb/resolver_options (PR #5110)
Commits
-------

a47922b [OptionsResolver] Fix Options::has() when the value is null

Discussion
----------

[OptionsResolver] Fix Options::has() when the value is null

`isset()` would have returned `false` when the value is `null`
2012-07-30 10:08:33 +02:00
Victor Berchet
a47922b4bf [OptionsResolver] Fix Options::has() when the value is null 2012-07-30 09:38:43 +02:00
Bernhard Schussek
8070e6997e [Form] Fixed ResolvedFormType to really be replaceable 2012-07-29 19:13:45 +02:00
Fabien Potencier
6b39ebc4f8 merged branch bschussek/httpfoundationextension (PR #5103)
Commits
-------

173b929 [Form] Completely decoupled CoreExtension from HttpFoundation

Discussion
----------

[Form] Completely decoupled CoreExtension from HttpFoundation

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
2012-07-29 16:33:05 +02:00
Bernhard Schussek
173b929219 [Form] Completely decoupled CoreExtension from HttpFoundation 2012-07-29 16:18:04 +02:00
Bernhard Schussek
57ac110e77 [Form] Removed unnecessary method call 2012-07-29 15:49:21 +02:00
Bernhard Schussek
27ab56d8ee [OptionsResolver] Removed LazyOption class and improved performance a tiny bit 2012-07-29 15:25:40 +02:00
Pascal Borreli
910b60de70 [BrowserKit] Added some tests, removed dead code 2012-07-29 12:17:46 +00:00
Fabien Potencier
50652a9717 merged branch pborreli/phpdoctypos (PR #5096)
Commits
-------

6ac8e73 Fixed typos
4c726ea Fixed Phpdoc

Discussion
----------

Fixed some typos
2012-07-29 11:20:51 +02:00
Pascal Borreli
6ac8e7308d Fixed typos 2012-07-28 22:02:29 +00:00
Pascal Borreli
4c726ea64c Fixed Phpdoc 2012-07-28 16:07:17 +00:00
Bernhard Schussek
04cb5bc457 [Form] Removed the ImmutableFormConfig class to save time spent with copying values (+20ms) 2012-07-28 10:59:23 +02:00
Bernhard Schussek
a845a28a76 [Form] Optimized form events to only be created on demand 2012-07-28 08:47:13 +02:00
Fabien Potencier
180f4a66ed merged branch pborreli/filesystem-windows (PR #5088)
Commits
-------

03c3712 [Filesystem] Fixed 2 tests throwing error on windows
3689bb8 [Filesystem] Fixed 3 failing tests on windows

Discussion
----------

[Filesystem] Fixed 5 tests on windows

Fixing 3 test expecting wrong folders :

```
-'C:\Users\pascal\AppData\Local\Temp\\1343425847694\file'
+'C:\Users\pascal\AppData\Local\Temp\1343425847694\file'
```

Fixed 2 tests on Windows caused by symlink function throwing error when first argument is not existent :
```
symlink(): Could not fetch file information(error 2)
```
2012-07-28 08:26:08 +02:00
Fabien Potencier
c56f47141f merged branch Dattaya/framework-bundle/assets-install-command (PR #5084)
Commits
-------

f402a16 [FrameworkBundle] AssetsInstallCommand. Made 'web' as a default folder.

Discussion
----------

[FrameworkBundle] AssetsInstallCommand. Made 'web' as a default folder.

Bug fix: no
Feature addition: yes
Backwards compatibility break: not sure
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
License of the code: MIT

>'The target directory (usually "web")'

It is indeed a folder that's usually used to install assets, why not making it as a default value?
2012-07-28 08:22:01 +02:00
Pascal Borreli
03c3712fb3 [Filesystem] Fixed 2 tests throwing error on windows 2012-07-28 02:26:14 +00:00
Pascal Borreli
3689bb8b9d [Filesystem] Fixed 3 failing tests on windows 2012-07-27 21:54:21 +00:00
Yaroslav Kiliba
f402a1643c [FrameworkBundle] AssetsInstallCommand. Made 'web' as a default folder. 2012-07-27 18:49:52 +03:00
Larry Garfield
76815fe664 Allow the targetUrl on a redirect response to be set explicilty. 2012-07-27 09:40:11 -05:00
Pascal Borreli
3e4c9b2824 [Routing] Fixed alteration of $_SERVER 2012-07-27 10:50:12 +00:00
Martin Hasoň
b384c82ea6 [HttpFoundation] Fixed checking IPv6 address without bit-length of the prefix 2012-07-27 11:07:24 +02:00
Fabien Potencier
beb000908c [Finder] fixed various CS issues and added a reference to the relevant PHP bug 2012-07-27 09:35:03 +02:00
Fabien Potencier
7b1d6b806e merged branch alebo/ticket_4922 (PR #4993)
Commits
-------

ae6016c [Finder] Workaround for FilterIterator-FilesystemIterator-rewind issue

Discussion
----------

[Finder] Workaround for the problem with rewind of FilterIterator with inner FilesystemIterator.

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #4922
Todo: -
License of the code: MIT
Documentation PR: -

---------------------------------------------------------------------------

by stof at 2012-07-20T10:28:05Z

Please add some tests

---------------------------------------------------------------------------

by alebo at 2012-07-24T09:50:36Z

Any feedback yet? The new commit includes tests.
2012-07-27 09:24:52 +02:00
Fabien Potencier
87f89706f2 merged branch adrienbrault/patch-2 (PR #5065)
Commits
-------

4d09907 [Serializer] Add a docblock to help type hinting

Discussion
----------

[Serializer] Add a docblock to help type hinting

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets:
Todo:
License of the code: MIT
Documentation PR:
2012-07-27 09:20:54 +02:00
Fabien Potencier
1da896dc7e merged branch diaspar/2.0-pdosessionstorage-issue3255 (PR #5070)
Commits
-------

9e28593 fixed error on oracle db related to clob data. https://github.com/symfony/symfony/issues/3255

Discussion
----------

fixed error on pdosession storage for oracle db. Related to clob data

Did a change on 2.0 branch to fix this error

https://github.com/symfony/symfony/issues/3255

Tested on mysql and Oracle DB.

I also ran a phpunit test before commit:

phpunit tests/Symfony/Tests/Component/HttpFoundation/SessionStorage/PdoSessionStorageTest.php
PHPUnit 3.6.10 by Sebastian Bergmann.

Time: 0 seconds, Memory: 2.75Mb

OK (3 tests, 5 assertions)

Time: 0 seconds, Memory: 2.75Mb
2012-07-27 07:31:54 +02:00
mauricio lopez
9e285937b9 fixed error on oracle db related to clob data.
https://github.com/symfony/symfony/issues/3255
2012-07-26 11:42:25 -05:00
Bernhard Schussek
9f4178b672 [Validator] Fixed: StaticMethodLoader does not try to invoke methods of interfaces anymore 2012-07-26 16:39:18 +02:00
Fabien Potencier
e1c65fa9c0 merged branch marcw/request-context-params (PR #5059)
Commits
-------

d30943c [FrameworkBundle] Switched to parameters for request context host and scheme

Discussion
----------

[FrameworkBundle] Switched to parameters for request context host and scheme
2012-07-26 16:16:22 +02:00
Fabien Potencier
77ce04d0b1 merged branch bschussek/normalizer-performance (PR #5067)
Commits
-------

d858f7b [OptionsResolver] Optimized previous values of a lazy option not to be evaluated if the second argument is not defined
8a338cb [OptionsResolver] Micro-optimization
e659f0e [OptionsResolver] Improved the performance of normalizers

Discussion
----------

[OptionsResolver] Improved the performance of normalizers

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -

Normalizers are now stored in the Options instance only once. Previously, normalizers were stored in Options upon resolving, which meant that they were added a lot of time if the same resolver was used for many different options arrays.

This improvement led to an improvement of 30ms on http://advancedform.gpserver.dk/app_dev.php/taxclasses/1

---------------------------------------------------------------------------

by beberlei at 2012-07-26T13:34:23Z

@bschussek do you have the code for this forms somewhere btw?

---------------------------------------------------------------------------

by bschussek at 2012-07-26T13:54:52Z

@beberlei https://github.com/stof/symfony-standard/tree/twig_forms
2012-07-26 15:55:52 +02:00
Bernhard Schussek
d858f7bdf3 [OptionsResolver] Optimized previous values of a lazy option not to be evaluated if the second argument is not defined 2012-07-26 15:36:09 +02:00
Bernhard Schussek
8a338cb6fa [OptionsResolver] Micro-optimization 2012-07-26 15:32:18 +02:00
Bernhard Schussek
e659f0e39d [OptionsResolver] Improved the performance of normalizers
Normalizers are now stored in the Options instance only once. Previously,
normalizers were stored in Options upon resolving, which meant that
they were added a lot of time if the same resolver was used for many
different options arrays.

This improvement led to an improvement of 30ms on
advancedform.gpserver.dk/app_dev.php/taxclasses/1
2012-07-26 15:21:14 +02:00
Adrien Brault
4d09907362 [Serializer] Add a docblock to help type hinting 2012-07-26 15:58:31 +03:00
marc.weistroff
d30943c2e8 [FrameworkBundle] Switched to parameters for request context host and scheme 2012-07-26 11:12:14 +02:00
Bernhard Schussek
6e59e6b085 [Form] Fixed: setData() is now guaranteed to be invoked before bind() 2012-07-26 10:55:40 +02:00
Bernhard Schussek
ef747ff767 [Form] Fixed exception message in ObjectChoiceList 2012-07-26 08:30:26 +02:00
Fabien Potencier
b122b37be7 [Security] tweaked previous merge 2012-07-26 08:13:41 +02:00
Jonathan Ingram
9030dc5dfc [Security] add docblocks to InteractiveLoginEvent
Close #5053 (was easier to just create a new PR).
2012-07-26 16:07:46 +10:00
Tobias Schultze
4a5dadb520 [Form] raise exception when label for choice cannot be read 2012-07-26 01:10:54 +02:00
Tobias Schultze
a3cbf6bbf6 [Form] add type hint in ChoiceList 2012-07-26 01:10:53 +02:00
Tobias Schultze
805393303c [Form] fix ChoiceList and ObjectChoiceList when choices is a Traversable 2012-07-26 01:10:52 +02:00
Tobias Schultze
6f7ea8dbbe [Form] fix ObjectChoiceList when property path is '0' 2012-07-26 01:05:13 +02:00
Tobias Schultze
8da33eb5bc [Form] fixed phpdoc of ChoiceList 2012-07-26 01:05:12 +02:00
Fabien Potencier
c7bc4791c4 merged branch bschussek/issue5029 (PR #5046)
Commits
-------

2607390 [Form] Fixed SearchAndRenderBlockNode to really ignore empty labels

Discussion
----------

[Form] Fixed SearchAndRenderBlockNode to really ignore empty labels

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #5029
Todo: -
2012-07-25 22:54:22 +02:00
Bernhard Schussek
0315d431f4 [Form] Fixed failing UniqueValidatorTest when Doctrine Common 2.2 is loaded 2012-07-25 22:49:37 +02:00
Bernhard Schussek
b4b5408fdc [Form] Fixed failing tests 2012-07-25 22:16:38 +02:00
Fabien Potencier
2ca73f9d7e merged branch pborreli/posix-fix (PR #5047)
Commits
-------

1d6611b [Filesystem] Fixed tests on system without posix

Discussion
----------

[Filesystem] Fixed tests on system without posix

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: master is broken
Fixes the following tickets: None
License of the code: MIT
2012-07-25 21:26:35 +02:00
Bernhard Schussek
9622703302 [Validator] Removed the Size constraint which did not exist in 2.0 2012-07-25 20:30:38 +02:00
Bernhard Schussek
2607390309 [Form] Fixed SearchAndRenderBlockNode to really ignore empty labels 2012-07-25 19:15:43 +02:00
Pascal Borreli
1d6611be50 [Filesystem] Fixed tests on system without posix 2012-07-25 17:04:57 +00:00
Bernhard Schussek
eeb66dd2ef [Form] Renamed the internal FormView variables "types" and "full_block_name" 2012-07-25 17:35:06 +02:00
Bernhard Schussek
6b17640647 [Form] Fixed caching of block names when types of forms with the same unique block ID differ 2012-07-25 17:31:36 +02:00
Bernhard Schussek
2a3235ac22 [Validator] Fixed group sequence support in the XML and YAML drivers 2012-07-25 17:27:01 +02:00
Fabien Potencier
2bc358dbcd merged branch bschussek/issue5029 (PR #5042)
Commits
-------

fb002d8 [Form] Fixed variable passing from outer to inner blocks of the same FormView instance

Discussion
----------

[Form] Fixed variable passing from outer to inner blocks of the same FormView instance

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #5029
Todo: -

This PR fixes two bugs.

The first bug is described in #5029. The second parameter to the "form_label" function in Twig, if given, always overwrote whatever label was defined previously.

```
{# null would overwrite whatever is currently set #}
form_label(form, null, { ... })
```

The second bug affected passing variables from outer to inner blocks. In the following example, "label_attr" would not be forwarded to the "form_label" function.

```
form_row(form, { "label_attr": { "class": "my_class" }})
```

Both bugs are fixed now.
2012-07-25 17:21:35 +02:00
Fabien Potencier
b52cbf46d0 merged branch gedrox/patch-1 (PR #5041)
Commits
-------

0ea3769 Fix not recognized "type" option exception

Discussion
----------

[Form] Fixed not recognized "type" option exception

The exception about not recognized "type" option was raised when "date", "datetime", "time" type was guessed by validator type guesser using the date related constraint.

---------------------------------------------------------------------------

by bschussek at 2012-07-25T11:30:23Z

Thanks! 👍
2012-07-25 17:21:08 +02:00
Fabien Potencier
950fff2790 merged branch bschussek/data (PR #5023)
Commits
-------

686bf6b [Form] Made original data of a form and choices accessible in templates

Discussion
----------

[Form] Made original data of a form and choices accessible in templates

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #4171
Todo: -

Now you can access the normalized data of a form in the template:
```
form.vars.data
```
You can also access the original data of a choice, for example the entities in an entity type:
```
choice.data
```
2012-07-25 17:18:20 +02:00
Bernhard Schussek
fb002d89ea [Form] Fixed variable passing from outer to inner blocks of the same FormView instance 2012-07-25 13:20:23 +02:00
gedrox
0ea3769664 Fix not recognized "type" option exception
The exception about not recognized "type" option was raised when "date", "datetime", "time" type was guessed by validator type guesser using the date related constraint.
2012-07-25 14:05:22 +03:00
Fabien Potencier
f4570d5e73 merged branch acasademont/use_referer_with_route_name (PR #5037)
Commits
-------

307d99c [Security] Fixed use_referer option not working properly when login_path is a route name

Discussion
----------

[Security] Fixed use_referer option not working properly when login_path...

... is a route name

When use_referer is set to true and the request comes from the login page,
the user should not be redirected to the login form again (the referer) but
to the default_target_path. The problem arises when our login_path option
is not a path but a route name, as the ```getUriForPath()``` method is not
made to create routes from route names.

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/acasademont/symfony.png?branch=master)](http://travis-ci.org/acasademont/symfony)
Fixes the following tickets: -
Todo: -
License of the code: MIT
Documentation PR: -

---------------------------------------------------------------------------

by stloyd at 2012-07-24T16:24:28Z

👍
2012-07-25 11:37:42 +02:00
Fabien Potencier
965fe3258b [HttpFoundation] fixed a PHP Notice (refs #5034) 2012-07-25 09:38:36 +02:00
Fabien Potencier
207124c973 fixed CS 2012-07-25 07:24:06 +02:00
Albert Casademont
307d99c8f6 [Security] Fixed use_referer option not working properly when login_path is a route name
When use_referer is set to true and the request comes from the login page,
the user should not be redirected to the login form again (the referer) but
to the default_target_path. The problem arises when our login_path option
is not a path but a route name, as the ```getUriForPath()``` method is not
made to create routes from route names.
2012-07-24 17:37:00 +02:00
Julien Pauli
286d03b5d2 Fix for #5033 2012-07-24 17:11:14 +02:00
Fabien Potencier
2aaa4ed84e bumped Symfony version to 2.1.0-DEV 2012-07-23 19:27:52 +02:00
Bernhard Schussek
686bf6b664 [Form] Made original data of a form and choices accessible in templates 2012-07-23 19:24:46 +02:00
Fabien Potencier
d81b9f56cb updated VERSION for 2.1.0-BETA4 2012-07-23 19:10:10 +02:00
Fabien Potencier
a5451e48b7 fixed typo 2012-07-23 18:54:03 +02:00
Fabien Potencier
8d33ba9fc5 merged 2.0 2012-07-23 16:25:26 +02:00
Fabien Potencier
bceb28ff7a merged branch parhs/2.0 (PR #5005)
Commits
-------

5bfc25e Fixed buildViewBottomUp docs

Discussion
----------

Fixed buildViewBottomUp docs

Fixed documentation
2012-07-23 16:23:36 +02:00
Fabien Potencier
76c1e26272 moved deps in recommend to suggest 2012-07-23 16:23:01 +02:00
Grégoire Pineau
e1f1d3a1f7 Added missing property 2012-07-23 16:09:36 +02:00
Fabien Potencier
f58c27544d merged branch drak/nativefile_savepath (PR #5016)
Commits
-------

ff273af [HttpFoundation][Sessions] Micro-optimization
9bf3cb4 [HttpFoundation][Sessions] Add support for extended save_path for native files save handler

Discussion
----------

[Sessions] Add support for extended save_path for native files save handler

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #4908
Todo: -
License of the code: MIT
Documentation PR: -
2012-07-23 15:55:36 +02:00
Drak
ff273af546 [HttpFoundation][Sessions] Micro-optimization 2012-07-23 12:18:38 +01:00
Bilal Amarni
91415b1371 removed unneeded class to compile 2012-07-23 12:27:23 +03:00
Drak
9bf3cb4e97 [HttpFoundation][Sessions] Add support for extended save_path for native files save handler 2012-07-23 09:59:09 +01:00
Fabien Potencier
c20c1d18dc merged branch bschussek/propertypath (PR #5011)
Commits
-------

dd2aa54 [Form] Disabled manual singulars in PropertyPath until the syntax is finalized

Discussion
----------

[Form] Disabled manual singulars in PropertyPath until the syntax is finalized

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
2012-07-22 10:03:04 +02:00
Fabien Potencier
4bafd1d788 [FrameworkBundle] removed temporary XDebug hack as the nesting issue has been resolved now 2012-07-22 10:02:56 +02:00
Bernhard Schussek
dd2aa54e15 [Form] Disabled manual singulars in PropertyPath until the syntax is finalized 2012-07-22 09:58:31 +02:00
Fabien Potencier
214e0554be merged branch bschussek/renderer (PR #5006)
Commits
-------

dc3a680 [Form] Improved FormRenderer API to reduce the size of the function call stack during rendering

Discussion
----------

[Form] Improved FormRenderer API to decrease the function call stack

Bug fix: no
Feature addition: no
Backwards compatibility break: **yes**
Symfony2 tests pass: yes
Fixes the following tickets: #4962, #4973
Todo: -

This PR reduces the function call stack size when rendering by directly calling the methods `renderBlock` and `searchAndRenderBlock` (formerly `renderSection`) and removing the delegating methods `render(Widget|Label|Row|...)`.

It breaks BC in that PHP templates now need to pass the FormView instance to `block` (formerly `renderBlock`). This is necessary, otherwise that function may behave buggy in special circumstances.

Otherwise this PR cleans up API method and parameter names to improve clarity.
2012-07-22 09:50:28 +02:00
Bernhard Schussek
eccc5bd0c6 [Form] Restored BC in AbstractType::getDefaultOptions() and getAllowedOptionValues() 2012-07-22 09:36:58 +02:00
Bernhard Schussek
dc3a680cd3 [Form] Improved FormRenderer API to reduce the size of the function call stack during rendering 2012-07-22 09:29:35 +02:00
Fabien Potencier
1be155ab8c [HttpFoundation] never send a 304 for non-safe HTTP methods 2012-07-21 21:52:19 +02:00
Fabien Potencier
019625d34e merged branch bschussek/options_performance (PR #5004)
Commits
-------

24b764e [Form] Fixed issues mentioned in the PR
9216816 [Form] Turned Twig filters into tests
310f985 [Form] Added a layer of 2.0 BC methods to FormView and updated UPGRADE and CHANGELOG
5984b18 [Form] Precalculated the closure for deciding whether a choice is selected (PHP +30ms, Twig +30ms)
5dc3c39 [Form] Moved the access to templating helpers out of the choice loop for performance reasons (PHP +100ms)
0ef9acb [Form] Moved the method isChoiceSelected() to the ChoiceView class (PHP +150ms)
8b72766 [Form] Tweaked the generation of option tags for performance (PHP +200ms, Twig +50ms)
400c95b [Form] Replace methods in ChoiceView by public properties (PHP +100ms, Twig +400ms)
d072f35 [Form] The properties of FormView are now accessed directly in order to increase performance (PHP +200ms, Twig +150ms)

Discussion
----------

[Form] Made FormView and ChoiceView properties public for performance reasons

Bug fix: no
Feature addition: no
Backwards compatibility break: **yes**
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -

This PR changes the access to properties of `FormView` and `ChoiceView` objects from getters to direct property accesses. On [my example form](http://advancedform.gpserver.dk/app_dev.php/taxclasses/1) this improves rendering performance for **300ms** with PHP templates and **550ms** with Twig on my local machine.

Unfortunately, this breaks BC both with 2.0 and with the current master in Form Types and PHP templates. Twig templates are not affected by this change.

2.0:
```
$formView->set('my_var', 'foobar');
$formView->get('my_var');
$formView->getChild('childName');
$formView['childName'];
```

master:
```
$formView->setVar('my_var', 'foobar');
$formView->getVar('my_var');
$formView->get('childName');
$formView['childName'];
```

this PR:
```
$formView->vars['my_var'] = 'foobar';
$formView->vars['my_var'];
$formView->children['childName'];
$formView['childName'];
```

Should we add methods to keep BC with 2.0?

The second part of this PR contains improvements to the rendering of choice fields. These gain another **~500ms** for PHP templates and **80ms** for Twig. These improvements are BC, unless you overwrote the block "choice_widget_options" in your form themes which then needs to be adapted.

**Update:**

The PR now includes a BC layer for 2.0.

---------------------------------------------------------------------------

by stof at 2012-07-21T11:37:41Z

@bschussek couldn't we keep the getters and setters for BC even if the rendering accesses the public properties directly ?

---------------------------------------------------------------------------

by bschussek at 2012-07-21T11:52:33Z

@stof A BC layer for 2.0 is now included. People who upgraded to master already unfortunately need to adapt their code.

---------------------------------------------------------------------------

by sstok at 2012-07-21T12:40:57Z

👍
2012-07-21 19:51:42 +02:00
Bernhard Schussek
24b764e066 [Form] Fixed issues mentioned in the PR 2012-07-21 19:45:31 +02:00
Bernhard Schussek
921681658c [Form] Turned Twig filters into tests 2012-07-21 17:26:50 +02:00
Bernhard Schussek
310f985b99 [Form] Added a layer of 2.0 BC methods to FormView and updated UPGRADE and CHANGELOG 2012-07-21 13:49:32 +02:00
Fabien Potencier
6c256b01b0 merged branch KaipiYann/Fix-DocBlock-attemptAuthentication (PR #4996)
Commits
-------

134cc84 [Security] Fix DocBlock of attemptAuthentication

Discussion
----------

[Security] Fix DocBlock of attemptAuthentication

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets:
Todo: -
License of the code: MIT
Documentation PR: -
2012-07-21 13:16:18 +02:00
Fabien Potencier
70477b7c95 merged branch Slamdunk/hotfix/late-static-create (PR #4991)
Commits
-------

9dc2011 Late static factory method

Discussion
----------

Late static factory method

When using `Symfony\CS\Finder\DefaultFinder::create()`, we lose all `Symfony\CS\Finder\DefaultFinder::__construct()` properties because main `Finder` does not use late static binding.

This commit resolves the issue.
2012-07-21 13:14:55 +02:00
Fabien Potencier
deb98d9163 merged branch bschussek/setdata_performance (PR #5003)
Commits
-------

d4f4038 [Form] Reduced the number of setData() calls by deferring a Form's initialization (+40ms)

Discussion
----------

[Form] Reduced the number of setData() calls

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -

This PR decreases the number of expensive `setData()` calls on `Form` instances by deferring the form's initialization with default data to the first call to a `get*Data()` method. If `setData()` is called manually before invoking `get*Data()`, the initialization with the default data will not take place.

Before:

```
$form = new Form($config); // implicit setData($config->getData());
$form->setData($object); // setData() is now called twice
```

After:

```
$form = new Form($config); // no implicit setData()
$form->getData(); // implicit setData($config->getData())

// or

$form = new Form($config);
$form->setData($object);
$form->getData(); // setData() was called only once
```
2012-07-21 13:12:45 +02:00
Bernhard Schussek
3075fa6b39 [OptionsResolver] Renamed filters to normalizers 2012-07-21 13:02:12 +02:00
Bernhard Schussek
d4f4038f6d [Form] Reduced the number of setData() calls by deferring a Form's initialization (+40ms) 2012-07-21 12:57:35 +02:00
Bernhard Schussek
5984b18a7a [Form] Precalculated the closure for deciding whether a choice is selected (PHP +30ms, Twig +30ms) 2012-07-21 12:56:50 +02:00
Bernhard Schussek
5dc3c39fd2 [Form] Moved the access to templating helpers out of the choice loop for performance reasons (PHP +100ms) 2012-07-21 12:56:50 +02:00
Bernhard Schussek
0ef9acb479 [Form] Moved the method isChoiceSelected() to the ChoiceView class (PHP +150ms) 2012-07-21 12:56:50 +02:00
Bernhard Schussek
8b72766473 [Form] Tweaked the generation of option tags for performance (PHP +200ms, Twig +50ms) 2012-07-21 12:56:50 +02:00
Bernhard Schussek
400c95bb4d [Form] Replace methods in ChoiceView by public properties (PHP +100ms, Twig +400ms) 2012-07-21 12:56:11 +02:00
Bernhard Schussek
d072f35ea0 [Form] The properties of FormView are now accessed directly in order to increase performance (PHP +200ms, Twig +150ms) 2012-07-21 12:56:11 +02:00
ddebree
37bbd0f60a Moved symfony/config from the "recommend" dependency to the "suggest" dependency. Cannot find "recommend" in composer documentation 2012-07-21 13:17:54 +03:00
parhs
5bfc25e6b3 Fixed buildViewBottomUp docs 2012-07-21 00:54:17 +03:00
Alex Bogomazov
ae6016c6fc [Finder] Workaround for FilterIterator-FilesystemIterator-rewind issue 2012-07-20 19:29:53 +03:00
Kaipi Yann
134cc84e99 [Security] Fix DocBlock of attemptAuthentication
Add Response as possible return type of the method because the method AbstractAuthenticationListener::handle() test if $returnValue is an instance of Response (line 148).
2012-07-20 15:46:05 +02:00
Filippo Tessarotto
9dc20116e3 Late static factory method 2012-07-20 11:54:42 +02:00
Fabien Potencier
9f157a1616 merged branch docteurklein/unique-entity-validator-with-custom-repository-method (PR #4979)
Commits
-------

4eb54a0 update CHANGELOG
db9ea09 [Doctrine] [Bridge] fix repositoryMethod test
2a6c222 Add a customRepository option to the uniqueEntity validator

Discussion
----------

[Doctrine] [Bridge] Add a "repositoryMethod" option to the uniqueEntity validator

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: ~
Todo: ~
License of the code: MIT
Documentation PR: ~

This allows to configure the repository method used to verify uniqueness of entity.
Before, it was always using `findBy`.

---------------------------------------------------------------------------

by fabpot at 2012-07-20T05:35:28Z

Can you add a note in the CHANGELOG?

---------------------------------------------------------------------------

by docteurklein at 2012-07-20T07:17:08Z

@fabpot done.
2012-07-20 11:35:08 +02:00
Klein Florian
4eb54a042d update CHANGELOG 2012-07-20 09:25:13 +02:00
Fabien Potencier
4bde2aac41 merged 2.0 2012-07-20 07:34:13 +02:00
Fabien Potencier
112a51392a merged branch vicb/response/statuscode (PR #4980)
Commits
-------

ed8823c [HttpFoundation] Allow setting an unknown status code without specifying a text

Discussion
----------

[HttpFoundation] Allow setting an unknown status code without specifying...

... a text

fix #4978
2012-07-20 07:30:32 +02:00
Fabien Potencier
c0fc40013a merged branch eko/2.0 (PR #4983)
Commits
-------

16a980b [Validator] Fix bug order for constraint, property, getter and group-sequence-provider in validation.xml

Discussion
----------

[Validator] Fix bug order for constraint, property, getter and group-seq...

Actually, there is a bug that force developers to write validation.xml file with the following nodes order:

- constraint
- property
- getter

So that's not possible to have the following XML (because I need to write my property(ies) first).

```xml
<?xml version="1.0" encoding="UTF-8" ?>
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping"
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">

    <class name="Application\Eko\MyBundle\Entity\MyEntity">
        <getter property="isBar">
            <constraint name="True">
                <option name="message">My error message</option>
            </constraint>
        </getter>

        <property name="foo">
            <constraint name="NotBlank" />
        </property>
    </class>

</constraint-mapping>
```

The XML below result in the following exception:

```
[ERROR 1871] Element '{http://symfony.com/schema/dic/constraint-mapping}property': This element is not expected. Expected is ( {http://symfony.com/schema/dic/constraint-mapping}getter ). (in /var/www/myproject/src/Application/Eko/MyBundle/Resources/config/validation.xml - line 14, column 0)
```

This is due to the sequence element that needs to respect the order given in the schema file.

The choice element is doing the same thing and permit to have a free order of elements so I have replaced the sequence by a choice element.

For more information: http://www.w3.org/TR/xmlschema-0/#ref17
2012-07-20 07:29:27 +02:00
Jordi Boggiano
4f93d1addd [Console] Use proc_open instead of exec to suppress errors when run on windows and stty is not present 2012-07-20 07:25:32 +02:00
Fabien Potencier
503899e26c merged branch Seldaek/rename (PR #4986)
Commits
-------

c81b2ad [Form] Rename UnmodifiableFormConfig to ImmutableFormConfig
274eb9e [EventDispatcher] Rename UnmodifiableEventDispatcher to ImmutableEventDispatcher

Discussion
----------

Rename unmodifiable to immutable

Maybe it's just me, but it sounded really wrong. The EventDispatcher one was added in 2.1 so no BC break. I don't know about the Form one, but I guess it's just used internally anyway.
2012-07-20 07:16:03 +02:00
Fabien Potencier
b201812927 merged branch Fran6co/fix-security-handlers (PR #4985)
Commits
-------

39157a8 [Security] fixes multiple overlapping definitions of DefaultFailureHandler and DefaultSuccessHandler in AbstractFactory

Discussion
----------

[Security] fixes multiple overlapping definitions of DefaultFailureHandler and DefaultSuccessHandler in AbstractFactory

If more than one listener extends AbstractFactory, you'll have multiple calls to createAuthenticationFailureHandler and createAuthenticationSuccessHandler with the same id.

Implicitly it's going to use the one generated by the last factory generating unexpected behavior.

This is related to commits 915704c071 and c6aa392df7
2012-07-20 07:15:13 +02:00
Jordi Boggiano
c81b2ad3e2 [Form] Rename UnmodifiableFormConfig to ImmutableFormConfig 2012-07-20 01:18:42 +02:00
Jordi Boggiano
274eb9ebaf [EventDispatcher] Rename UnmodifiableEventDispatcher to ImmutableEventDispatcher 2012-07-20 01:18:14 +02:00
Francisco Facioni
39157a852d [Security] fixes multiple overlapping definitions of DefaultFailureHandler and DefaultSuccessHandler in AbstractFactory 2012-07-19 19:25:03 -03:00
Tobias Schultze
d85650d29f [Validator] remove return value in TrueValidator 2012-07-19 23:47:59 +03:00
Vincent Composieux
16a980b937 [Validator] Fix bug order for constraint, property, getter and group-sequence-provider in validation.xml 2012-07-19 20:43:09 +02:00
Victor Berchet
ed8823c168 [HttpFoundation] Allow setting an unknown status code without specifying a text 2012-07-19 17:48:12 +02:00
Klein Florian
db9ea095f0 [Doctrine] [Bridge] fix repositoryMethod test 2012-07-19 16:54:35 +02:00
Fabien Potencier
67bf84d7c5 [Routing] fixed typo 2012-07-19 16:39:03 +02:00
Klein Florian
2a6c222c51 Add a customRepository option to the uniqueEntity validator 2012-07-19 16:24:10 +02:00
Fabien Potencier
382f8a5eb9 merged branch Tobion/patch-2 (PR #4968)
Commits
-------

1986e10 [HttpFoundation] optimize makeDisposition

Discussion
----------

[HttpFoundation] optimize makeDisposition
2012-07-19 11:21:09 +02:00
Fabien Potencier
d5463acb23 merged branch cs278/rhel5-invalid-exitcode (PR #4970)
Commits
-------

310c458 [Process] Fixed a problem on RHEL5 where the exit code was incorrect

Discussion
----------

[Process] Fixed a problem on RHEL5 where the exit code was incorrect

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT

RHEL5 will intermittently result in an exit code of -1 due to `proc_get_status()` being called after the process has completed but outside of `updateStatus()` which saves the exit code.

See composer/composer#876
2012-07-19 10:06:46 +02:00
Chris Smith
310c458936 [Process] Fixed a problem on RHEL5 where the exit code was incorrect
RHEL5 will intermittently result in an exit code of -1 [1] due to
proc_get_status() being called after the process has completed
but outside of updateStatus() which saves the exit code.

[1]: https://github.com/composer/composer/issues/876
2012-07-18 18:33:32 +01:00
Pascal Borreli
3bb975c153 [WebProfilerBundle] Fixed white pixel in toolbar info 2012-07-18 19:29:43 +02:00
Tobias Schultze
1986e1052a [HttpFoundation] optimize makeDisposition 2012-07-18 18:28:33 +03:00
Artem Lopata (bumz)
89975ef9d6 Added more verbose message for exception when form types have wrong getName method 2012-07-18 12:37:22 +03:00