Commit Graph

20 Commits

Author SHA1 Message Date
Bernhard Schussek 1e34e91909 [Form] Added upgrade instructions to the UPGRADE file 2013-01-08 14:45:16 +01:00
Bernhard Schussek bcc5552de4 [Form] Protected methods in FormConfigBuilder and FormBuilder from being called when it is turned into a FormConfigInterface instance 2013-01-07 16:58:41 +01:00
Fabien Potencier 79148f3c86 Revert "merged branch ricardclau/rename_choice_to_oneof (PR #6360)"
This reverts commit 1de60c902c, reversing
changes made to e3cc337b00.

Conflicts:
	UPGRADE-2.2.md
2012-12-29 10:43:12 +01:00
Fabien Potencier 3341c8ec43 [FrameworkBundle] restricted to only URIs the first argument of the actions helper 2012-12-20 22:49:33 +01:00
Fabien Potencier b7e4cffae0 tweaked previous merge 2012-12-20 16:01:19 +01:00
Benjamin Grandfond 4d40b115e7 Add notes about kernel.trusted_proxies parameter 2012-12-20 11:05:55 +01:00
Fabien Potencier 64d43c806b restricted to only URIs the first argument of the render tag 2012-12-20 08:31:14 +01:00
Bernhard Schussek fb71964adc [Form] Added an alternative signature Form::add($name, $type, $options) 2012-12-18 11:29:26 +01:00
Ricard Clau 9071676f0b create oneof constraint and add deprecation messages in choice, also make choice extend new oneOf constraint to avoid duplicate code 2012-12-15 10:29:01 +01:00
Tobias Schultze 8c7a169a4a [Routing] clean up of RouteCollection API 2012-12-11 14:02:38 +01:00
Fabien Potencier 344496f9f7 merged branch Tobion/collection-flat (PR #6120)
This PR was merged into the master branch.

Commits
-------

51223c0 added upgrade instructions
50e6259 adjusted tests
98f3ca8 [Routing] removed tree structure from RouteCollection

Discussion
----------

[Routing] removed tree structure from RouteCollection

BC break: yes (see below)
Deprecations: RouteCollection::getParent(); RouteCollection::getRoot()
tests pass: yes

The reason for this is so quite simple. The RouteCollection has been designed as a tree structure, but it cannot at all be used as one. There is no getter for a sub-collection at all. So you cannot access a sub-collection after you added it to the tree with `addCollection(new RouteCollection())`. In contrast to the form component, e.g. `$form->get('child')->get('grandchild')`.
So you can see the RouteCollection cannot be used as a tree and it should not, as the same can be achieved with a flat array!
Using a flat array removes all the need for recursive traversal and makes the code much faster, much lighter, less memory (big problem in CMS with many routes) and less error-prone.

BC break: there is only a BC break if somebody used the PHP API for defining RouteCollection and also added a Route to a collection after it has been added to another collection.
So
```
$rootCollection = new RouteCollection();
$subCollection = new RouteCollection();
$rootCollection->addCollection($subCollection);
$subCollection->add('foo', new Route('/foo'));
```
must be updated to the following (otherwise the 'foo' Route is not imported to the rootCollection)
```
$rootCollection = new RouteCollection();
$subCollection = new RouteCollection();
$subCollection->add('foo', new Route('/foo'));
$rootCollection->addCollection($subCollection);
```

Also one must call addCollection from the bottom to the top. So the correct sequence is the following (and not the reverse)
```
$childCollection->->addCollection($grandchildCollection);
$rootCollection->addCollection($childCollection);
```

Remeber, this is only needed when using PHP for defining routes and calling methods in a special order. There is no change required when using XML or YAML for definitions. Also, I'm pretty sure that neither the CMF, nor Drupal routing, nor Silex is relying on the tree stuff. So they should also still work.

cc @fabpot @crell @dbu

One more thing: RouteCollection wasn't an appropriate name for a tree anyway as a collection of routes (that it now is) is definitely not a tree.
Yet another point: The XML declaration of routes uses the `<import>` element, which is excatly what the new implementation of addCollection without the need of a tree does. So this is now also more analogous.

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

by Koc at 2012-11-26T17:34:15Z

What benefit of this?

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

by Tobion at 2012-11-26T17:56:53Z

@Koc Why did you not simply wait for the description? ^^

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

by dbu at 2012-11-26T18:33:09Z

i love PR that remove more code than they add whithout removing functionality.

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

by Crell at 2012-11-26T18:49:52Z

There's an issue somewhere in Drupal where we're trying to use addCollection() as a shorthand for iterating over one collection and calling add() on the other for each item.  We can't do that, however, because the subcollections are not flattened properly when reading back and our current dumper can't cope with that.  So this change would not harm Drupal at all, and would mean I don't have fix a bug in our dumper. :-)  I cannot speak for any other projects, of course.

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

by Tobion at 2012-11-27T19:06:34Z

Ok, this is ready.
2012-12-05 16:37:03 +01:00
Fabien Potencier 0a380cfdbf [HttpFoundation] disabled Request _method feature by default (should now be explicitely enabled via a call to enableHttpMethodOverride()) 2012-11-28 15:06:57 +01:00
Tobias Schultze 51223c05ff added upgrade instructions 2012-11-27 20:03:51 +01:00
ragtek 1db6f05ead Update UPGRADE-2.2.md
fixed typo
2012-11-26 19:12:13 +01:00
Fabien Potencier fae3e35ef5 fixed typo 2012-11-25 11:49:19 +01:00
Bernhard Schussek 24c653045d [Validator] Added instructions on integrating the latest Validator changes to the UPGRADE file 2012-11-24 13:30:10 +01:00
Eric GELOEN 97f6a1b4d9 [Form] Update password type trimming to false 2012-11-16 14:51:56 +01:00
Florin Patan bdf0334434 Fixed the lap method. Added upgrade notes. Some CS fixes 2012-11-10 22:20:20 +02:00
Jeremy Mikola ded3a8301a [HttpFoundation] Document MongoDbSessionHandler changes 2012-11-06 14:55:32 -05:00
Jean-François Simon 6b601bd9a6 [http-foudation] Better accept header parsing 2012-11-05 12:25:18 +01:00