Commit Graph

6643 Commits

Author SHA1 Message Date
H. Westphal
932c144534 Added a class to the logs ol element to prevent hiding it when toggling an exception (fixes #2589). 2011-11-10 10:20:28 +01:00
stealth35
56cb7a515b [Translation] add gettext PO and MO Dumper 2011-11-10 00:24:31 +01:00
Fabien Potencier
2d53751e13 merged branch thomasbibb/master (PR #2559)
Commits
-------

269a5e6 Added the ablity to get a requests ContentType

Discussion
----------

Added getContentType

I've added the ability for Symfony\Component\HttpFoundation\Request to return the ContentType from serverBag this uses the $formats array to determine if the requested ContentType is valid.

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

by ericclemmons at 2011/11/03 20:00:51 -0700

Have you considered squashing a couple of your commits?  They seem doubled up.

Trivial, I know, but it will make each commit stand on its own (instead of appearing as a typo correction)

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

by thomasbibb at 2011/11/04 02:02:36 -0700

done.

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

by ericclemmons at 2011/11/04 07:25:20 -0700

You may need to do a `git push -f origin master`.  Check the commits tab to see the duplicate history:

> https://github.com/symfony/symfony/pull/2559/commits

Wheeeee, rebasing is fun!

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

by thomasbibb at 2011/11/04 12:26:06 -0700

There we got thats better :)

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

by ericclemmons at 2011/11/04 12:55:07 -0700

👍  Now let's see if it gets approved by @fabpot :)

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

by thomasbibb at 2011/11/06 03:39:12 -0800

I've removed the space between the method name and the parenthesis.

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

by thomasbibb at 2011/11/06 04:05:15 -0800

done.

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

by fabpot at 2011/11/06 23:44:22 -0800

Can you added some unit tests?
2011-11-09 22:08:42 +01:00
Fabien Potencier
8ca8aef151 merged branch stof/gettext_loader (PR #2412)
Commits
-------

d974a4a Merge pull request #4 from stealth35/test_mo_loader
cf05646 delete useless tests
19f9de9 [Translation] fix gettext tests
965f2bf Merge pull request #3 from stealth35/test_mo_loader
9c2a26d [Translation] add Mo loader tests
9af2342 [Translation] Added the gettext loaders

Discussion
----------

[Translation] Added the gettext loaders

This is the squashed version of the work done by @xaav in #634.

@stealth35 you said you will work on the dumpers. do you have some stuff on it ?

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

by drak at 2011/10/24 19:28:43 -0700

Is there any more progress with this?

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

by stealth35 at 2011/10/25 00:57:19 -0700

I work on the dumpers, but the Po loader is wrong, caus' the Po ressource can be multiline,

     msgid ""
     "Here is an example of how one might continue a very long string\n"
     "for the common case the string represents multi-line output.\n"

http://www.gnu.org/software/gettext/manual/gettext.html#PO-Files

Anyway the Po format is an intermediate format to Mo file, (like .txt to .res file for ICU), IMO we can just support the real gettext format : Mo

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

by stealth35 at 2011/11/03 02:00:24 -0700

@stof The MO Dumper is ready (stealth35/symfony@f2d1d5b4de), should we keep the PO format ?

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

by fabpot at 2011/11/07 08:50:59 -0800

@stealth35: The PO is what people will use for their translations. They will then dump it to MO. So, we need both PO and MO loaders and dumpers.

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

by stealth35 at 2011/11/08 01:25:39 -0800

@fabpot, I'm ready for both dumpers, you can merge this, and I'll open a PR for the dumpers

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

by fabpot at 2011/11/08 22:37:47 -0800

I've just had a look at this PR code again and I see that the unit tests are pretty slim. Is it possible to add some tests for the mo loader?

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

by stealth35 at 2011/11/09 01:15:25 -0800

@fabpot test send to @stof ✌️

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

by stof at 2011/11/09 02:22:55 -0800

and merged in this branch

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

by fabpot at 2011/11/09 02:39:09 -0800

The tests do not pass for me:

    There was 1 error:

    1) Symfony\Tests\Component\Translation\Loader\MoFileLoaderTest::testLoadDoesNothingIfEmpty
    InvalidArgumentException: MO stream content has an invalid format.

    /Users/fabien/work/symfony/git/symfony/src/Symfony/Component/Translation/Loader/MoFileLoader.php:79
    /Users/fabien/work/symfony/git/symfony/src/Symfony/Component/Translation/Loader/MoFileLoader.php:46
    /Users/fabien/work/symfony/git/symfony/tests/Symfony/Tests/Component/Translation/Loader/MoFileLoaderTest.php:34

    --

    There was 1 failure:

    1) Symfony\Tests\Component\Translation\Loader\PoFileLoaderTest::testLoad
    Failed asserting that two arrays are equal.
    --- Expected
    +++ Actual
    @@ @@
     Array (
    -    'foo' => 'bar'
     )

    /Users/fabien/work/symfony/git/symfony/tests/Symfony/Tests/Component/Translation/Loader/PoFileLoaderTest.php:25
2011-11-09 22:00:02 +01:00
stealth35
796c6b2f8d [Locale] add getIcuVersion and getIcuDataVersion to Locale 2011-11-09 09:50:22 +01:00
Fabien Potencier
4f3e7bb698 merged branch canni/enable_validation_groups_callback (PR #2498)
Commits
-------

d08ec5e Add DelegatingValidator tests
e1822e7 Enable dynamic set of validation groups by a callback or Closure

Discussion
----------

[Form][Validator] Enable dynamic set of validation groups based on callback

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Symfony2 tests written for new feature: yes
closes tickets: #2498 #1151

This will allow developer to pass a Closure or a callback array as a Validation groups option of a form. Eg:

```
class ClientType extends AbstarctType
{
// ...
    public function getDefaultOptions(array $options)
    {
        return array(
            'validation_groups' => function(FormInterface $form){
                // return array of validation groups based on submitted user data (data is after transform)
                $data = $form->getData();
                if($data->getType() == Entity\Client::TYPE_PERSON)
                    return array('Default', 'person');
                else
                    return array('Default', 'company');
            },
        );
    }
// ...
}
```

```
class ClientType extends AbstarctType
{
// ...
    public function getDefaultOptions(array $options)
    {
        return array(
            'validation_groups' => array(
                'Acme\\AcmeBundle\\Entity\\Client',
                'determineValidationGroups'
            ),
        );
    }
// ...
}
```

This will make developers life easier !

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

by schmittjoh at 2011/10/27 06:39:56 -0700

Does that work if your ClientType were added to another form type?

e.g.

```php
<?php

class MyComplexType extends AbstractType
{
    public function buildForm(FormBuilder $builder, array $options)
    {
        $builder->add('client', new ClientType());
    }

    // ...
}
```

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

by canni at 2011/10/27 06:44:33 -0700

This is doing nothing more than injecting array of validation groups, should work, but I have not tested this use case.

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

by canni at 2011/10/28 01:58:26 -0700

PHPUnit output

```
OK, but incomplete or skipped tests!
Tests: 5011, Assertions: 12356, Incomplete: 36, Skipped: 32.
```

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

by canni at 2011/11/02 11:37:47 -0700

Now functionality is complete, test are written, and implementation is clean. :)

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

by stloyd at 2011/11/02 11:50:44 -0700

Can tou `squash` your commits ? Thanks.

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

by canni at 2011/11/02 11:58:41 -0700

Done

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

by fabpot at 2011/11/07 07:51:18 -0800

Can you add some tests for the `DelegatingValidator` class, which is where we can ensure that the new feature actually works as expected?

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

by canni at 2011/11/07 13:53:16 -0800

OK, I've written proof-of-concept tests, also I've squashed few commits to make things clear.
Personally I think this should go straight into 2.0 series, as it do not beak BC, and a feature is really nice to use.

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

by stof at 2011/11/07 14:17:15 -0800

@canni the 2.0 branch is for bug fixes, not for new features. This is the difference between maintenance releases and minor releases.
2011-11-08 09:05:41 +01:00
Fabien Potencier
88718164bf merged branch dbu/fix-routing-exception-doc (PR #2566)
Commits
-------

57040a8 document exceptions on the interfaces, inheritDoc on implementations, use statements instead of fully qualified exception names

Discussion
----------

Fix routing exception doc

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

This is only documentation cleanup for the url matcher and generator interfaces as they did not properly reflect the exceptions that are expected to be thrown. when the exceptions are not respected, unexpected behaviour can happen.

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

by dbu at 2011/11/07 00:49:08 -0800

ok, changed that. thought in an interface definition we would not want to "use" exceptions just for doc, but its changed now.

i rebased on the upstream master and got this additional commit about portuguese translations, no idea why this happened. and my local git diff does not show it either. is it creating problems in the pull request or can you still merge?

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

by fabpot at 2011/11/07 01:11:31 -0800

@dbu: Can you squash your commits and remove a commit that is not related to this PR? Thanks a lot.

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

by dbu at 2011/11/07 23:49:37 -0800

ok, done. thanks to you, i learn a lot about git :-)

for the record: i did git rebase --soft  on the commit id before my first commit, then git reset HEAD and git checkout on all the files not related to my changes, then commit again with the consolidated message, then git push --force origin fix-routing-exception-doc
2011-11-08 09:01:25 +01:00
dbu
57040a8703 document exceptions on the interfaces, inheritDoc on implementations, use statements instead of fully qualified exception names 2011-11-08 08:47:17 +01:00
Fabien Potencier
290734353c merged 2.0 2011-11-08 08:38:14 +01:00
Fabien Potencier
9d2ab9ca9c [Doctrine] fixed security user reloading when the user has been changed via a form with validation errors (closes #2033) 2011-11-08 08:33:49 +01:00
Fabien Potencier
318576b3ac merged branch ericclemmons/2295-serializer-normalizable-traversable (PR #2578)
Commits
-------

7346896 Changed Serialized#supportsNormalization to PRIVATE
e851efc Updated SerializerTest with "normalizeTraversable" & "testNormalizeGivesPriorityToInterfaceOverTraversable"
d789f94 Serializer#normalize gives precedence to objects that support normalization
9e6ba9a Added protected Serializer#supportsNormalization

Discussion
----------

[Serializer] `normalize` should use supported normalizer before Traversable

Bug fix: yes
Feature addition: no
Backwards compatibility break: no (discussion needed)
Symfony2 tests pass: yes
Fixes the following tickets: #2295

**Same as PR #2539, except rebased onto `2.0`**

Should I abstract out a `supportsDenormalization` function just for symmetry?
2011-11-08 07:46:27 +01:00
Eric Clemmons
7346896129 Changed Serialized#supportsNormalization to PRIVATE 2011-11-07 19:25:58 -08:00
Eric Clemmons
d789f9424e Serializer#normalize gives precedence to objects that support normalization 2011-11-07 19:25:58 -08:00
Eric Clemmons
9e6ba9ae89 Added protected Serializer#supportsNormalization
This is very useful for cleaning up the logic in Serializer#normalize
and allow easy checking of both the cache & stored normalizers
2011-11-07 19:25:58 -08:00
Jeremy Mikola
57b7daf252 [Security] Fix checkRequestPath doc; closes #2323 2011-11-07 17:36:10 -05:00
Fabien Potencier
8d9ea7c1ce merged branch dpb587/patch-sectok (PR #2414)
Commits
-------

ab9caa0 [Security] Check for request's session before attempting writes.
dabff0e [Security] Support removing tokens from a session.

Discussion
----------

[Security] Support removing tokens from a session.

Currently there is no way to remove a session's security token without invalidating the entire session and all its data (the ContextListener will only update the session if a token is non-null and non-anonymous). This patch fixes that.

I consider this a bug and I found no tests to prove otherwise. Let me know if I'm mistaken. Originally mentioned at https://groups.google.com/d/topic/symfony-devs/ojLvh0WUbfo/discussion

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

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

by ms937 at 2011/10/24 05:19:21 -0700

This change looks good to me. In fact I'm using similar patch in my app and it works as intended. Also, several other people requested this on the mailing list. Could someone from Symfony team merge this? Thanks.
2011-11-07 23:19:37 +01:00
Dariusz Górecki
e1822e7807 Enable dynamic set of validation groups by a callback or Closure
This will enable developer, to set a callback or a closure as a `'validation_groups'` form option,
this is usefull when we have to determine validation groups based on a client submitted data.
2011-11-07 22:48:01 +01:00
Fabien Potencier
a7296e7c84 [Security] made exceptions thrown by the user checker and the checkAuthentication() method use the hideUserNotFoundExceptions flag 2011-11-07 22:43:16 +01:00
Fabien Potencier
18c6a86291 [HttpKernel] fixed some unit tests 2011-11-07 22:31:58 +01:00
Fabien Potencier
47fca8e0a0 [HttpKernel] fixed file storage for the profiler 2011-11-07 22:01:48 +01:00
Fabien Potencier
ae154c8ecd [TwigBundle] fixed exception class name 2011-11-07 21:15:36 +01:00
Fabien Potencier
5d91849999 merged 2.0 2011-11-07 20:53:25 +01:00
Fabien Potencier
b33198f842 fixed CodeHelper::formatFileFromText() method to allow &quot; as a file wrapper (it occurs for the main exception message) 2011-11-07 20:49:42 +01:00
Fabien Potencier
47b888a957 added the real template name when an error occurs in a Twig template 2011-11-07 20:48:18 +01:00
Fabien Potencier
b957515a17 [TwigBundle] fixed inheritance in TimedTwigEngine 2011-11-07 19:12:33 +01:00
Fabien Potencier
9920289cbc merged branch docteurklein/ticket_2424 (PR #2429)
Commits
-------

78883f9 Allow syntax like ``{% render "AcmeDemoBundle:Frontend/Default:index" %}``

Discussion
----------

Allow syntax like ``{% render "AcmeDemoBundle:Frontend/Default:index" %}`

Allow syntax like ``{% render "AcmeDemoBundle:Frontend/Default:index" %}``

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

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

by stof at 2011/10/18 07:44:48 -0700

@docteurklein still the same issue. github says it conflicts. Are you sure you fetched the latest version ?
Thus it should be sent to 2.0 IMO as it is a bugfix

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

by docteurklein at 2011/10/18 07:51:21 -0700

@stof Yes, i'm pretty sure I followed the patches sending flow. (http://symfony.com/doc/2.0/contributing/code/patches.html

My tools are telling me it's ok.
I then merged it into master without any problem, which is up to date with upstream.

Sorry for the inconvenience.
I'll try to send it to 2.0 branch.

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

by docteurklein at 2011/10/18 07:53:52 -0700

@stof, what's wrong with https://github.com/docteurklein/symfony/commits/ticket_2424 ?

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

by stof at 2011/10/18 08:28:21 -0700

hmm, seems like github has an issue when determining if it conflicts or not. It's sad

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

by henrikbjorn at 2011/10/20 09:49:56 -0700

Dosent this already work ? as classes are namespaces the / should be a \ i think ?

Works for routes at least.
2011-11-07 18:53:44 +01:00
Fabien Potencier
c31c512466 [FrameworkBundle] fixed output buffering when an error occurs in a sub-request 2011-11-07 18:25:31 +01:00
Fabien Potencier
380c67efc8 [FrameworkBundle] fixed HttpKernel when the app is stateless 2011-11-07 18:25:10 +01:00
Fabien Potencier
6f05544424 [Console] added an exception when overriding an existing argument (added some unit tests for option and arguments overriding) 2011-11-07 17:22:50 +01:00
Fabien Potencier
6d324a6ba0 [Yaml] Yaml::parse() does not evaluate loaded files as PHP files by default anymore
This has been done to avoid security issues.

To get back the old behavior, call Yaml::enablePhpParsing() first.
2011-11-07 16:43:15 +01:00
Fabien Potencier
046cdce578 merged branch drak/docblocks (PR #2546)
Commits
-------

09e1e60 Grammar changes.
b4d0f4b Grammar changes
a0e62f0 Fix typos.
e6627fb Docblocks.

Discussion
----------

[HttpFoundation] Docblocks.

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: n/a
Fixes the following tickets: -

Added missing docblocks and type hints.  Improves use with IDE and auto-generated API docs.
2011-11-07 16:25:21 +01:00
Fabien Potencier
0875527fb8 [FrameworkBundle] added a missing translation for pt_PT (backported from master) 2011-11-07 08:42:30 +01:00
Fabien Potencier
4fc18552d1 merged branch danielcsgomes/master (PR #2569)
Commits
-------

3fe1e6d Added new pt_PT translations.

Discussion
----------

Added new pt_PT translations
2011-11-07 08:41:19 +01:00
Thomas Bibb
269a5e67c6 Added the ablity to get a requests ContentType 2011-11-06 14:22:57 +00:00
Jordi Boggiano
fabe818124 [EventDispatcher] Add reference to the EventDispatcher on the Event 2011-11-06 13:48:47 +01:00
Daniel Gomes
3fe1e6dcf8 Added new pt_PT translations. 2011-11-05 16:00:52 +00:00
Fabien Potencier
95a1902ea1 [Finder] bypassed some code when possible 2011-11-05 14:34:29 +01:00
dbu
957690cc2c fixing WebTastCase when kernel is not found and improving exception message 2011-11-04 18:29:15 +01:00
William DURAND
cdad7ab166 Introducing the Propel Bridge
Basic bridge with stable components for Propel.
2011-11-04 14:30:16 +01:00
Drak
09e1e60d31 Grammar changes. 2011-11-04 15:04:48 +05:45
Fabien Potencier
dbba79651a [Yaml] fixed dumper for floats when the locale separator is not a dot 2011-11-04 08:47:39 +01:00
Drak
b4d0f4b4cb Grammar changes 2011-11-04 08:08:11 +05:45
Fabien Potencier
bc80f2169a merged branch igorw/a-user-interface (PR #2555)
Commits
-------

ffa537c replace occurences of "an UserInteface" with "a UserInterface"

Discussion
----------

replace occurences of "an UserInteface" with "a UserInterface"
2011-11-03 18:13:48 +01:00
Igor Wiedler
ffa537cc45 replace occurences of "an UserInteface" with "a UserInterface" 2011-11-03 15:05:48 +01:00
Drak
a0e62f0775 Fix typos. 2011-11-03 11:22:03 +05:45
Drak
e6627fb0ff Docblocks. 2011-11-02 21:27:51 +05:45
Fabien Potencier
c18f5a8d94 merged branch IamPersistent/collection (PR #2416)
Commits
-------

fbd2a0e make suggested changes for default value
c507b1d update variable name to match the option name
b53f000 add the ability to set the form prototype name in CollectionType. this will aid in handling nested collections in forms

Discussion
----------

[Form] Collection

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: [#1324](https://github.com/symfony/symfony/issues/1324)

add the ability to set the form prototype name in CollectionType. this will aid in handling nested collections in forms

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

by IamPersistent at 2011/10/17 02:54:45 -0700

Actually, as an afterthought, I looked over at the issues and this is basically https://github.com/symfony/symfony/issues/1324 just adding an extra option instead of using the prototype option.

@stloyd, my thought was handling the case where someone was "clever" enough to set the 'prototype_name' option to "". But I could be over-thinking :)

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

by stloyd at 2011/10/17 03:00:23 -0700

@IamPersistent IMO if someone is setting this option, he should be aware of that problem, also AFAIK `$$$$` could be *valid* name too ;-)

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

by IamPersistent at 2011/10/17 03:02:14 -0700

@stloyd, I'm fine with changing it, I'll wait to see what everyone else has to say about this request vs using the prototype option for the name in 1324

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

by IamPersistent at 2011/10/17 03:28:49 -0700

@stloyd, @stof, I made the suggested changes, now I suppose, let the debate begin over PR1324 vs this

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

by stloyd at 2011/10/17 03:47:53 -0700

IMO this PR makes changing prototype name in more clean way, so I would prefer this one over that proposed in #1324.
2011-11-02 14:50:07 +01:00
Fabien Potencier
165b08986b merged branch mrtorrent/use_parse_error_code_in_stubnumberformatter (PR #2521)
Commits
-------

89cd64a Set error code when number cannot be parsed. Fixes #2389

Discussion
----------

Set error code when number cannot be parsed in StubNumberFormatter

The stub implementation of NumberFormatter never sets an error code and instead always returns the "no-error" code. This causes unexpected results when a transformer gives it bad arguments, such as transforming the input value to boolean false and causing exceptions further down the line, as in #2389.

Instead, it should set an error code when appropriate and return it when requested so that a TransformationFailedException can be raised and the input value left unaltered.

There may be other instances where an error should be set. This covers the common use case of non-numeric input.

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2389
2011-11-02 14:36:52 +01:00
Fabien Potencier
2e90a813a4 merged branch mrtorrent/integer_transformer_cast_fix (PR #2520)
Commits
-------

c9d05d7 Let NumberFormatter handle integer type casting

Discussion
----------

Let NumberFormatter handle integer type casting

The integer to localised string transformer is currently casting everything it gets to an integer, even if it is not a number. This responsibility should be passed off to NumberFormatter.

Partially addresses #2389 by not mistakenly typecasting a boolean false into an integer 0

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

by mrtorrent at 2011/10/30 15:04:28 -0700

Apologies, forgot the template:

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2389 (partial)
2011-11-02 14:36:23 +01:00
Fabien Potencier
f8f622b39c bumped Symfony version to 2.0.6-DEV 2011-11-02 14:18:45 +01:00
Fabien Potencier
7f21a5e979 bumped Symfony version in composer.json files to 2.0.5 2011-11-02 12:42:41 +01:00
Fabien Potencier
d1783adaef updated VERSION for 2.0.5 2011-11-02 12:40:01 +01:00
Thomas Adam
fc4e62822c [Config] added append to the node builder 2011-11-02 10:59:34 +01:00
Henrik Westphal
316eacb83b Fixed merge conflict. 2011-11-02 09:29:19 +01:00
Fabien Potencier
fd380e37a9 merged 2.0 2011-11-01 20:19:25 +01:00
Fabien Potencier
fc97472f64 updated composer.json files to contain information about autoloading and target dirs 2011-11-01 20:17:57 +01:00
Benjamin Eberlei
47ebf085fd Fix some bugs 2011-11-01 18:09:09 +01:00
David Soria Parra
c5e2defe5f Fix ternary operator usage in RequestMatcher::checkIpv6() 2011-11-01 18:50:28 +01:00
Benjamin Eberlei
fad825ed3f Add DoctrineValidationPass to DoctrineBundle#buildContainer 2011-11-01 17:22:04 +01:00
Benjamin Eberlei
a064acdcc7 Implement feature to add validations based on the Manager-Type (ORM, MongoDB, CouchDB) 2011-11-01 17:11:28 +01:00
Fabien Potencier
04a1deace0 updated CHANGELOG for 2.1 2011-11-01 15:30:43 +01:00
Fabien Potencier
67bb80f526 merged branch benjamindulau/type_validator (PR #2532)
Commits
-------

05a4e9d [Validators][Type] Added support for ctype_* functions + tests

Discussion
----------

[Validators][Type] Added support for ctype_* functions + tests

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

Not sure if the ctype_* functions support should be included in the AssertTypeValidator or in a dedicated one.
What do you think ?
2011-11-01 15:28:13 +01:00
Fabien Potencier
0e73b114a1 merged branch stof/serialize_resource (PR #2529)
Commits
-------

cbd0c3c [Config] Implemented Serializable on resources

Discussion
----------

[Config] Implemented Serializable on resources

bug fix: no
feature addition: no
BC break: not really. you simply need to clear your cache in debug mode
test passes: yes

Serializing private variables without implementing Serializable uses far more space as it prepend the fully qualified class name before the name of each property. This change allows keeping the meta file smaller.
2011-11-01 15:27:25 +01:00
Fabien Potencier
3f38b9c537 merged branch ericclemmons/1735-entity_choice_list_group_by (PR #2464)
Commits
-------

6cb7acf CS - camelCase & curly braces
d9b7abb Added EntityChoiceList test for `group_by` and invalid, deep property paths
e6554d6 Removed Closure support from group_by (PropertyPath strings only)
037933a CS - (String) renamed to (string)
7ad0f05 Added group_by test for EntityType
882482a Added group_by tests for EntityChoiceList
040e988 `EntityChoiceList` now supports grouping of entities by property path or closure
b171a6a Added `group_by` to EntityType

Discussion
----------

[Doctrine] [Form] EntityType+EntityChoiceList supports grouping choices

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

Per the discussion in #1735, `EntityType` does not immediately support grouping options, though I updated support for it in `EntityChoiceList` in fb9d951b1d.

This PR accomplishes the following:

* Adds optional `group_by` property to `EntityType` that supports either a `PropertyPath` or a `\Closure` that is evaluated on the entity choices
* Support for groups is added via the constructor in `EntityChoiceList`
* Groups are created prior to `EntityChoiceList#loadEntities` via a new `groupEntities` function
* Added tests for `EntityChoiceList`
* Added test for `EntityType` `group_by` support

*There is an alternative version that only modifies `EntityType`, but that requires the addition of `EntityType#buildView(...)`, which is messy, IMO: https://github.com/ericclemmons/symfony/compare/master...1735-entity_type_group_by*

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

by fabpot at 2011/10/25 01:48:23 -0700

ping @beberlei

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

by beberlei at 2011/10/25 03:06:05 -0700

I didnt run the tests, but generally this looks very good and is a good extension.

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

by beberlei at 2011/11/01 06:25:09 -0700

@fabpot i revewied this and it looks very good, tests all pass, i think this is a very nice addition.
2011-11-01 15:23:39 +01:00
Fabien Potencier
c919940f88 merged branch beberlei/FormErrors (PR #2533)
Commits
-------

149bdb9 Enhance error messages with regard to form type properties.

Discussion
----------

[Form] Enhanced error messages

With this patch its much easier to see what went wrong with a form type and what the possible options are.

Also added tests for this error conditions.
2011-11-01 15:22:54 +01:00
Fabien Potencier
d633d60672 merged branch beberlei/RemoveAbtractDoctrineBundle (PR #2484)
Commits
-------

661421f [Doctrine] Remove AbstractDoctrineBundle and move code into Doctrine Bridge

Discussion
----------

[WIP] [Doctrine] Remove abtract doctrine bundle

Remove AbstractDoctrineBundle and move code into Doctrine Bridge. It is a BC break because all the "other" Doctrine Bundles MongoDB ODM, CouchDB ODM and PHPCR need to be updated to cope with this.

I will prepare PRs for them aswell and then remove the [WIP] here.

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

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

by beberlei at 2011/10/26 12:32:51 -0700

Here are all 3 PRs, can we coordinate on merging them somehow?

https://github.com/symfony/DoctrineMongoDBBundle/pull/50
https://github.com/symfony-cmf/symfony-cmf/pull/118
https://github.com/doctrine/DoctrineCouchDBBundle/pull/4

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

by beberlei at 2011/10/26 12:33:38 -0700

Ping @lsmith77 @jwage

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

by lsmith77 at 2011/10/26 12:35:29 -0700

all good for me ..

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

by stof at 2011/10/26 14:58:01 -0700

Well, this does not fix #2463. A change done in the bridge will still be able to break the service definitions of the other bundles or require tricky stuff to keep different versions of the logic.

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

by beberlei at 2011/10/26 22:49:39 -0700

@stof true, that is what https://github.com/doctrine/common/pull/71 will be about.

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

by stloyd at 2011/10/26 23:51:25 -0700

Comment just for linking cross PRs and for watching ;-) doctrine/common#71

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

by lsmith77 at 2011/10/31 08:18:45 -0700

please add forward compatibly into symfony 2.0 as per #2522

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

by beberlei at 2011/11/01 05:11:34 -0700

This doesn't make sense imho, since the number of people using the doctrine extension is 4 and everybody also prepared their pull request for this.

The problem is really that we need a branch for the MongoDB Bundle

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

by beberlei at 2011/11/01 05:40:49 -0700

@fabpot i created a branch in MongoDBBundle for 2.0 so this is ready to be merged.
2011-11-01 15:21:25 +01:00
Benjamin Eberlei
149bdb962b Enhance error messages with regard to form type properties. 2011-11-01 14:16:02 +01:00
Benjamin Dulau
05a4e9d386 [Validators][Type] Added support for ctype_* functions + tests 2011-11-01 13:01:54 +01:00
Fabien Potencier
8a62e3249f merged 2.0 2011-11-01 12:32:44 +01:00
Fabien Potencier
d7a5351aaa updated composer.json files to contain information about autoloading and target dirs 2011-11-01 12:30:24 +01:00
H. Westphal
f9befb6348 Remove only the security token instead of the session cookie. 2011-11-01 11:58:03 +01:00
Lukas Kahwe Smith
b6bf0182e9 tweaked error handling for the forward compatibility 2011-11-01 09:40:05 +01:00
Christophe Coevoet
cbd0c3c8e9 [Config] Implemented Serializable on resources 2011-11-01 02:15:01 +01:00
H. Westphal
348bccbbca Clear session cookie if user was deleted, is disabled or locked to prevent infinite redirect loops to the login path (fixes #1798). 2011-10-31 21:27:23 +01:00
Lukas Kahwe Smith
dd606b5dee added note about the purpose of this class 2011-10-31 16:48:41 +01:00
Lukas Kahwe Smith
c1426baee1 added locale handling forward compatibility 2011-10-31 16:15:30 +01:00
Lukas Kahwe Smith
10eed30cde added MessageDataCollector forward compatibility 2011-10-31 16:15:10 +01:00
Miquel Rodríguez Telep / Michael Rodríguez-Torrent
89cd64a4a5 Set error code when number cannot be parsed. Fixes #2389 2011-10-30 22:02:16 +00:00
Miquel Rodríguez Telep / Michael Rodríguez-Torrent
c9d05d7236 Let NumberFormatter handle integer type casting
Partially addresses #2389 by not mistakenly typecasting a boolean false into
an integer 0
2011-10-30 21:17:28 +00:00
Henrik Westphal
f9a65ba48d Redirect to default_target_path if use_referer is true and the referer is the login_path. 2011-10-30 18:25:26 +01:00
Fabien Potencier
c2fa73d33a [HttpKernel] removed the _route entry from _route_params 2011-10-30 08:45:45 +01:00
Fabien Potencier
d34d50f0b0 fixed CS 2011-10-29 12:05:45 +02:00
Fabien Potencier
99a96d35b5 Merge branch '2.0'
* 2.0:
  fixed CS
2011-10-29 12:04:03 +02:00
Fabien Potencier
68b7662400 fixed CS 2011-10-29 12:03:59 +02:00
Fabien Potencier
8550f372fb removed unused use statements 2011-10-29 12:01:53 +02:00
Fabien Potencier
dec43f5539 merged 2.0 2011-10-29 12:01:39 +02:00
Fabien Potencier
f8065d1805 [HttpKernel] added a way to get the original values returned by the router 2011-10-29 12:00:39 +02:00
Fabien Potencier
851eb73778 removed unused use statements 2011-10-29 11:56:30 +02:00
Douglas Greenshields
2ddd7cca7b [Console] Fixed stilted English in console header 2011-10-28 23:25:00 +02:00
Fabien Potencier
43ce425f88 [HttpKernel] added missing accessor 2011-10-28 08:27:03 +02:00
Jeremy Mikola
80f0b980ba [DependencyInjection] Fix DefinitionDecorator::getArgument() for replacements
While Definition::getArgument() could be used to fetch replaced values, it relied upon bad comparison logic (e.g. "index_1" > 1). Additionally, storing original arguments and replacements in the same array makes Definition::getArguments()'s bounds check unreliable. A single argument and its replacement would count twice, allowing getArgument(2) to pass the bounds check and result in an array index error.

With this new method, fetching of replacement arguments is more straightforward and bounds checking functions as it should.
2011-10-27 18:03:51 -04:00
Arnout Boks
454e602c06 [SecurityBundle] Skipped two tests in PHP <5.3.9 on Windows as these hang due to a known bug 2011-10-27 09:21:07 +02:00
Adam Monsen
4bd340d239 [Security] Fix typo in init:acl command name 2011-10-26 22:06:51 -07:00
Benjamin Eberlei
661421ff7c [Doctrine] Remove AbstractDoctrineBundle and move code into Doctrine Bridge 2011-10-26 20:40:48 +02:00
Fabien Potencier
ac5b8a4c37 merged 2.0 2011-10-26 14:29:19 +02:00
Fabien Potencier
3043fa0878 [HttpFoundation] fixed PHP 5.4 regression 2011-10-26 14:13:44 +02:00
Danny Berger
ab9caa0a61 [Security] Check for request's session before attempting writes. 2011-10-25 14:19:34 -04:00
Fabien Potencier
e50ce47507 [WebProfilerBundle] adjusted the default canvas size for the timeline 2011-10-25 18:04:41 +02:00
Eric Clemmons
e6554d6d45 Removed Closure support from group_by (PropertyPath strings only) 2011-10-25 08:55:31 -07:00
Fabien Potencier
8dcde3c076 [DependencyInjection] fixed int casting for XML files (based on what is done in the YAML component) 2011-10-25 17:52:36 +02:00
Eric Clemmons
037933a2ec CS - (String) renamed to (string) 2011-10-25 08:45:23 -07:00
Fabien Potencier
bc330d4487 merged branch lsmith77/fix_q_handling (PR #2365)
Commits
-------

d3f137b cosmetic tweak
2877883 anything in front of ;q= is part of the mime type, anything after may be ignored

Discussion
----------

[HttpFoundation] fix splitHttpAcceptHeader() parsing of parameters

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

anything in front of ;q= is part of the mime type, anything after may be ignored

see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1

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

by lsmith77 at 2011/10/09 04:00:12 -0700

i must admit .. i am not 100% that my implemention is correct either .. but i am sure the current one isn't.

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

by lsmith77 at 2011/10/09 07:57:33 -0700

@fabpot: I am also not sure if getFormat() should optionally not support matching parameters, aka anything before ``;q=..``
2011-10-25 17:26:31 +02:00
Fabien Potencier
a4d4d4c1f8 merged branch mvrhov/dbal_sessstorage_fix (PR #2384)
Commits
-------

0907111 session data needs to be encoded because it can contain non binary safe characters e.g null. Fixes #2067

Discussion
----------

session data needs to be encoded because it can contain non binary safe characters e.g null., part 2

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

I'm marking this as a compatibility break because session table should be cleared and even if not cleared all currently logged in users will be logged out.

This is the fix for a same issue in DBAL session storage made against master.

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

by schmittjoh at 2011/10/12 02:44:19 -0700

If I understand this correctly, only the PgSqlPlatform is affected by this. What do you think about adding an ``ìnstanceof PgSqlPlatform`` check?

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

by mvrhov at 2011/10/12 03:47:52 -0700

It's the same for sqlite, it just happens that mysql escapes \0, so we can say it's driver dependent.
The Drupal guys had the same issue http://drupal.org/node/690746 , they changed to column type to bytea for pgsql and for mysql to blob, also in Drupal report you can find that storing this into a session hash_file('md5', 'CHANGELOG.txt', TRUE) will trigger the similar problem in mysql.
The other thing to consider is what I mentioned in original bugreport, e.g igbinary as default serializer for session data.
2011-10-25 17:18:25 +02:00
Fabien Potencier
94e7e54777 merged branch mvrhov/pdo_sessstorage_fix (PR #2382)
Commits
-------

edfa29b session data needs to be encoded because it can contain non binary safe characters e.g null. Fixes #2067

Discussion
----------

session data needs to be encoded because it can contain non binary safe characters e.g null.

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

I'm marking this as a compatibility break because session table should be cleared and even if not cleared all currently logged in users will be logged out.

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

by mvrhov at 2011/10/11 12:52:25 -0700

P.S. I know there was a talk about doctrine based session storage but I cannot find this in core. It probably has the same problem.

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

by eventhorizonpl at 2011/10/11 14:34:08 -0700

Thanks for tracking down and fixing this issue!

Best regards,
Michal

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

by stof at 2011/10/11 16:24:18 -0700

@mvrhov The Doctrine based storage is only available in master, not in 2.0
2011-10-25 17:18:16 +02:00
Fabien Potencier
95ec41b075 [Console] made the defaults in Application more easily customizable 2011-10-25 17:12:17 +02:00
Fabien Potencier
6c2f093b33 [HttpFoundation] removed superfluous query call (closes #2469) 2011-10-25 15:45:14 +02:00
Jonathan Ingram
6343bef55e [HttpKernel] Updated mirror method to check for symlinks before dirs and files 2011-10-25 20:58:39 +12:00
Eric Clemmons
040e988f0c EntityChoiceList now supports grouping of entities by property path or closure 2011-10-24 18:45:26 -07:00
Eric Clemmons
b171a6a8a3 Added group_by to EntityType 2011-10-24 18:45:06 -07:00
Fabien Potencier
b112ef5fdc merged branch bmatzner/patch-1 (PR #2459)
Commits
-------

c46fe16 Adding "sf-toolbar" class to toolbar wrapper to make it possible to check for its existance prior to js instantiation (in order to change page layout when profiler toolbar is enabled)

Discussion
----------

[WebProfilerBundle] Adding "sf-toolbar" class to toolbar wrapper to make it possible to check

Adding "sf-toolbar" class to toolbar wrapper to make it possible to check for its existance prior to js instantiation (in order to change page layout when profiler toolbar is enabled)
2011-10-24 22:47:47 +02:00
Fabien Potencier
876ef554e5 merged branch vatson/bugfix-phpdumper-optimize-string (PR #2457)
Commits
-------

808088a added the ability to use dot and single quotes in the keys and values

Discussion
----------

[2.0][Bugfix][DependencyInjection] added the ability to use dot and single quotes in the keys and values

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

We can not set a specific combination of dots and single quotes in the values ​​and keys of the arguments. I.E.

```xml
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
  <services>
    <service id="key_escaper" class="MyNamespace\MyClass">
        <call method="setCollection">
          <argument type="collection">
            <argument key="only dot">.</argument>
            <argument key="concatenation as value">.''.</argument>
            <argument key="concatenation from the start line">''.</argument>
            <argument key=".">is the same problem for the keys?</argument>
          </argument>
        </call>
      </service>
  </services>
</container>
```

As a result we have such a dump:

```php
<?php

class appDevDev_formapro1DebugProjectContainer extends Container
{
  protected function getKeyEscaperService()
  {
      $this->services['key_escaper'] = $instance = new \MyNamespace\MyClass();

      $instance->setCollection(array('only dot' => , 'concatenation as value' => '.\'\, 'concatenation from the start line' => '\'\,  => 'is the same problem for the keys?'));

      return $instance;
  }
}
```
2011-10-24 22:45:29 +02:00
Jeremy Mikola
64e783367f [FrameworkBundle] Fix typo in FrameworkExtensionTest 2011-10-24 14:17:43 -04:00
Fabien Potencier
9077f6a971 [SwiftmailerBundle] replaced MessageLogger class with the one from Swiftmailer 4.1.3 2011-10-24 17:13:15 +02:00
Fabien Potencier
70e0dba77c moved the Swiftmailer data collector to the Swifmailer bridge 2011-10-24 17:10:29 +02:00
Bernd Matzner
c46fe1690f Adding "sf-toolbar" class to toolbar wrapper to make it possible to check for its existance prior to js instantiation (in order to change page layout when profiler toolbar is enabled) 2011-10-24 15:29:00 +03:00
Fabien Potencier
e790842ea6 merged branch Seldaek/firephp (PR #2458)
Commits
-------

27d0809 [MonologBridge] Adjust for Monolog 1.0.2

Discussion
----------

[MonologBridge] Adjust for Monolog 1.0.2

This is BC, it just turns off headers in browsers that don't have Firebug, I have had problems in IE with more than 150 log entries just crashing the page.
2011-10-24 12:34:15 +02:00
Fabien Potencier
09692e2f16 [Routing] removed unused variable 2011-10-24 12:31:00 +02:00
Jordi Boggiano
27d080984c [MonologBridge] Adjust for Monolog 1.0.2 2011-10-24 12:01:46 +02:00
Vadim Tyukov
808088a3ca added the ability to use dot and single quotes in the keys and values 2011-10-24 12:45:36 +03:00
Fabien Potencier
cbb4bbae97 [Routing] fixed side-effect in the PHP matcher dumper 2011-10-24 11:41:08 +02:00
Fabien Potencier
167a96fcf3 [Routing] fixed side-effect in the PHP matcher dumper 2011-10-24 11:39:31 +02:00
Fabien Potencier
8fa061cc6e [WebProfilerBundle] added a profiler panel for the router 2011-10-24 09:08:38 +02:00
Fabien Potencier
8cc3158d89 [FrameworkBundle] added a command to help debugging route matching problems 2011-10-24 09:08:38 +02:00
Fabien Potencier
24b93928bf [Routing] added a matcher that helps debugging matching problems 2011-10-24 09:08:36 +02:00
Christophe Coevoet
633f0e9d77 [DoctrineBundle] Moved the entity provider service to DoctrineBundle 2011-10-23 15:13:40 +02:00
Christophe Coevoet
74732dc223 [SecurityBundle] Added a way to extend the providers section of the config 2011-10-23 14:39:05 +02:00
Fabien Potencier
6aee641a1e revert 89fd965 (refs #2339) 2011-10-23 14:09:54 +02:00
Fabien Potencier
2e1344eb7e [Routing] added the possibility to define default values and requirements for placeholders in prefix 2011-10-23 11:57:55 +02:00
Fabien Potencier
1bd6e4d427 merged 2.0 2011-10-23 09:53:10 +02:00
Fabien Potencier
76148d0da6 merged branch mvrhov/cache_warmup_exception (PR #2445)
Commits
-------

6b872cf Check if cache_warmer service is available before doing the actual cache warmup

Discussion
----------

fix cache warump exception when service is not available

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: N/A

fixes [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
  You have requested a non-existent service "cache_warmer". in console when FrameworkBundle is removed from kernel.
2011-10-23 09:52:48 +02:00
Fabien Potencier
1a43505a3e [FrameworkBundle] fixed priority to be consistent with 2.1 2011-10-23 09:50:45 +02:00
Fabien Potencier
d5bec5a57c merged branch mvrhov/cache_warmup_exception (PR #2445)
Commits
-------

6b872cf Check if cache_warmer service is available before doing the actual cache warmup
40fb76d [Framework] removed wrong listener

Discussion
----------

fix cache warump exception when service is not available

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: N/A

fixes [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
  You have requested a non-existent service "cache_warmer". in console when FrameworkBundle is removed from kernel.
2011-10-23 09:48:57 +02:00
Fabien Potencier
ad7fcf5206 moved WarmableInterface to the HttpKernel component 2011-10-23 09:47:17 +02:00
Fabien Potencier
cb9ac138d5 merged branch dbu/router-cache-warmup-interface (PR #2451)
Commits
-------

96235a6 cs fix
46a69f1 define a WarmableInterface and only warm the cache if it implements warmable to allow replacing the core router. this fixes #2422. combining routers will only really work when #2450 is merged too.

Discussion
----------

define a WarmableInterface and only warm the cache if it implements warmable

define a WarmableInterface and only warm the cache if it implements warmable to allow replacing the core router. this fixes #2422. combining routers will only really work when #2450 is merged too.

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

(*) tests:
success for
phpunit src/Symfony/Bundle/FrameworkBundle/Tests/
and
phpunit tests/Symfony/Tests/Component/Routing/

but when running all tests, i have to put gc_disable() into autoload to avoid segmentation fault and then get (after 3000 successful tests):

PHP Fatal error:  Call to undefined method Symfony\Tests\Component\HttpKernel\Debug\StopwatchTest::assertCount() in /home/david/liip/symfony-cmf/cmf-sandbox/vendor/symfony/tests/Symfony/Tests/Component/HttpKernel/Debug/StopwatchTest.php on line 84

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

by stof at 2011/10/22 08:46:31 -0700

@dbu assertCount is new in PHP 3.6. It seems like the test of the new 2.1 feature has been written using 3.6-RC.

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

by dbu at 2011/10/22 09:40:07 -0700

@stof: ah, thanks for the hint. i hope you mean php 3.4 and not 3.6? but i assume symfony 2.1 should be able to run on 3.3, right?

anyways, the tests run through if i disable the StopWatch, so i guess we can consider the tests succeeding.

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

by stof at 2011/10/22 09:41:28 -0700

this is a method of PHPUnit TestCase class. I was talking about the PHPUnit version
2011-10-23 09:43:17 +02:00
Fabien Potencier
6cacc63ba9 merged branch dbu/fix-router-dependency-injection (PR #2450)
Commits
-------

6b02ffb fix a typo in the routing dependency injection configuration. the request_context service is named router, not routing

Discussion
----------

fix a typo in the routing dependency injection configuration

fix a typo in the routing dependency injection configuration. the request_context service is named router.request_context , not routing.request_context

Bug fix: yes
Feature addition: no
Backwards compatibility break: ? - should not unless somebody relied on the bug
Symfony2 tests pass: yes
Fixes the following tickets: no ticket

i ran
phpunit src/Symfony/Bundle/FrameworkBundle/Tests/
and
phpunit tests/Symfony/Tests/Component/Routing/
2011-10-23 09:37:26 +02:00
dbu
96235a6847 cs fix 2011-10-22 16:27:21 +02:00
dbu
46a69f1ca0 define a WarmableInterface and only warm the cache if it implements warmable to allow replacing the core router. this fixes #2422. combining routers will only really work when #2450 is merged too. 2011-10-22 16:12:46 +02:00
dbu
6b02ffba0f fix a typo in the routing dependency injection configuration. the request_context service is named router, not routing 2011-10-22 16:07:33 +02:00
Miha Vrhovnik
6b872cfa40 Check if cache_warmer service is available before doing the actual cache warmup 2011-10-22 10:56:16 +02:00
Fabien Potencier
490d60f5f9 [HttpKernel] fixed event priority (if not, there is a problem when an exception occurs during one of the event registered before this one) 2011-10-22 09:30:41 +02:00
Fabien Potencier
c5ca40c711 [Routing] added support for _scheme requirement in UrlMatcher (see 07aae98495) 2011-10-22 08:04:10 +02:00
Fabien Potencier
b95fe53bf4 - 2011-10-21 16:46:37 +02:00
Fabien Potencier
842ac36f33 added Stopwatch support in debug mode, added a timeline representing the stopwatch events in the web profiler
Enjoy!
2011-10-21 07:45:12 +02:00
Fabien Potencier
106ebdbe18 [HttpKernel] added a Stopwatch 2011-10-21 07:39:32 +02:00
Fabien Potencier
fbc422b978 [BrowserKit] added the standard output when an error occurs during the request execution (it might contain very useful information for debugging) 2011-10-21 07:39:26 +02:00
Fabien Potencier
40fb76dd1a [Framework] removed wrong listener 2011-10-20 22:59:10 +02:00
Christophe Coevoet
e81c710784 Increased the priority of the profiler request listener
If a request listener returns a response before calling the profiler
listener, the request will not be added in the stack leading to an error
during the handling of the kernel.response event. The profiler listener
should ideally be run first.
2011-10-20 16:48:14 +02:00
docteurklein
78883f90a6 Allow syntax like `{% render "AcmeDemoBundle:Frontend/Default:index" %}`
Bug fix: yes
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2424
2011-10-18 16:38:10 +02:00
Richard Miller
79638d3734 Removed abstract as these services will not appear anyway 2011-10-18 14:02:24 +01:00
Richard Miller
312b20f94b [FrameworkBundle] Added more info to debug command output 2011-10-18 13:54:39 +01:00
Fabien Potencier
347053c363 Moved most of the logic from ResponseListener to the Response::prepare() method
That allows projects that only use HttpFoundation and not HttpKernel to be able to
enforce the HTTP specification "rules".

$request = Request::createFromGlobals();
$response = new Response();

// do whatever you want with the Respons

// enforce HTTP spec
$response->prepare($request);

$response->send();

Within Symfony2, the prepare method is automatically called by the ResponseListener.
2011-10-18 09:04:20 +02:00
Fabien Potencier
fbbda262e7 merged 2.0 2011-10-17 21:41:08 +02:00
Fabien Potencier
8ca19af477 merged branch Tobion/patch-3 (PR #2415)
Commits
-------

ae342c7 unified toolbar.css
a7e4e70 unified profiler.css
09fe09e unified and corrected exception_layout.css
3a1674b unified and corrected exception.css

Discussion
----------

Unified and corrected CSS markup

Unified (spaces, braces, quotes, indention) and corrected (missing semicolon) the CSS markup.
Did not change any semantic, only markup!
@fabpot: New pull based on symfony:2.0 and changed formatting style as agreed in #2405
2011-10-17 21:38:01 +02:00
Fabien Potencier
fcd533a541 merged branch richardmiller/fixing_debug_command_output (PR #2420)
Commits
-------

1768544 Changed debug output to say Service Id rather than name for the service ids

Discussion
----------

Changed debug output to say Service Id rather than name for the service i

Changed debug output to say Service Id rather than name for the service ids
2011-10-17 21:29:09 +02:00
Fabien Potencier
97d6591985 [WebProfilerBundle] tweaked the default layout to make more room for interesting content 2011-10-17 16:01:42 +02:00
Richard Miller
1768544710 Changed debug output to say Service Id rather than name for the service ids 2011-10-17 14:03:16 +01:00
IamPersistent
fbd2a0ed9a make suggested changes for default value 2011-10-17 03:27:04 -07:00
IamPersistent
c507b1db73 update variable name to match the option name 2011-10-17 02:58:01 -07:00
IamPersistent
b53f000061 add the ability to set the form prototype name in CollectionType. this will aid in handling nested collections in forms 2011-10-17 02:43:24 -07:00
Fabien Potencier
0ffd91724b Merge branch '2.0'
* 2.0:
  [HttpKernel] fixed typo
2011-10-17 04:18:59 +02:00
Fabien Potencier
c6e9011fb5 [HttpKernel] fixed typo 2011-10-17 04:18:47 +02:00
Fabien Potencier
de9cf88676 merged 2.0 2011-10-17 02:33:13 +02:00
Fabien Potencier
2b0af5e93b [HttpKernel] fixed profile parent/children for deep-nested requests 2011-10-17 02:32:06 +02:00
Tobias Schultze
ae342c7484 unified toolbar.css 2011-10-17 00:16:29 +03:00
Tobias Schultze
a7e4e70890 unified profiler.css 2011-10-17 00:14:43 +03:00
Tobias Schultze
09fe09ef5a unified and corrected exception_layout.css 2011-10-16 23:58:22 +03:00
Tobias Schultze
3a1674bcd4 unified and corrected exception.css 2011-10-16 23:50:00 +03:00
Fabien Potencier
373e146b6a [DoctrineBundle] fixed PHPDoc 2011-10-16 22:42:14 +02:00
Fabien Potencier
b8360d83f0 merged branch stof/doctrine_registry (PR #2410)
Commits
-------

9546ee6 Removed the IndexedReader
ea2cf73 Refactored the validator initializer
c6063ec [DoctrineBundle] Updated the code to use the new registry
a1784c2 [DoctrineBridge] Updated the code to use the new registry

Discussion
----------

Doctrine registry

This updates the Doctrine bridge and DoctrineBundle to use the new ManagerRegistry interface and its methods instead of using the old methods which are marked as deprecated.
2011-10-16 22:40:57 +02:00
Fabien Potencier
8ae0af0b4f merged branch lsmith77/use_stmt_cleanups (PR #2408)
Commits
-------

18cca22 cleaned up the use statements in the Registry class and RegistryInterface

Discussion
----------

cleaned up the use statements in the Registry class and RegistryInterface

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

just cosmetics ..
2011-10-16 22:38:09 +02:00
Fabien Potencier
f45b1df38c merged branch stof/router_check (PR #2409)
Commits
-------

63d2ce2 [FrameworkBundle] Fixed the ckeck for the router class

Discussion
----------

[FrameworkBundle] Fixed the ckeck for the router class

The getRouteCollection method is now part of the RouterInterface so the
command should accept any implementation of the interface instead of just
the implementations extending the core one.
2011-10-16 22:37:48 +02:00
Hugo Hamon
64d970ef2d [FrameworkBundle] removed "use" statements for unused classes. 2011-10-16 18:42:34 +02:00
Christophe Coevoet
9546ee6d29 Removed the IndexedReader
The ORM now supports using a standard reader and does the needed logic
internally.
The IndexedReader is also available in Common for people needing it.
2011-10-16 17:59:31 +02:00
Christophe Coevoet
ea2cf73715 Refactored the validator initializer
It can now be reused for all Doctrine projects, not only for the ORM.
2011-10-16 17:13:11 +02:00
Christophe Coevoet
c6063ecf6f [DoctrineBundle] Updated the code to use the new registry 2011-10-16 14:57:47 +02:00
Christophe Coevoet
a1784c2b97 [DoctrineBridge] Updated the code to use the new registry 2011-10-16 14:57:14 +02:00
Christophe Coevoet
63d2ce28fd [FrameworkBundle] Fixed the ckeck for the router class
The getRouteCollection method is now part of the RouterInterface so the
command should accept any implementation of the interface instead of just
the implementations extending the core one.
2011-10-16 13:56:51 +02:00
Lukas Kahwe Smith
18cca22b3f cleaned up the use statements in the Registry class and RegistryInterface 2011-10-16 13:51:14 +02:00
Fabien Potencier
08285edef9 [SwiftmailerBundle] fixed email display in the web profiler when the message is not in UTF-8 2011-10-16 11:18:01 +02:00
Fabien Potencier
976f8b10fa [HttpKernel] moved the Timer data collector to HttpKernel 2011-10-16 10:21:12 +02:00
Tobias Schultze
2009249128 fixed language 2011-10-16 07:51:23 +03:00
Fabien Potencier
f1e9709742 updated composer.json files 2011-10-16 03:38:02 +02:00
Fabien Potencier
ae8efc4da9 merged 2.0 2011-10-16 03:34:55 +02:00
Igor Wiedler
a1bab8305d [composer] make doctrine dbal and orm recommended by doctrine-bundle 2011-10-15 16:57:28 +02:00
Igor Wiedler
225b512b67 [composer] make doctrine dbal and orm recommended by doctrine-bridge 2011-10-15 16:56:23 +02:00
Igor Wiedler
03bdac04ae [composer] make twig-bundle require twig-bridge 2011-10-15 16:56:13 +02:00
Igor Wiedler
575771380b [composer] add doctrine and twig dependencies 2011-10-15 16:55:54 +02:00
Fabien Potencier
fe04e7fbc4 merged branch lsmith77/registry_interface_tweak (PR #2397)
Commits
-------

41ab1f7 updated RegistryInterface for https://github.com/doctrine/common/pull/68

Discussion
----------

[Doctrine] updated RegistryInterface

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

We tweaked the ManagerRegistry interface in https://github.com/doctrine/common/pull/68
So this PR just fixes the RegistryInterface as the PR was merged
2011-10-15 12:28:44 +02:00
Lukas Kahwe Smith
41ab1f78f7 updated RegistryInterface for https://github.com/doctrine/common/pull/68 2011-10-15 11:26:58 +02:00
Fabien Potencier
6b3c7ac62d Merge branch '2.0'
* 2.0:
  [Doctrine] GH-1635 - UniqueValidator now works with associations
2011-10-15 11:07:39 +02:00
Benjamin Eberlei
9d8046e407 [Doctrine] GH-1635 - UniqueValidator now works with associations 2011-10-15 09:20:06 +02:00
Fabien Potencier
3ca1ccbf67 [DoctrineBridge] removed the Xml and Yaml driver as they are now part of Doctrine 2011-10-15 04:25:55 +02:00
Fabien Potencier
ec45893c2d merged branch lsmith77/ManagerRegistry (PR #2244)
Commits
-------

dc5772d use ORM master
4364463 use doctrine-common master
55b572d fixed getting the alias for a namespace
2b89e15 use getObjectNamespace() in getEntityNamespace()
0217a0e updated base class name
e8f3c21 updated vendors to point to lsmith77's fork of doctrine-common until its merged
6e87d01 fix tests
13c2f33 added a default implementation of the ManagerRegistry integrating the container

Discussion
----------

[Doctrine] added a default implementation of the ManagerRegistry

Bug fix: no
Feature addition: yes
Backwards compatibility break: yes (minor change in the interface see below)
Symfony2 tests pass: yes
Fixes the following tickets: -

added a default implementation of the ManagerRegistry integrating the container

attempted to maintain BC as good as possible, but RegistryInterface::getRepository() had to be dropped from RegistryInterface. Its still part of the ManagerRegistry, so its only a BC break for people using RegistryInterface to create their own implementation as I ran into https://bugs.php.net/bug.php?id=43200

all implementation (ORM/ODM) will need to match the changes to the ClassMetadataFactory interface

ORM, PHPCR, CouchDB have been upgraded already.
The Bundles also need to be updated. ORM is covered with this PR, I have a PR ready for PHPCR:
https://github.com/symfony-cmf/symfony-cmf/pull/108

also note that before merging the change to vendors.php needs to be fixed to point to the right repo again

For MongoDB it currently does not yet have a registry and I can take care of CouchDB once this is all merged.

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

by lsmith77 at 2011/09/23 00:40:07 -0700

still a few failing tests and details still need to be discussed ..

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

by lsmith77 at 2011/09/23 00:53:23 -0700

ok .. tests are passing now

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

by lsmith77 at 2011/10/11 10:27:52 -0700

ok Doctrine/ORM updates are done .. PR updated .. ready to be merged.
2011-10-15 03:38:50 +02:00
Fabien Potencier
6664e1d95f merged branch schmittjoh/interBundleExtensibility (PR #2349)
Commits
-------

1b57727 removed unused use statements
fd67c78 updated implementation to re-use the existing build() method
59e2e97 improves extensibility between bundles

Discussion
----------

[RFC] Improving extensibility between bundles

This is a quick draft for improving extensibility between different bundles.

The idea behind this is that an extension can provide configurable settings that other bundles can change.

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

by Seldaek at 2011/10/07 13:28:13 -0700

I am not yet sure what I would use it for, but I like the idea.

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

by lsmith77 at 2011/10/07 13:45:19 -0700

can you show a bit more how to use this?

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

by lsmith77 at 2011/10/07 13:47:38 -0700

oh it appears this is an example?

f4e76640a0 (diff-9)

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

by schmittjoh at 2011/10/07 13:57:00 -0700

yes

On Fri, Oct 7, 2011 at 10:47 PM, Lukas Kahwe Smith <
reply@reply.github.com>wrote:

> oh it appears this is an example?
>
>
> f4e76640a0 (diff-9)
>
> --
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/2349#issuecomment-2328078
>

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

by schmittjoh at 2011/10/11 01:11:39 -0700

@fabpot, do you have an opinion on this, 👍 👎?
2011-10-15 03:26:46 +02:00
Fabien Potencier
3bbb6e5993 merged branch hhamon/type_validator_fix (PR #2379)
Commits
-------

73312ab [Validator] The Type constraint now accepts the "Boolean" type instead of "boolean".

Discussion
----------

[Validator] The Type constraint now accepts the "Boolean" type instead of

[Validator] The Type constraint now accepts the "Boolean" type instead of "boolean".

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

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

by stloyd at 2011/10/11 03:43:24 -0700

As this is bugfix only, this should be made againts __2.0__ branch.

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

by hhamon at 2011/10/11 05:03:52 -0700

@stloyd I don't really know if it's a bug fix or an improvement. We could not use "Boolean" but we could use "boolean" or "bool" only. So that's why I just improved this constraint validator.
2011-10-15 03:12:16 +02:00
Fabien Potencier
4b476c3617 Merge branch '2.0'
* 2.0:
  [BrowserKit] fixed cookie updates from Response (the URI here is not the base URI, so it should not be used to determine the default values missing in the cookie, closes #2309)
2011-10-15 02:32:29 +02:00
Fabien Potencier
3426c8390c [BrowserKit] fixed cookie updates from Response (the URI here is not the base URI, so it should not be used to determine the default values missing in the cookie, closes #2309) 2011-10-15 02:32:15 +02:00
Danny Berger
dabff0e4d5 [Security] Support removing tokens from a session. 2011-10-14 20:27:53 -04:00
Fabien Potencier
5b69dae9c8 [HttpKernel] fixed profiler file storage for children 2011-10-15 01:52:05 +02:00
Fabien Potencier
cc76da1144 [HttpKernel] fixed file profile storage when trying to read an empty token 2011-10-15 01:49:28 +02:00
Fabien Potencier
7816290f3f Merge branch '2.0'
* 2.0:
  [HttpKernel] fixed profile saving when it has children
2011-10-15 01:46:43 +02:00
Fabien Potencier
c0f5b8a3b6 [HttpKernel] fixed profile saving when it has children 2011-10-15 01:46:19 +02:00
Fabien Potencier
4dc5953100 merged 2.0 2011-10-15 00:56:57 +02:00
Fabien Potencier
3d7510e921 [HttpKernel] fixed missing init for Profile children property 2011-10-15 00:56:18 +02:00
Fabien Potencier
d35fb9ff70 merged branch alexandresalome/file-storage-children-fix (PR #2368)
Commits
-------

ba6bd4b [HttpKernel] Fix the FileProfileStorage, according to the tests
1654473 [HttpKernel] Create a test to outline the problem with file storage

Discussion
----------

[HttpKernel] Fix the file storage

The file storage was not correctly fetching children back.

* First the test showing the problem
* Second the fix to the test

Solution is to add a file for each stored profile file, containing the list of children tokens.
2011-10-15 00:48:58 +02:00
Chris Smith
00cbd39813 [BrowserKit] Fixed cookie expiry discard when attribute contains capitals 2011-10-14 20:23:34 +01:00
Fabien Potencier
89295b8d02 [Translation] made the MessageSelector constructor argument for Translator optional (using a custom one is pretty rare) 2011-10-13 15:34:34 +02:00
Miha Vrhovnik
090711183d session data needs to be encoded because it can contain non binary safe
characters e.g null. Fixes #2067
2011-10-12 10:35:39 +02:00
Miha Vrhovnik
edfa29b01b session data needs to be encoded because it can contain non binary safe
characters e.g null. Fixes #2067
2011-10-11 21:42:38 +02:00
Fabien Potencier
c00ba4dab8 [Console] fixed typo (closes #2358) 2011-10-11 12:56:40 +02:00
Fabien Potencier
d01b29e9f6 [FrameworkBundle] added some unit tests 2011-10-11 12:54:11 +02:00
Hugo Hamon
73312ab5e9 [Validator] The Type constraint now accepts the "Boolean" type instead of "boolean".
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
2011-10-11 12:27:45 +02:00
Christophe Coevoet
a2cf023da1 [FrameworkBundle] Added the translation domain 2011-10-10 18:25:45 +02:00
Christophe Coevoet
3aa75828b0 [TwigBridge] Added the translation domain 2011-10-10 18:08:37 +02:00
Christophe Coevoet
6e4269f9eb [Form] Added the ability to specify the translation domain 2011-10-10 17:58:32 +02:00
Fabien Potencier
ca2962ee6f merged branch tigranazatyan/master (PR #2370)
Commits
-------

249164d fixed typos
f4b7805 Edited src/Symfony/Bundle/FrameworkBundle/Resources/translations/validators.hy.xliff via GitHub
4cc1ed0 Edited src/Symfony/Bundle/FrameworkBundle/Resources/translations/validators.hy.xliff via GitHub
6a23e5f fixed typos
5b9d92a Fixed some errors

Discussion
----------

Translation of Framework Bundle in Armenian

fixed some typos
2011-10-10 15:41:14 +02:00
Ryan Weaver
2270a4da5a [Bridge][Doctrine] Adding a catch for when a developer uses the EntityType with multiple=false but on a "hasMany" relationship
Without this, the exception is eventually thrown in EntityChoiceList::getIdentifierValues() with a very a message that doesn't really suit the real error: "Entities passed to the choice field must be managed"
2011-10-10 08:26:22 -05:00
Fabien Potencier
beda03ba96 updated all HttpKernel event listeners to implement EventSubscriberInterface 2011-10-10 14:54:49 +02:00
Fabien Potencier
38fb43c5f5 [FrameworkBundle] fixed wrong class name 2011-10-10 14:41:48 +02:00
Fabien Potencier
7a89d34872 [HttpKernel] made RouterListener implement EventSubscriberInterface 2011-10-10 14:30:15 +02:00
Fabien Potencier
4539e5c554 moved configuration of the default HTTP and HTTPS ports from RouterListener to RequestContext 2011-10-10 13:24:45 +02:00
Fabien Potencier
658722b2eb moved some logic from HttpKernel to Routing (make it reusable) 2011-10-10 13:07:36 +02:00
Fabien Potencier
8f15794274 moved LocaleListener and RouterListener to the HttpKernel component 2011-10-10 13:03:55 +02:00
Tigran Azatyan
249164d9b2 fixed typos 2011-10-10 14:44:40 +06:00
Tigran Azatyan
f4b78051fc Edited src/Symfony/Bundle/FrameworkBundle/Resources/translations/validators.hy.xliff via GitHub 2011-10-10 14:42:02 +06:00
Tigran Azatyan
4cc1ed004c Edited src/Symfony/Bundle/FrameworkBundle/Resources/translations/validators.hy.xliff via GitHub 2011-10-10 14:29:06 +06:00
Tigran Azatyan
6a23e5fabf fixed typos 2011-10-10 14:27:36 +06:00
alexandresalome
ba6bd4b221 [HttpKernel] Fix the FileProfileStorage, according to the tests 2011-10-09 22:45:55 +02:00
Lukas Kahwe Smith
d3f137b9c1 cosmetic tweak 2011-10-09 16:09:22 +02:00
Lukas Kahwe Smith
28778834c7 anything in front of ;q= is part of the mime type, anything after may be ignored
see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1
2011-10-09 12:58:45 +02:00
Tigran Azatyan
5b9d92ae62 Fixed some errors 2011-10-09 16:45:31 +06:00
Fabien Potencier
a1adef7fd1 merged branch tigranazatyan/master (PR #2361)
Commits
-------

f49bbb7 updated
319fd9c Updated the file
0dc8c3f Edited src/Symfony/Bundle/FrameworkBundle/Resources/translations/validators.hy.xliff via GitHub
25d7596 Added 42-48 messages to Armenian translation

Discussion
----------

Armenian Translation (new)

updated armenian translation file for Framework Bundle
2011-10-09 08:37:44 +02:00
Alessio
dd0d6fd15b fixing italian messages 2011-10-09 02:40:44 +03:00
Tigran Azatyan
f49bbb7498 updated 2011-10-09 04:04:49 +06:00
Tigran Azatyan
319fd9ced3 Updated the file 2011-10-09 04:02:26 +06:00
Tigran Azatyan
0dc8c3f536 Edited src/Symfony/Bundle/FrameworkBundle/Resources/translations/validators.hy.xliff via GitHub 2011-10-09 03:20:20 +06:00
Tigran Azatyan
25d7596407 Added 42-48 messages to Armenian translation 2011-10-09 03:19:37 +06:00
Fabien Potencier
a8faa83708 merged 2.0 2011-10-08 22:58:00 +02:00
Tigran Azatyan
d2d849cf60 First 2011-10-08 22:57:17 +02:00
Fabien Potencier
36f619b57d merged branch tigranazatyan/master (PR #2359)
Commits
-------

05663ec First

Discussion
----------

Armenian Translation

I added armenian translation to Framework Bundle Validators

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

by stof at 2011/10/08 13:48:31 -0700

Can you do a PR based on the 2.0 branch instead ?

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

by tigranazatyan at 2011/10/08 13:51:03 -0700

I do not have skills using github, please do it yourself:)
2011-10-08 22:56:09 +02:00
Tigran Azatyan
05663ec527 First 2011-10-09 01:07:53 +05:00
Fabien Potencier
74bc699b27 moved management of the locale from the Session class to the Request class
The locale management does not require sessions anymore.

In the Symfony2 spirit, the locale should be part of your URLs. If this is the case
(via the special _locale request attribute), Symfony will store it in the request
(getLocale()).

This feature is now also configurable/replaceable at will as everything is now managed
by the new LocaleListener event listener.

How to upgrade:

The default locale configuration has been moved from session to the main configuration:

Before:

framework:
    session:
        default_locale: en

After:

framework:
    default_locale: en

Whenever you want to get the current locale, call getLocale() on the request (was on the
session before).
2011-10-08 18:34:49 +02:00
Christian Raue
2e5869db00 fixed "using $this when not in object context" error for 2.0 branch (replaces #2353) 2011-10-08 14:05:33 +02:00
Johannes Schmitt
1b577277ec removed unused use statements 2011-10-08 07:09:31 +02:00
Johannes Schmitt
fd67c784dd updated implementation to re-use the existing build() method 2011-10-08 07:07:38 +02:00
Johannes Schmitt
59e2e97055 improves extensibility between bundles 2011-10-07 21:41:07 +02:00
stealth35
ae0685a314 [Translation] Loader should only load local files 2011-10-07 18:30:56 +02:00
Fabien Potencier
b25a8767ad merged branch schmittjoh/dbalSessionStorage (PR #2182)
Commits
-------

3f8e8c9 fixes a session max lifetime handling
3abb7f3 fixed some conflicts with garbage collection
a1888b2 added a dbal session storage

Discussion
----------

Dbal session storage

Adds a session storage based on Doctrine DBAL.

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

by lsmith77 at 2011/09/14 13:39:28 -0700

guess it would be nice to then provide a service inside the DoctrineBundle that reuses a global DoctrineDBAL connection, guess the connection to use would then need to be configured via the doctrine app config.

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

by schmittjoh at 2011/09/14 13:42:34 -0700

I haven't found a sane way to provide automatic configuration that's why I left this to the user to implement. It's also relatively easy:

```yml
services:
    dbal_session_storage:
        class: Symfony\Bridge\Doctrine\HttpFoundation\DbalSessionStorage
        arguments: [@database_connection]

framework:
    session: { storage_id: dbal_session_storage }

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

by stof at 2011/09/14 13:57:48 -0700

@lsmith77 There is an issue about reusing another DBAL connection: if the transaction is aborted by the ORM, the session could be aborted too as you cannot have 2 independent transactions AFAIK

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

by lsmith77 at 2011/09/14 13:59:57 -0700

not sure how this is relevant. i mean why does the transaction need to be left open? just begin, write, commit ..

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

by stof at 2011/09/14 14:02:39 -0700

and what if the transaction of the ORM is still opened (let's say you use SimpleThingsTransactionalBundle) ?

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

by lsmith77 at 2011/09/14 14:06:12 -0700

well thats a bit of an edge case imho. also i wonder if SimpleThingsTransactionalBundle shouldn't make sure that its transaction is closed before the session is written.

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

by schmittjoh at 2011/09/14 14:06:56 -0700

It closes them.

On Wed, Sep 14, 2011 at 11:06 PM, Lukas Kahwe Smith <
reply@reply.github.com>wrote:

> well thats a bit of an edge case imho. also i wonder if
> SimpleThingsTransactionalBundle shouldn't make sure that its transaction is
> closed before the session is written.
>
> --
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/2182#issuecomment-2098100
>

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

by stof at 2011/09/14 14:15:02 -0700

@schmittjoh Does it close them **before** writing the session ?

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

by schmittjoh at 2011/09/14 14:44:15 -0700

I think either commit, or rollback is called, but @beberlei can probably answer that better.

Anyway, it is not really related to this PR because it is up to the user which connection is used.

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

by stof at 2011/09/14 14:58:48 -0700

I know that one of them is called. But if they are called after the session is persisted to the DB, a rollback is an issue as it will rollback the session persistence as well.
The PR is indeed fine. What need to be changed is the doc about how to use it, to advocate using a separate connection instead of the default one (which is used in your example)

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

by schmittjoh at 2011/09/15 02:57:34 -0700

There is no doc yet, but lets see what @fabpot thinks of all of this first.

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

by fabpot at 2011/09/15 04:57:57 -0700

Any benefits over using the PDO session storage?

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

by lsmith77 at 2011/09/15 05:00:50 -0700

cleaner code, potentially better support for niche RDBMS, centralized logging and finally afaik DoctrineDBAL has emulation for nested transactions.

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

by schmittjoh at 2011/09/15 05:11:00 -0700

The benefits (for me) are:

- logging queries
- better interoperability with existing build processes (migrations)
- better database interoperability
- re-using existing connection (I don't have the problem that Stof mentioned above)

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

by beberlei at 2011/09/15 06:18:22 -0700

The nested transactions is the problem here as @stof already said. If you reuse the default connection and use nested transactions that fail then this will make your session not save. That is why the docs should recommend you create a second connection for a dbal based session storage, even if it is using the same database. The PDO session storage would be a second connection besides DBAL aswell.

I like the migrations/schema hook though to create the table automatically through schema commands.

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

by fabpot at 2011/09/15 10:45:31 -0700

ok, looks good to me. Can you add some documentation about its usage (like the possible keys for options)? Is it possible to add some tests too?

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

by jdreesen at 2011/09/22 06:34:11 -0700

why did you close this?

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

by schmittjoh at 2011/09/30 06:26:12 -0700

I can't put more time into this PR, however I'm using it for some time already, and there shouldn't be any major issues as it is basically copy/paste from the PDO session.
2011-10-07 14:11:24 +02:00
Fabien Potencier
50c47aa687 merged branch stloyd/form_texttypes (PR #2343)
Commits
-------

8bd0e42 [Form] Use proper parent (text) for EmailType and TextareaType

Discussion
----------

[2.0][Form] Use proper parent (text) for EmailType and TextareaType

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
2011-10-07 14:07:29 +02:00
Fabien Potencier
f22566ca19 merged branch stloyd/ScalarTransformer (PR #2341)
Commits
-------

95049ef [Form] Added type check to `ScalarToChoiceTransformer`

Discussion
----------

[2.0][Form] Added type check to ScalarToChoiceTransformer

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
2011-10-07 14:06:24 +02:00