Commit Graph

8509 Commits

Author SHA1 Message Date
Grégoire Pineau c6203bcffa [Console] Added namespace suggest on bad namespace name 2012-02-11 21:01:00 +01:00
Jeremy Mikola e4243a1d32 [DoctrineBridge] Add common data fixtures loader 2012-02-11 14:17:18 -05:00
William DURAND 46d28cd55d [Propel] Fixed the CollectionToArray transformer 2012-02-11 18:52:37 +01:00
Grégoire Pineau 117359a196 [Console] fixed CS according to PR comment 2012-02-11 16:33:06 +01:00
Fabien Potencier cb6fdb1f5e [HttpFoundation] removed Session::close() 2012-02-11 15:53:54 +01:00
Drak c59d880593 Docblocks. 2012-02-11 20:15:36 +05:45
Drak b8df1620ac Correct instanceof condition. 2012-02-11 19:47:15 +05:45
Grégoire Pineau dd0d97e643 [Console] Added suggest on bad command name 2012-02-11 14:09:23 +01:00
Fabien Potencier 8a01dd5cff renamed getFlashes() to getFlashBag() to avoid clashes 2012-02-11 13:18:56 +01:00
Fabien Potencier 282d3ae1d8 updated CHANGELOG for 2.1 2012-02-11 12:54:27 +01:00
Fabien Potencier 0f6c50ac69 [HttpFoundation] added some method for a better BC 2012-02-11 12:43:38 +01:00
Fabien Potencier 146a502a0e [FrameworkBundle] added some service aliases to avoid some BC breaks 2012-02-11 12:36:09 +01:00
Fabien Potencier 93d81a171c [HttpFoundation] removed configuration for session storages in session.xml as we cannot provide a way to configure them (like before this PR anyway) 2012-02-11 12:21:41 +01:00
Fabien Potencier 74ccf7062a reverted 5b7ef11650 (Simplify session
storage class names now we have a separate namespace for sessions)
2012-02-11 12:04:50 +01:00
Fabien Potencier 2ae1f90cbe merged branch chmielot/ticket_3298 (PR #3299)
Commits
-------

dbaddbb [Form] Allow empty choices array for ChoiceType

Discussion
----------

[Form] Allow empty choices array for ChoiceType

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

The documentation about ChoiceType says, that default for 'choices' is array().
This is not allowed because an empty array evaluates to false:

if (!$options['choice_list'] && !$options['choices']) {

Use case: choices are empty and items are added dynamically.

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

by chmielot at 2012-02-07T21:03:03Z

Sorry, I messed up with the tickets. Didn't know a pull request opens a ticket.

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

by bschussek at 2012-02-08T08:23:29Z

This ticket depends on #3290 for being merged.

Apart from this, a test case is missing. Add this to ChoiceTypeTest:

    // https://github.com/symfony/symfony/issues/3298
    public function testInitializeWithEmptyChoices()
    {
        $this->factory->createNamed('choice', 'name', null, array(
            'choices' => array(),
        ));
    }

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

by craue at 2012-02-10T20:32:44Z

@bschussek: Why does it depend on #3290? I have issues with the `!$options['choices']` check even without #3290 applied.

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

by chmielot at 2012-02-10T21:24:28Z

Ok, I updated the branch with the test case and craue's suggestion on explicitly checking valid values.

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

by chmielot at 2012-02-11T09:07:05Z

Should be fine now.

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

by bschussek at 2012-02-11T09:15:10Z

Good. I see that you added a check for \Traversable too - can you add a test for this too? It should be fine to pass an empty \ArrayObject().

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

by craue at 2012-02-11T10:05:36Z

@bschussek: But even if there's passed something different than an array, the c'tor of `SimpleChoiceList` (which is called in line 45) is type hinted with `array` and won't allow passing a `Traversable` anyway, right?

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

by bschussek at 2012-02-11T10:16:36Z

@craue Yes. But in EntityType the choices option is reused and passed to EntityChoiceList, which extends ChoiceList and accepts any array or Traversable.

You're right though that it's not possible to add a test covering this in ChoiceTypeTest, and in EntityTypeTest this is already covered.

@fabpot Ready to merge.
2012-02-11 11:53:58 +01:00
Fabien Potencier 91f4f8aa37 [HttpFoundation] changed default flash bag to auto-expires to keep BC 2012-02-11 11:53:48 +01:00
Fabien Potencier 04942502a5 removed unused use statements 2012-02-11 11:53:03 +01:00
Fabien Potencier 7878a0a11a [HttpFoundation] renamed pop() to all() and getAll() to all() 2012-02-11 11:53:00 +01:00
Thomas Chmielowiec dbaddbb7a8 [Form] Allow empty choices array for ChoiceType 2012-02-11 10:04:40 +01:00
Drak 0d2745f750 [HttpFoundation] Remove constants from FlashBagInterface
As requested by fabpot.
Corrected a few mistakes in the documentation.
2012-02-11 11:24:43 +05:45
Drak dad60efccc [HttpFoundation] Add back get defaults and small clean-up.
Changed read-only method names from get*() to peek*()

Typo
2012-02-11 11:24:39 +05:45
Drak 5b7ef11650 [HttpFoundation] Simplify session storage class names now we have a separate namespace for sessions. 2012-02-11 11:24:35 +05:45
Drak 27530cbb1e [HttpFoundation] Moved session related classes to own sub-namespace. 2012-02-11 11:24:31 +05:45
Drak 468391525a [HttpFoundation] Free bags from session storage and move classes to their own namespaces. 2012-02-11 11:24:26 +05:45
Drak d64939aeee [DoctrineBridge] Refactored driver for changed interface. 2012-02-11 11:24:22 +05:45
Drak f9951a39eb Fixed formatting. 2012-02-11 11:24:18 +05:45
Drak 398acc9e9f [HttpFoundation] Reworked flashes to maintain same behaviour as in Symfony 2.0 2012-02-11 11:24:15 +05:45
Drak f98f9ae8ff [HttpFoundation] Refactor for DRY code.
Rename ArraySessionStorage to make it clear the session is a mock for testing purposes only.
Has BC class for ArraySessionStorage
Added sanity check when starting the session.
Fixed typos and incorrect php extension test method
session_module_name() also sets session.save_handler, so must use extension_loaded() to check if module exist
or not.
Respect autostart settings.
2012-02-11 11:24:11 +05:45
Drak 9dd4dbed6d Documentation, changelogs and coding standards. 2012-02-11 11:24:07 +05:45
Drak 1ed6ee325c [DoctribeBridge][SecurityBundle][WebProfiler] Refactor code for HttpFoundation changes. 2012-02-11 11:21:30 +05:45
Drak 7aaf024b2a [FrameworkBundle] Refactored code for changes to HttpFoundation component.
Native PHP sessions stored to file are done with session.storage.native_file
Functional testing is done with session.storage.mock_file

Default flash message implementation done with FlashBag (session.flash_bag)
Default attribute storage implementation with AttributeBag (session.attribute_bag)

Services added: session.storage.native_file, session.storage.native_memcache, session.storage.native_memcache,
session.storage.native_sqlite, session.storage.memcache, session.storage.memcached, session.storage.null,
session.storage.mock_file, session.flash_bag, session.attribute_bag

Services removed: session.storage.native, session.storage.filesystem
2012-02-11 11:21:26 +05:45
Drak 669bc96c7f [HttpFoundation] Added pure Memcache, Memcached and Null storage drivers. 2012-02-11 11:21:22 +05:45
Drak e185c8d63b [HttpFoundation] Refactored component for session workflow. 2012-02-11 11:21:18 +05:45
Drak 85b5c43c7a [HttpFoundation] Added drivers for PHP native session save handlers, files, sqlite, memcache and memcached. 2012-02-11 11:21:14 +05:45
Drak 57ef984e95 [HttpFoundation] Added unit and functional testing session storage objects. 2012-02-11 11:21:10 +05:45
Drak 3a263dc088 [HttpFoundation] Introduced session storage base class and interfaces.
Session object now implements SessionInterface to make it more portable.

AbstractSessionStorage and SessionSaveHandlerInterface now makes implementation
of session storage drivers simple and easy to write for both custom save handlers
and native php save handlers and respect the PHP session workflow.
2012-02-11 11:21:06 +05:45
Drak c9694237d2 [HttpFoundation] Added FlashBagInterface and concrete implementation.
This commit outsources the flash message processing to it's own interface.

Overall flash messages now can have multiple flash types and each type can
store multiple messages.  For convenience there are now four flash types
by default, INFO, NOTICE, WARNING and ERROR.

There are two concrete implementations: one preserving the old behaviour of
flash messages expiring exactly after one page load, regardless of being
displayed or not; and the other where flash messages persist until explicitly
popped.
2012-02-11 11:21:02 +05:45
Drak 39288bcdaa [HttpFoundation] Added AttributesInterface and AttributesBagInterface and concrete implementations.
This commit outsources session attribute storage to it's own class.
There are two concrete implementations, one with structured namespace storage and the other
without.
2012-02-11 11:20:58 +05:45
William DURAND 1f20fb1b7d [Propel] Removed useless code 2012-02-11 01:15:30 +01:00
kbond 41cc0d6db7 [FrameworkBundle] added support for HInclude 2012-02-10 15:33:37 -05:00
Bernhard Schussek cde34fd8ce [Form] Throwing an AlreadyBoundException in `add`, `remove`, `setParent`, `bind` and `setData` if called on a bound form 2012-02-10 15:40:01 +01:00
Fabien Potencier 92cb685ebc fixed CS 2012-02-10 13:35:11 +01:00
Fabien Potencier 5ca472bd45 merged branch vicb/profiler/routing (PR #3283)
Commits
-------

ac59db7 cleanup
64ea95d [WebProfilerBundle] Add redirection info to the router panel
826bd23 [FrameworkBundle] fix phpDoc of ControllerResolver::createController()
e3cf37f [HttpFoundation] RedirectResponse: add the ability to retrieve the target URL, add unit tests
50c85ae [WebProfiler] Add info to the router panel

Discussion
----------

[WIP][Profiler] Routing

former #3206 part 3 (depends on part 1 - #3280)

The goal of this PR is to fix #3264 by adding redirection infos on the router panel.

Done:

* Add info on the target url / route

To do:

* Display an accurate URL matching process (when using the RedirectableUrlMatcher)
2012-02-10 13:31:26 +01:00
Fabien Potencier 2a16171645 merged branch vicb/profiler/pages (PR #3281)
Commits
-------

0d4d7e0 [WebProfilerBundle] Make the toolbar use the common JS
a440279 [WebProfilerBundle] Adds panel pages
762d90d [Profiler] Buid a common infrastructure

Discussion
----------

[Profiler] Provide a common infrastructure

former #3206 part 3

* base JS (provides ajax, toggle, css class helpers),
* panel pages (used only by the Doctrine panel for now).

Successfuly tested with the (future version of the) Doctrine panel.
2012-02-10 13:25:59 +01:00
Fabien Potencier 75c6ccf3b6 merged branch vicb/misc/cleaning (PR #3280)
Commits
-------

3896fdd [WebProfilerBundle] Some cleanup

Discussion
----------

[WebProfilerBundle] Some cleanup

former #3206 part 1 (misc cleanup)
2012-02-10 13:21:41 +01:00
Fabien Potencier be2e67c1ab merged branch bschussek/issue3288 (PR #3290)
Commits
-------

22c8f80 [Form] Fixed issues mentioned in the PR comments
3b1b570 [Form] Fixed: The "date", "time" and "datetime" types can be initialized with \DateTime objects
88ef52d [Form] Improved FormType::getDefaultOptions() to see default options defined in parent types
b9facfc [Form] Removed undefined variables in exception constructor

Discussion
----------

[Form] Fixed: "date", "time" and "datetime" fields can be initialized with \DateTime objects

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

![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=issue3288)

Fixed exception that was thrown when doing:

    $builder->add('createdAt', 'date', array('data' => new \DateTime()));

On a side note, the options passed to `FieldType::getDefaultOptions` now always also contain the default options of any parent types. This is necessary if you want to be independent of how `getDefaultOptions` is implemented in the parent type and still rely on the already defined values.

As a result, `FieldType::getParent` doesn't see default options anymore. This shouldn't be a big problem, because this method only relies on options in few cases. If it does, options now need to be checked for existence with `isset` before being used (BC break).

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

by bschussek at 2012-02-09T16:14:46Z

@fabpot Ready to merge.

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

by bschussek at 2012-02-10T12:15:04Z

@fabpot Ready to merge
2012-02-10 13:16:49 +01:00
Fabien Potencier 78e6a2f734 merged branch bschussek/issue3293 (PR #3315)
Commits
-------

da2447e [Form] Fixed MergeCollectionListener when used with a custom property path
b56502f0 [Form] Added getParent() to PropertyPath
7e5104e [Form] Fixed MergeCollectionListener for the case that the form's data is updated by the data mapper (as happening in CollectionType)

Discussion
----------

[Form] Fixed MergeCollectionListener for the case that the form's data is updated by the data mapper

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

![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=issue3293)

This fixes CollectionType to properly use adders and removers. Apart from that, adders and removers now work with custom property paths. PropertyPath was extended for a method `getParent`.

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

by bschussek at 2012-02-10T07:42:13Z

@fabpot Ready to merge.
2012-02-10 13:02:02 +01:00
Fabien Potencier c614be74c8 merged branch bschussek/issue2308 (PR #3320)
Commits
-------

0a4519d [Form] Fixed duplicate errors on forms with "error_bubbling"=false

Discussion
----------

[Form] Fixed duplicate errors on forms with "error_bubbling"=false

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

![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=issue2308)
2012-02-10 12:59:38 +01:00
Fabien Potencier feb0dfd55e merged branch bschussek/issue2553 (PR #3319)
Commits
-------

6a45a41 [Form] Fixed Form::bindRequest() when used on a form without children

Discussion
----------

[Form] Fixed Form::bindRequest() when used on a form without children

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

![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=issue2553)
2012-02-10 12:55:15 +01:00
Fabien Potencier 6d793e72bf merged branch bschussek/issue2226 (PR #3321)
Commits
-------

2521962 [Form] Added constant Guess::VERY_HIGH_CONFIDENCE

Discussion
----------

[Form] Added constant Guess::VERY_HIGH_CONFIDENCE

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

![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=issue2226)
2012-02-10 12:52:45 +01:00