Commit Graph

7294 Commits

Author SHA1 Message Date
Fabien Potencier
56f7626632 updated CHANGELOG for 2.1 2011-11-09 22:02:31 +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
Fabien Potencier
ad6ffea225 updated CHANGELOG for 2.1 2011-11-09 21:55:11 +01:00
Fabien Potencier
df88070e76 merged branch stealth35/patch-14 (PR #2581)
Commits
-------

796c6b2 [Locale] add getIcuVersion and getIcuDataVersion to Locale

Discussion
----------

[Locale] add getIcuVersion and getIcuDataVersion to Locale

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

by stealth35 at 2011/11/09 00:51:30 -0800

@stof thank for your review
2011-11-09 21:53:59 +01:00
Christophe Coevoet
d974a4a465 Merge pull request #4 from stealth35/test_mo_loader
[Translation] fix gettext tests
2011-11-09 03:13:48 -08:00
stealth35
cf05646cc7 delete useless tests 2011-11-09 12:11:16 +01:00
stealth35
19f9de9e8f [Translation] fix gettext tests 2011-11-09 12:08:40 +01:00
Christophe Coevoet
965f2bf4d2 Merge pull request #3 from stealth35/test_mo_loader
[Translation] add Mo loader tests
2011-11-09 02:22:12 -08:00
stealth35
9c2a26db12 [Translation] add Mo loader tests 2011-11-09 10:13:06 +01:00
stealth35
796c6b2f8d [Locale] add getIcuVersion and getIcuDataVersion to Locale 2011-11-09 09:50:22 +01:00
Fabien Potencier
c3fc52ef82 merged branch mrtorrent/patch-1 (PR #2582)
Commits
-------

0e7540b Fix typo in changelog

Discussion
----------

Fix typo in changelog

Minor typo fix
2011-11-08 23:03:52 +01:00
Miquel Rodríguez Telep
0e7540b080 Fix typo in changelog 2011-11-08 18:00:05 +00:00
Fabien Potencier
679bf5320a updated CHANGELOG for 2.1 2011-11-08 09:06:23 +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
414d4be7e8 [Doctrine] refactored unit tests 2011-11-08 08:23:31 +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
Fabien Potencier
023a10ca3b merged branch jmikola/2.0-HttpUtils (PR #2576)
Commits
-------

57b7daf [Security] Fix checkRequestPath doc; closes #2323

Discussion
----------

[Security] Fix checkRequestPath doc; closes #2323
2011-11-08 07:41:05 +01:00
Eric Clemmons
7346896129 Changed Serialized#supportsNormalization to PRIVATE 2011-11-07 19:25:58 -08:00
Eric Clemmons
e851efc8d6 Updated SerializerTest with "normalizeTraversable" & "testNormalizeGivesPriorityToInterfaceOverTraversable" 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
a594840c47 updated CHANGELOG for 2.1 2011-11-07 23:28:28 +01: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
d08ec5e55f Add DelegatingValidator tests 2011-11-07 22:48:01 +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
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
Fabien Potencier
cd7fa4277d merged branch dbu/doc-webtestcase (PR #2565)
Commits
-------

957690c fixing WebTastCase when kernel is not found and improving exception message

Discussion
----------

fixing WebTastCase when kernel is not found and improving exception message

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

this time against 2.0 and with the link to the symfony book. replaces #2418

(i hope you merge 2.0 into master as well?)

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

by meonkeys at 2011/11/04 10:37:43 -0700

Why is this closed? (I was expecting to see it merged to 2.0)

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

by dbu at 2011/11/04 10:45:05 -0700

this request is not closed, only the referenced  #2418
github could work a bit on the layout though, looks confusing...

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

by meonkeys at 2011/11/04 10:46:56 -0700

Whoops, yep. And I should have read that more closely.
2011-11-05 07:54:53 +01:00
dbu
957690cc2c fixing WebTastCase when kernel is not found and improving exception message 2011-11-04 18:29:15 +01:00