Commit Graph

8477 Commits

Author SHA1 Message Date
Victor Berchet
3d800afec3 [Form] Remove usages of deprecated features 2012-05-25 12:34:16 +02:00
Bernhard Schussek
ee803cd948 [Form] Renamed setVars() to addVars() in FormViewInterface 2012-05-25 12:34:16 +02:00
Bernhard Schussek
1c4f632f60 [Form] Fixed API docs and usage of FormBuilderInterface instead of FormBuilder 2012-05-25 12:34:16 +02:00
Bernhard Schussek
2e6cdd15c5 [Form] Inverted the logic of "single_control" and renamed it to "compound". The opposite is now "simple". 2012-05-25 12:34:16 +02:00
Bernhard Schussek
98a7c0cf5f [Form] Consolidated FormInterface, FormBuilderInterface and FormViewInterface 2012-05-25 12:34:16 +02:00
Bernhard Schussek
8e128fc644 [Form][OptionsResolver] Fixed typos 2012-05-25 12:34:16 +02:00
Bernhard Schussek
877d8f7195 [Form] Reversed the order of $type and $name in FormFactory::createNamed[Builder]() 2012-05-25 12:34:16 +02:00
Bernhard Schussek
33fecca210 [Form] Merged various form events and added class FormEvent 2012-05-25 12:34:16 +02:00
Bernhard Schussek
bec80157f9 [Form] Renamed client and application format to view and model format 2012-05-25 12:34:16 +02:00
Bernhard Schussek
8cae3282d8 [Form] setDefaultOptions() is now coded against OptionsResolverInterface 2012-05-25 12:34:16 +02:00
Bernhard Schussek
1ecddbc545 [OptionsResolver] Renamed recommended method to setDefaultOptions() 2012-05-25 12:34:15 +02:00
Bernhard Schussek
dc2fa9dc69 [OptionsResolver] Added OptionsResolverInterface 2012-05-25 12:34:15 +02:00
Bernhard Schussek
2cd99e80b6 [Form] Added FormBuilderInterface and FormViewInterface and cleaned up FormTypeInterface and FormTypeExtensionInterface 2012-05-25 12:28:17 +02:00
Bernhard Schussek
0ef4066983 [Form] Options are now passed to buildView() and buildViewBottomUp() 2012-05-25 12:28:17 +02:00
Bernhard Schussek
027259eba4 [Form] Changed getDefaultOptions() to setDefaultOptions(OptionsResolver $resolver) in FormTypeInterface 2012-05-25 12:28:17 +02:00
Bernhard Schussek
b4e8bcfc5a [OptionsResolver] Relaxed tests to check that allowed values can also be passed as scalars 2012-05-25 12:28:17 +02:00
Bernhard Schussek
97de0041a1 [OptionsResolver] Added option type validation capabilities 2012-05-25 12:28:17 +02:00
Bernhard Schussek
0af5f06703 [OptionsResolver] Added method setFilters() for augmenting the final option values 2012-05-25 12:28:17 +02:00
Fabien Potencier
45849ce306 merged branch Tobion/optionsresolver-optim (PR #4388)
Commits
-------

bad4a1f [OptionsResolver] CS fix in LazyOption
a54ea1b [OptionsResolver] small optimization in Options class
104dcf2 [OptionsResolver] fixed bugs concerning required options
1bfcff4 [OptionsResolver] added failing test cases to demonstrate two bugs
37a3a29 [OptionsResolver] optimized validation

Discussion
----------

[OptionsResolver] fixed two bugs and applied optimization

The first commit optimizes the validation in OptionsResolver by removing several unneeded method calls (without changing anything semantically).

Then I recognized two bugs in the current code that I wrote failing test cases for in the second commit.
1. setAllowedValues wrongly validated missing options
2. required options with defaults were considered missing by `resolve` (contrary to the `isRequired` method)

The third commit fixes these bugs.

The forth commit applies a small optimization in Options and uses a static function call for a static function.

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

by travisbot at 2012-05-24T03:39:34Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1418785) (merged a54ea1b6 into b07fb3c4).

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

by travisbot at 2012-05-24T05:22:33Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1419232) (merged bad4a1f7 into b07fb3c4).

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

by bschussek at 2012-05-24T06:20:02Z

I just tested this on my machine, and static calls are a tiny bit faster here, although this is really irrelevant for practical use. Even though I dislike useless micro-optimizations like this, I'm ok with this PR in general.

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

by Tobion at 2012-05-24T13:23:11Z

I didn't say that's an optimization in the first place. (The optimization was the removal of a variable assignment)
I just changed it because in other PRs I've been told, static functions should be called in a static way.

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

by Tobion at 2012-05-24T23:36:13Z

Please merge before 4387
2012-05-25 09:54:05 +02:00
jaugustin
35b458f6b8 fix kernel root, linux dir separator on windows, to fix cache:clear issue 2012-05-25 09:39:01 +02:00
Jakub Zalas
8da880c394 Fixed notice in AddCacheWarmerPass if there is no cache warmer defined. 2012-05-24 23:58:50 +01:00
Jakub Zalas
8c6c86c9c9 Added unit tests for AddCacheWarmerPass class. 2012-05-24 23:42:04 +01:00
Jordi Boggiano
bcf8cf9116 [Process] Refactor the windows handling so it is always executed
When regular pipes are closed, the file handlers fallback on windows
should still be processed until they are empty
2012-05-24 19:53:48 +02:00
Jordi Boggiano
0c5aa8bf7e [Process] Add failing test for callbacks on windows 2012-05-24 19:52:29 +02:00
Fabien Potencier
7f93bf1f5b [TwigBundle] fixed a PHP warning (closes #4397) 2012-05-24 16:44:41 +02:00
Christian Raue
d11af63672 avoid showing the web profiler toolbar loading error if status is 0 2012-05-24 16:06:17 +02:00
Tobias Schultze
bad4a1f76c [OptionsResolver] CS fix in LazyOption 2012-05-24 07:20:57 +02:00
Tobias Schultze
a54ea1b6b2 [OptionsResolver] small optimization in Options class 2012-05-24 05:32:58 +02:00
Tobias Schultze
104dcf251d [OptionsResolver] fixed bugs concerning required options 2012-05-24 05:31:42 +02:00
Tobias Schultze
1bfcff4fab [OptionsResolver] added failing test cases to demonstrate two bugs 2012-05-24 05:29:35 +02:00
Tobias Schultze
37a3a29c59 [OptionsResolver] optimized validation 2012-05-24 02:48:57 +02:00
Fabien Potencier
95ca5fe11e fixed typo 2012-05-23 17:39:12 +02:00
Bernhard Schussek
bad6d040d7 [Form] Added accessor FormConfigInterface::getByReference() and let Form clone objects if not by reference 2012-05-23 14:51:26 +02:00
Bernhard Schussek
fc2370104f [Form] Correctly highlighted BC breaks in the CHANGELOG 2012-05-23 14:46:49 +02:00
Bernhard Schussek
d1864c7d63 [Form] Fixed: Virtual forms are ignored when prepopulating a form 2012-05-23 14:46:45 +02:00
Christophe Coevoet
7a85b4340b [TwigBundle] Fixed the path to templates when using composer
When installing the bundle and the bridge from the standalone repositories
the relative path between them is different. This simply backports the
change done in symfony 2.1 to allow using subtree repositories with 2.0.x
too.
2012-05-22 22:57:32 +02:00
Fabien Potencier
836443d6f6 merged branch stof/composer_missing_dep (PR #4379)
Commits
-------

40fd99e [FrameworkBundle] Added another missing dependency to Config

Discussion
----------

Yet another composer missing dep

Config is only suggested by DI, not required. So it not installed currently.
2012-05-22 22:44:11 +02:00
Christophe Coevoet
40fd99e949 [FrameworkBundle] Added another missing dependency to Config 2012-05-22 23:40:54 +03:00
Fabien Potencier
e51da8e13a merged branch hhamon/template_loader_phpdoc (PR #4377)
Commits
-------

03183b5 [Templating] added missing @return PHPDoc for LoaderInterface::isFresh method.

Discussion
----------

Template loader phpdoc

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

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

by travisbot at 2012-05-22T17:39:15Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1402200) (merged 03183b5b into 55faa546).
2012-05-22 22:39:54 +02:00
Christophe Coevoet
47a6a29855 [FrameworkBundle] Added a missing dependency to DI
The bundle class extends ContainerAware so the DI component is a required
dependency of the bundle.
2012-05-22 22:22:14 +02:00
Hugo Hamon
03183b5b69 [Templating] added missing @return PHPDoc for LoaderInterface::isFresh method. 2012-05-22 19:20:01 +02:00
Fabien Potencier
e0238071d4 merged branch bschussek/dataclassfix (PR #4374)
Commits
-------

82c221a [Form] Fixed strict "data_class" check to work with instances of \ArrayAccess

Discussion
----------

[Form] Fixed collection type to work with recent Form changes

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

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

by tristanbes at 2012-05-22T16:42:36Z

Ping @fabpot Could you please merge it ASAP, because this bugs breaks all forms containing collection type.

Thanks

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

by travisbot at 2012-05-22T16:54:24Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1401580) (merged 82c221a1 into 1a1403f5).
2012-05-22 19:03:35 +02:00
Bernhard Schussek
82c221a1dd [Form] Fixed strict "data_class" check to work with instances of \ArrayAccess 2012-05-22 18:24:59 +02:00
Fabien Potencier
1a1403f599 merged branch asm89/numeric-keys-config (PR #4276)
Commits
-------

b7fc009 [Config] Numerical keys for prot. arrays if useAttributeAsKey is set

Discussion
----------

[Config] Numerical keys for prot. arrays if useAttributeAsKey is set

Bug fix: not sure
Feature addition: not sure
Backwards compatibility break: not sure
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/asm89/symfony.png?branch=numeric-keys-config)](http://travis-ci.org/asm89/symfony)
License of the code: MIT

When using an array node with children of prototype array and `useAttributeAsKey`, using numerical values for the keys throws an exception. For example (`useAttributeAsKey('id')`):

``` php
<?php
// works
array (
    'thing' => array(
        array('foo', 'bar', 'id' => 'a')
    )
);

// works and is the same as above
array (
    'thing' => array(
        'a' => array('foo', 'bar')
    )
);

// works
array(
    'thing' => array(
        array('foo', 'bar', 'id' => 42), array('baz', 'qux', 'id' => 1337),
    ),
);

// works with this patch and is the same as above
array(
    'thing' => array(
        42 => array('foo', 'bar'), 1337 => array('baz', 'qux'),
    ),
);
```

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

by travisbot at 2012-05-14T14:26:32Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1327383) (merged 42d252da into 46ffbd52).

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

by travisbot at 2012-05-14T14:32:59Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1327430) (merged b7fc0093 into 46ffbd52).

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

by vicb at 2012-05-21T15:16:24Z

Could this be fixed by changing [PrototypedArrayNode](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Config/Definition/PrototypedArrayNode.php#L255)
`$k = $v[$this->keyAttribute];` -> `$k = (string) $v[$this->keyAttribute];`

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

by asm89 at 2012-05-22T07:01:53Z

I tried it and the test I added still fails. The code change you propose doesn't execute because `if (!isset($v[$this->keyAttribute]) && is_int($k))` will still evaluate to true.
2012-05-22 18:02:05 +02:00
Fabien Potencier
ad6779bc2f merged branch grEvenX/authorization_example_fix (PR #4370)
Commits
-------

0935964 Modified example for mod_rewrite to not add Authorization header if it is not set in the request

Discussion
----------

Correct example mod_rewrite to not add Authorization header that does not exists

The in-line PHP code comment suggest to do some changes in .htaccess with mod_rewrite to pass HTTP-Authorization header to PHP. This leads to the Authorization header being introduced even when it's not originally in the request (albit empty, the result of ParameterBag->has('Authorization') will return true when you expect it not to.
Some external libraries might check for this header and perform logic based on wether it was set or not (The php-oauth2 library in my case).

I suggest this fix which I think is a more proper way of handling the case anyway, since when the header is not set you don't expect it to exist in the ServerBag either.

(I tried to search the documentation for this but did not find it, but I guess this probably should go into the documentation somewhere?)

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

by travisbot at 2012-05-22T12:51:25Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1399753) (merged 0935964b into 517ae43f).
2012-05-22 15:10:48 +02:00
Fabien Potencier
3b58564ed0 merged branch kevindew/form_view_errors (PR #4224)
Commits
-------

e92212a [Form] Added valid attribute to a FormView

Discussion
----------

[Form] Added "valid" to view parameters

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 PR adds a parameter of contains_errors to a FormView when buildView is called.

The use case for this addition is when you want to show that a form or sub forms has errors (e.g. when rendering a long form a header message of "This form contains errors" or adding a class to a whole sub form to show an erroneous state) is currently very difficult/near impossible and may need the original form object being accessible in the view layer.

Whats a bit grey here is the best phrasing to use for this. Options I weighed up were is_valid (seemed a bit semantically incorrect in a template, since it would return true pre bind) and has_errors_deep (which i wasn't sure if it fitted naming conventions).

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

by travisbot at 2012-05-07T20:25:55Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1269345) (merged fe1f5aee into 919604ab).

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

by henrikbjorn at 2012-05-19T18:36:33Z

couldnt you just use `{% if errors %}` in your views?

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

by stof at 2012-05-19T19:17:20Z

@henrikbjorn ``errors`` contains only the errors attached to the form itself. It will not tell you when there is some errors in a child form.

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

by kevindew at 2012-05-22T10:43:45Z

Sure, done

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

by travisbot at 2012-05-22T10:45:12Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1399006) (merged 9f6658d4 into 517ae43f).

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

by kevindew at 2012-05-22T10:57:54Z

Shoot, sorry about that.

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

by travisbot at 2012-05-22T11:00:00Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1399096) (merged 88920591 into 517ae43f).

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

by bschussek at 2012-05-22T11:17:38Z

Can you squash the commits and prefix the message with "[Form]" please?

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

by travisbot at 2012-05-22T11:49:52Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1399390) (merged ca771822 into 517ae43f).

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

by kevindew at 2012-05-22T11:53:18Z

Sure, done (I've sorted the travis fail btw)

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

by travisbot at 2012-05-22T11:55:10Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1399404) (merged e92212ac into 517ae43f).

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

by bschussek at 2012-05-22T12:25:45Z

@fabpot 👍
2012-05-22 15:08:07 +02:00
Even André Fiskvik
0935964b29 Modified example for mod_rewrite to not add Authorization header if it is not set in the request 2012-05-22 14:38:37 +02:00
Kevin Dew
e92212ac13 [Form] Added valid attribute to a FormView 2012-05-22 12:51:19 +01:00
Fabien Potencier
517ae43fe9 [Console] added an exception when an option name or shortcut is invalid (refs #4346) 2012-05-22 12:35:53 +02:00
Fabien Potencier
c1e868f994 merged branch Nanocom/master (PR #4346)
Commits
-------

2c19b3c Empty shortcut check in the constructor
cf9039e Added a unit test for the shortcut name of the InputOption class

Discussion
----------

[Console] Single dash for option shortcuts

See https://github.com/symfony/symfony/pull/4062

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

by travisbot at 2012-05-20T13:09:18Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1380389) (merged 02290da4 into f433f6b0).

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

by stof at 2012-05-20T13:16:34Z

please rebase your branch to get rid of these merge commits
btw, you should use feature branches to send your next pull requests instead of using your master branch each time, which limits you to a single PR.

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

by Nanocom at 2012-05-20T13:39:32Z

Sorry for the mess, cleaning it

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

by travisbot at 2012-05-20T13:41:46Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1380549) (merged 63129657 into f433f6b0).

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

by travisbot at 2012-05-20T13:43:07Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1380553) (merged 2c19b3c7 into f433f6b0).
2012-05-22 12:30:31 +02:00
Fabien Potencier
a6b3902128 added the possibility to translate the placeholder and title attributes in the PHP form templates (refs #4194) 2012-05-22 12:23:06 +02:00
Fabien Potencier
5ca64b42fa merged branch andrefgneves/translate-widget-attributes (PR #4194)
Commits
-------

23bad29 Added translation to placeholder and title attributes

Discussion
----------

Added translation to placeholder and title attributes

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

by schmittjoh at 2012-05-03T13:52:38Z

Better translate it where it is defined.

Dynamic translations are usually not desirable as they cannot be automatically extracted, and thus require more work.

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

by ruimarinho at 2012-05-03T13:57:30Z

@schmittjoh but isn't that the same case as with labels for instance? I don't think injecting the translator service into the form type would require less work than what this PR suggests.

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

by schmittjoh at 2012-05-03T14:02:02Z

Yeah, same thing.

There might be some cases where it's fine, but in general, we should try to not translate dynamic vars.

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

by ruimarinho at 2012-05-03T14:17:44Z

@schmittjoh I think that's one of those cases, since these attributes in particular (title and placeholder) are intended to aid the user with a brief description. I understand (and agree) with your concern regarding dynamic vars, but in my opinion this is a use case where it is worth it. Just my two cents :)

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

by stof at 2012-05-03T18:07:01Z

@schmittjoh the issue is that translating the label before the template would require injecting the translator in the form types (as the form label can be set there) and would force the user to duplicate the translation process if they pass the label explicitly in the template.
2012-05-22 12:16:26 +02:00
Fabien Potencier
fc34ed1f86 merged branch craue/patch-20 (PR #4230)
Commits
-------

64101ab separate numeric value from suffix in File constraint's error message `$uploadIniSizeErrorMessage`
ff122d3 fixed tests
868d649 separate numeric values from suffixes in File constraint's error message `$maxSizeMessage`

Discussion
----------

[Validator] separate numeric values from suffixes in File validation error messages

This change allows me to locale-aware format the numbers in a form theme, i.e., to use a comma instead of a dot. If there's a better way without re-implementing the entire validator, let me know.

Such changes also allow for using a different separator than the usual space in translations.

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

by travisbot at 2012-05-08T19:14:16Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1278845) (merged f7c50098 into e54f4e46).

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

by travisbot at 2012-05-08T19:23:31Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1278940) (merged ce1cdafc into e54f4e46).

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

by r1pp3rj4ck at 2012-05-10T11:05:18Z

I don't know if there is a better way to do this, but I like the idea anyway.

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

by craue at 2012-05-11T14:18:52Z

Separated numeric values and suffixes for `$maxSizeMessage` and `$uploadIniSizeErrorMessage` now. Can't find any other relevant places (in other validators). Might be merged if accepted.

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

by travisbot at 2012-05-11T14:19:10Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1305246) (merged 438da7dd into e54f4e46).

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

by travisbot at 2012-05-11T21:22:25Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1309277) (merged 64101aba into dd0da03c).

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

by sstok at 2012-05-13T13:29:07Z

Using the NumberFormatter class would be an option, but that would also add a dependency when using Validation as stand-alone so using the {{ suffix }} is a good idea.

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

by craue at 2012-05-13T14:15:54Z

Using a NumberFormatter (if available) directly in the validator might indeed be a good option. In either case, having the numeric value separated from its suffix looks cleaner.

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

by craue at 2012-05-19T13:36:00Z

@fabpot: Would you merge this?
2012-05-22 12:14:01 +02:00
Fabien Potencier
f7cf76d1e8 merged branch pkraeutli/browserkit_use_cleanup (PR #4324)
Commits
-------

fe7b258 Removed unnecessary use statements

Discussion
----------

[BrowserKit] Removed unnecessary use statements

Merely a cosmetical fix. My IDE (PhpStorm) marks the `use Symfony\Component\BrowserKit\Client;` statement in  `Symfony/Component/BrowserKit/Client.php` itself as an error.
I also removed the two other `use`s of classes from the same namespace.

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

by travisbot at 2012-05-18T11:27:02Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1365455) (merged fe7b2583 into 1e15f210).
2012-05-22 12:09:36 +02:00
Fabien Potencier
976d32ecbf merged branch yethee/ru_plural_trans (PR #4291)
Commits
-------

2f05b40 [FrameworkBundle] Added Russian translations for CollectionSize constraint
d10f33f [FrameworkBundle] Added Russian plural messages

Discussion
----------

[FrameworkBundle] Added Russian plural messages

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

by travisbot at 2012-05-15T09:10:46Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1334630) (merged d10f33f2 into bd07b891).

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

by travisbot at 2012-05-16T13:06:49Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1345310) (merged 2f05b40f into 5314836d).
2012-05-22 12:05:48 +02:00
Fabien Potencier
5ac20ed80b [HttpKernel] renamed a method 2012-05-22 12:04:55 +02:00
Fabien Potencier
148372be9e merged branch simon-n/master (PR #4321)
Commits
-------

46be121 added tokenDataExists() method to prevent loading complete profile structures upon writes

Discussion
----------

[HttpKernel] prevent loading complete profile structures upon writes

The abstract class "PdoProfilerStorage" uses its ::read() method to decide if a profiler record has to be updated or initially created upon a ::write() call. This possibly causes huge memory consumption, as ::read() recursively reads all existing profiles using ::createProfileFromData() calls. When handling many sub-request this may lead into either a "out of memory" or XDebug's "maximum nesting level reached" - whichever comes first.
To prevent this issue, I added a new protected method ::tokenDataExists() that simply checks whether a record for the token in question already exists in storage.

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

by travisbot at 2012-05-18T08:56:56Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1364303) (merged 46be1212 into 1e15f210).
2012-05-22 12:03:11 +02:00
Fabien Potencier
953547c089 merged branch Tobion/router-parameter (PR #4369)
Commits
-------

bc7043f [Routing] removed unused constructor arguments in test classes
d81fdfe [Routing] fixed namespace of test classes
53aaf76 [Routing] removed unused property of Router

Discussion
----------

[Routing] removed unused property of Router

Test pass: yes
BC break: no

This PR removes an unused property ($defaults) of Router. The property was passed to the constructor of UrlMatcher and UrlGenerator although these classes don't accept this parameter at all. And the dumped equivalents of them (produced by PhpMatcherDumper/PhpGeneratorDumper) don't need this property either.
So passing the $defaults was wrong and the property is not used in any way.
The DI config does not define anything for this property either: [routing.xml](https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml#L52)

The second commit fixes the namespaces of test classes that were wrong.

The third commit removes false arguments in the test classes.

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

by travisbot at 2012-05-22T07:34:03Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1397749) (merged bc7043f1 into e4e3ce6c).
2012-05-22 12:01:44 +02:00
Fabien Potencier
55faa5468b merged branch TonyMalz/VALIDATORT_TYPEGUESS_FIX (PR #4251)
Commits
-------

f883953 TypeGuess fixed for Date/Time constraints
41bed29 [Form] fixed invalid 'type' option in ValidatorTypeGuesser for Date/TimeFields

Discussion
----------

[Form] fixed invalid 'type' option in ValidatorTypeGuesser for Date/TimeFields

Automatic field type guessing breaks, if you use any of the Date/Time
constraints (i.e. Symfony\Component\Validator\Constraints\DateTime), since these field types have no 'type' option defined.
(See getDefaultOptions() in DateTimeType.php)

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

by travisbot at 2012-05-10T15:25:16Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1296309) (merged 005bdbb0 into 68eca0f9).

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

by travisbot at 2012-05-18T15:50:39Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1367774) (merged f8839532 into a04acc89).

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

by TonyMalz at 2012-05-18T15:58:57Z

@bschussek Ok, changed it to 'input'

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

by bschussek at 2012-05-22T08:18:27Z

👍
2012-05-22 12:00:14 +02:00
Fabien Potencier
3ab88f23b9 merged branch aripringle/master (PR #4333)
Commits
-------

4fa8e68 Add support for javascript object notation in allowed JSONP callback

Discussion
----------

Add support for javascript object notation in allowed JSONP callback

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

by travisbot at 2012-05-18T23:09:45Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1371497) (merged 4fa8e68c into 18132c18).
2012-05-22 11:56:42 +02:00
Bernhard Schussek
af41a1a550 [Form] Fixed typos 2012-05-22 09:30:22 +02:00
Bernhard Schussek
ac6939441f [Form] Allowed native framework errors to be mapped as well 2012-05-22 09:30:21 +02:00
Bernhard Schussek
59d6b55137 [Form] Fixed: error mapping aborts if reaching an unsynchronized form 2012-05-22 09:30:21 +02:00
Bernhard Schussek
9eda5f5872 [Form] Fixed: RepeatedType now maps all errors to the first field 2012-05-22 09:30:21 +02:00
Bernhard Schussek
215b687b7b [Form] Added capability to process "." rules in "error_mapping" 2012-05-22 09:30:21 +02:00
Bernhard Schussek
c9c4900663 [Form] Fixed: errors are not mapped to unsynchronized forms anymore 2012-05-22 09:30:21 +02:00
Bernhard Schussek
c8b61d576b [Form] Renamed FormMapping to MappingRule and moved some logic there to make rules more extendable 2012-05-22 09:30:21 +02:00
Bernhard Schussek
d0d1fe6182 [Form] Added more information to UPGRADE and CHANGELOG 2012-05-22 09:30:21 +02:00
Bernhard Schussek
0c09a0e07e [Form] Made $name parameters optional in PropertyPathBuilder:replaceBy(Index|Property) 2012-05-22 09:30:21 +02:00
Bernhard Schussek
081c6437e4 [Form] Updated UPGRADE and CHANGELOG 2012-05-22 09:30:21 +02:00
Bernhard Schussek
bbffd1b00b [Form] Fixed index checks in PropertyPath classes 2012-05-22 09:30:21 +02:00
Bernhard Schussek
ea5ff77121 [Form] Fixed issues mentioned in the PR comments 2012-05-22 09:30:21 +02:00
Bernhard Schussek
7a4ba521c4 [EventDispatcher] Added class UnmodifiableEventDispatcher 2012-05-22 09:29:53 +02:00
Bernhard Schussek
306324ea0a [Form] Greatly improved the error mapping done in DelegatingValidationListener 2012-05-22 09:29:53 +02:00
Bernhard Schussek
8f7e2f602c [Validator] Fixed: @Valid does not recurse the traversal of collections anymore by default 2012-05-22 09:29:53 +02:00
Bernhard Schussek
5e87dd885c [Form] Added tests for the case when "property_path" is null or false. Instead of setting "property_path" to false, you should set "mapped" to false instead. 2012-05-22 09:29:53 +02:00
Bernhard Schussek
2301b1559e [Form] Tightened PropertyPath validation to reject any empty value (such as false) 2012-05-22 09:29:53 +02:00
Bernhard Schussek
7ff2a9b210 Revert "[Form] removed a constraint in PropertyPath as the path can definitely be an empty string for errors attached on the main form (when using a constraint defined with the 'validation_constraint' option)"
This reverts commit 5182a0c2c4.

PropertyPath instances should be empty. If you have an empty property path string, there is no need to create a PropertyPath instance for it.

Conflicts:

	tests/Symfony/Tests/Component/Form/PropertyPathTest.php
2012-05-22 09:29:53 +02:00
Bernhard Schussek
860dd1f7d8 [Form] Adapted Form to create a deterministic property path by default 2012-05-22 09:29:53 +02:00
Bernhard Schussek
03f50588c2 [Form] Fixed property name in PropertyPathMapperTest 2012-05-22 09:28:16 +02:00
Bernhard Schussek
c2a243f926 [Form] Made PropertyPath deterministic: "[prop]" always refers to indices (array or ArrayAccess), "prop" always refers to properties 2012-05-22 09:28:16 +02:00
Bernhard Schussek
29963400e8 [Form] Extracted FormConfig class to simplify the Form's constructor 2012-05-22 09:28:15 +02:00
Tobias Schultze
bc7043f106 [Routing] removed unused constructor arguments in test classes 2012-05-22 09:27:55 +02:00
Tobias Schultze
d81fdfe823 [Routing] fixed namespace of test classes 2012-05-22 09:27:49 +02:00
Tobias Schultze
53aaf76ad0 [Routing] removed unused property of Router 2012-05-22 09:27:43 +02:00
Fabien Potencier
e4e3ce6cc2 merged branch Tobion/form-phpdoc (PR #4353)
Commits
-------

5d1b366 [Form] fix PhpDoc

Discussion
----------

[Form] fix PhpDoc

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

by travisbot at 2012-05-21T02:31:56Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1385372) (merged 5d1b3669 into 1407f112).

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

by vicb at 2012-05-21T05:44:03Z

have you used inheritdoc (over inheritDoc) on purpose ? (I must admin I haven't followed the CS discussion very closely)

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

by Tobion at 2012-05-21T16:16:48Z

Yes, inheritdoc is used on symfony. It's also the recommended way of phpdoc itself (all lower-case).
2012-05-22 06:54:15 +02:00
Fabien Potencier
335d4eab86 fixed CS 2012-05-21 22:27:15 +02:00
Fabien Potencier
c01fed0c89 fixed CS 2012-05-21 22:25:19 +02:00
Fabien Potencier
b206519671 merged branch vicb/uploadedfile2.0 (PR #4358)
Commits
-------

8223632 [HttpFoundation] Fix the UploadedFilename name sanitization (fix #2577)

Discussion
----------

[HttpFoundation] Fix the UploadedFilename name sanitization (fix #2577)

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/vicb/symfony.png?branch=uploadedfile2.0)](http://travis-ci.org/vicb/symfony)
Fixes the following tickets: #2577

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

by travisbot at 2012-05-21T14:00:22Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1389203) (merged 82236324 into 87bb3661).
2012-05-21 16:09:03 +02:00
Fabien Potencier
ea33d4d377 fixed CS 2012-05-21 16:06:09 +02:00
Fabien Potencier
aa3e1a3b8c merged 2.0 2012-05-21 16:05:28 +02:00
Fabien Potencier
bdf9b7eb3e fixed CS 2012-05-21 16:05:09 +02:00
Victor Berchet
82236324b5 [HttpFoundation] Fix the UploadedFilename name sanitization (fix #2577) 2012-05-21 15:52:36 +02:00
Fabien Potencier
bde26b10e7 merged branch davidwindell/issue_4338 (PR #4357)
Commits
-------

0a3dd0f [Console] Check for existence of proc_open to fix #4338

Discussion
----------

[Console] Check for existence of proc_open to fix #4338

It is quite common to disable proc_open for security purposes.

This PR checks for the existence of the proc_open function and fixes Issue #4338

Replacement for PR4356

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

by travisbot at 2012-05-21T10:49:59Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1387784) (merged dd991bea into 1407f112).

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

by travisbot at 2012-05-21T11:35:21Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1387991) (merged 0a3dd0fe into 1407f112).

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

by fabpot at 2012-05-21T12:17:32Z

I forgot to ask you to sent a new PR for the 2.0 branch instead of master. Thanks.

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

by davidwindell at 2012-05-21T13:03:36Z

proc_open is not used in 2.0?
2012-05-21 15:13:34 +02:00
David Windell
0a3dd0fe1e [Console] Check for existence of proc_open to fix #4338
cs fix
2012-05-21 12:31:25 +01:00
Fabien Potencier
87bb3661fc merged branch kepten/ticket_1813 (PR #3551)
Commits
-------

a450d00 [HttpFoundation] HTTP Basic authentication is broken with PHP as cgi/fastCGI under Apache

Discussion
----------

[HttpFoundation] HTTP Basic authentication is broken with php-cgi under Apache

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

In order to work, add this to the .htaccess:

RewriteEngine on
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ app.php [QSA,L]

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

by stof at 2012-03-10T17:34:26Z

you should also add a unit test for this

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

by kepten at 2012-03-11T15:34:04Z

Thanks for the feedback, I committed the changes.

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

by stof at 2012-04-04T01:59:53Z

@fabpot could you review it ?

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

by fabpot at 2012-04-04T07:15:34Z

My comments:

 * `ServerBag` represents what we have in the `$_SERVER` global variables. As such, the code should be moved to the `getHeaders()` method instead like the other tweaks we do for the HTTP headers.

 * A comment must be added explaining why this is needed and the configuration the user must have to make it work (then remove the Github URLs).

 * The code should only be executed when `PHP_AUTH_USER` is not available (to not have any overhead when not needed).

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

by danielholmes at 2012-04-14T13:27:09Z

A quick note on that .htaccess/apache configuration required, if adding to the Symfony SE htaccess file, then it will need to look like this:

```
<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ app.php [QSA,L]
</IfModule>
```

NOTE: No **,L** in the Authorization Rewrite as in the original example - it prevents the front controller rewrite from happening

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

by towards at 2012-04-20T16:12:49Z

@kepten you were faster than me applying @fabpot's comments :) nevertheless part of the bug hunt day I also modified the ServerBag class and tested them on a productive LAMP hosting server using Apache and FastCGI

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

by kepten at 2012-04-20T16:15:57Z

ok, so is my PR is useless or should I still fix problems?

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

by towards at 2012-04-20T16:20:26Z

your PR is fine for sure and I don't want to interfere, just wanted to mention that part of the bug hunt day of Symfony I had a go at this PR as an "exercise" but just saw later on that you already fixed the problem, so you can ignore my pushes

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

by vicb at 2012-04-20T16:20:36Z

I have been working with @towards: your PR is useful, please implement his comments and squash your PR.

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

by kepten at 2012-04-20T16:59:07Z

never squashed before, is it okay now? :)

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

by stof at 2012-04-20T17:21:07Z

it is

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

by vicb at 2012-05-20T19:57:51Z

@fabpot this should be ready to be merged
2012-05-21 11:09:36 +02:00
Tobias Schultze
5d1b3669c5 [Form] fix PhpDoc 2012-05-21 04:26:59 +02:00
Christophe Coevoet
cdfb0b19d2 Changed composer constraint to allow Doctrine 2.3 too 2012-05-20 22:28:43 +02:00
Fabien Potencier
1407f112fc fixed CS 2012-05-20 18:17:03 +02:00
Fabien Potencier
9b7aab5e94 merged 2.0 2012-05-20 18:16:37 +02:00