Commit Graph

6963 Commits

Author SHA1 Message Date
Lukas Kahwe Smith
078f7f3ecd more typo fixes 2011-12-11 20:03:01 +01:00
Lukas Kahwe Smith
c3a711d3f2 abstract class children should also implement dernormalization 2011-12-11 20:03:01 +01:00
Lukas Kahwe Smith
2a6741c288 typo fix 2011-12-11 20:03:01 +01:00
Lukas Kahwe Smith
d021dc82a7 refactored encoder handling to use the supports*() methods to determine which encoder handles what format 2011-12-11 20:03:00 +01:00
Lukas Kahwe Smith
f8e2787224 refactored Normalizer interfaces 2011-12-11 20:03:00 +01:00
Lukas Kahwe Smith
58bd0f5822 refactored the EncoderInterface 2011-12-11 20:03:00 +01:00
Lukas Kahwe Smith
b0daf3516f split off an EncoderInterface and NormalizerInterface from SerializerInterface 2011-12-11 20:03:00 +01:00
Bart van den Burg
45bba7b7be Added a hint about a possible cause for why no mime type guesser is be available 2011-12-11 19:59:22 +01:00
Fabien Potencier
7ff6f6b3fd merged branch vicb/TemplateLocator/exception-message (PR #2804)
Commits
-------

db2d773 [FrameworkBundle] Improve the TemplateLocator exception message

Discussion
----------

Template locator/exception message

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

Improve the error message to include the error message from the File Locator which is more accurate : the File Locator might also look in some fallback folder(s) (i.e.  `%kernel.root_dir%/Resources`)
2011-12-11 18:52:47 +01:00
Fabien Potencier
fd12796673 merged 2.0 2011-12-11 18:50:50 +01:00
Fabien Potencier
4bdef75618 merged branch dantleech/filesystem-sprintf-typo-1 (PR #2831)
Commits
-------

84bb6bc [Filesystem] Sprintf typo in exception

Discussion
----------

[Filesystem] Sprintf typo in exception

Bug fix: [yes]
Feature addition: [no]
Backwards compatibility break: [no]
2011-12-11 18:42:00 +01:00
Fabien Potencier
a85f3c8e70 merged branch pulse00/2.0 (PR #2832)
Commits
-------

40e5b60 [FrameworkBundle] added return type for getContainer()

Discussion
----------

added return type for getContainer()

IDE type inference support
2011-12-11 18:41:35 +01:00
Fabien Potencier
c74f5f245c merged branch stealth35/fix_2735 (PR #2760)
Commits
-------

3759ff0 [Locale] StubNumberFormatter allow to parse 64bit number in 64bit mode

Discussion
----------

[Locale] StubNumberFormatter allow to parse 64bit number in 64bit mode

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

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

by stealth35 at 2011/12/01 06:47:32 -0800

@Seldaek should be better now

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

by stealth35 at 2011/12/02 04:22:42 -0800

@fabpot done

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

by fabpot at 2011/12/02 04:28:24 -0800

Tests do not pas for me (on a Mac):

    1) Symfony\Tests\Component\Locale\Stub\StubNumberFormatterTest::testParseTypeInt64StubWith64BitIntegerInPhp64Bit
    ->parse() TYPE_INT64 does not use true 64 bit integers, using only the 32 bit range.
    Failed asserting that 2147483648 matches expected -2147483648.

    .../tests/Symfony/Tests/Component/Locale/Stub/StubNumberFormatterTest.php:819

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

by stealth35 at 2011/12/02 04:50:20 -0800

@fabpot, could you send me the return of this code

``` php
<?php
$formatter = new \NumberFormatter('en', \NumberFormatter::DECIMAL);

$value = $formatter->parse('2,147,483,648', \NumberFormatter::TYPE_INT64);
var_dump($value);

$value = $formatter->parse('-2,147,483,649', \NumberFormatter::TYPE_INT64);
var_dump($value);
```

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

by fabpot at 2011/12/02 06:06:21 -0800

    int(-2147483648)
    int(2147483647)

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

by stealth35 at 2011/12/02 06:10:28 -0800

It's nosens, but the Stub should follow Intl ... so I fix that

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

by stealth35 at 2011/12/11 08:48:25 -0800

It's OK now
2011-12-11 18:40:34 +01:00
stealth35
3759ff0777 [Locale] StubNumberFormatter allow to parse 64bit number in 64bit mode 2011-12-11 17:45:39 +01:00
Julien DIDIER
60ebaaad70 [SecurityBundle] fix service class by adding a parameter, on twig extension 2011-12-10 19:04:22 +01:00
Robert Gruendler
40e5b609b2 [FrameworkBundle] added return type for getContainer() 2011-12-09 22:04:44 +01:00
DanSync
84bb6bce7f [Filesystem] Sprintf typo in exception
- Is "%" instead of "%s"
2011-12-09 17:49:17 +00:00
Fabien Potencier
ab0b4f3c2c bumped Symfony version to 2.0.8-DEV 2011-12-09 16:15:51 +01:00
Fabien Potencier
c22652f5d7 merged branch aboks/doctrine_data_collector (PR #2733)
Commits
-------

bb0d202 Switched sanitizeParameter() for existing varToString()-method; now always stores a string representation of each parameter
4fe4dfd Fixed vendor version mismatch in tests
28730e9 [DoctrineBridge] Added unit tests
4535abe [DoctrineBridge] Fixed attempt to serialize non-serializable values

Discussion
----------

[DoctrineBridge] Fixed attempt to serialize non-serializable values

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

The Doctrine DBAL type system does not pose any restrictions on the php-types of parameters in queries. Hence one could write a doctrine-type that uses a resource or an `\SplFileInfo` as its corresponding php-type. Parameters of these types are logged in the `DoctrineDataCollector` however, which is then serialized in the profiler. Since resources or `\SplFileInfo` variables cannot be serialized this throws an exception.

This PR fixes this problem (for known cases) by sanitizing the query parameters to only contain serializable types. The `isNotSerializable`-check surely is not complete yet, but more non-serializable classes can be added on a case-by-case basis.

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

by fabpot at 2011/12/07 07:04:43 -0800

Tests do not pass for me.

Furthermore, let's reuse what we already have in the framework (see https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/HttpKernel.php#L187 -- yes you can just copy/paster the existing code).

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

by aboks at 2011/12/09 01:41:14 -0800

@fabpot I fixed the tests (seems I had the wrong vendor versions in my copy) and reused the `varToString()`-code. This introduces a tiny BC break in the rare case that someone writes his own templates for the web profiler (the parameters returned by the data collector are now always a string; could be any type before).

After merging this PR, merging 2.0 into master would give a merge conflict and failing tests (because of the changes related to the introduction of the `ManagerRegistry` interface). To prevent this, please merge #2820 into master directly after merging this PR (so before merging 2.0 into master). After that 2.0 can be cleanly merged into master.

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

by stof at 2011/12/09 03:43:38 -0800

it is not a BC break. Using ``yaml_encode`` on a string will not break the template
2011-12-09 16:12:04 +01:00
Joseph Bielawski
5f2226807c [Profiler] Sync with master 2011-12-09 11:51:29 +01:00
stloyd
1aef4e806b Adds collecting info about request method and allowing searching by it 2011-12-09 10:53:33 +01:00
Victor Berchet
db2d773d93 [FrameworkBundle] Improve the TemplateLocator exception message 2011-12-09 10:35:15 +01:00
Arnout Boks
bb0d202250 Switched sanitizeParameter() for existing varToString()-method; now always stores a string representation of each parameter 2011-12-08 18:14:27 +01:00
Kris Wallsmith
41872cd40e [Security] added SecurityContextInterface::getUser()
This changes helps the common use case of fetching the current user and better complies with the Law of Demeter (http://en.wikipedia.org/wiki/Law_of_Demeter).

Before (still works):

    $token = $context->getToken();
    $user = $token ? $token->getUser() : null;

After:

    $user = $context->getUser();
2011-12-08 08:53:01 -08:00
Christophe Coevoet
2c3e9adcd1 [DependencyInjection] Made the reference case insensitive
The container is case insensitive so using capital letters in a reference
made it fail in some cases when checking the dependencies.
Closes #2807
2011-12-08 16:30:50 +01:00
Oscar Cubo Medina
600066eda4 [Templating] fixed 'scheme://' not detected as absolute path 2011-12-08 15:42:21 +01:00
Oscar Cubo Medina
e6f2687107 [HttpKernel] fixed 'scheme://' not detected as absolute path 2011-12-08 15:42:21 +01:00
Oscar Cubo Medina
b50ac5be36 [Config] fixed 'scheme://' not detected as absolute path
This also allows the use of configuration files stored in phar files.
2011-12-08 15:42:21 +01:00
Fabien Potencier
4730f4303b merged 2.0 2011-12-08 15:36:57 +01:00
Fabien Potencier
848f87504d updated VERSION for 2.0.7 2011-12-08 15:17:21 +01:00
Fabien Potencier
2134909468 fixed doctrine/common requirements 2011-12-08 15:17:21 +01:00
Jordi Boggiano
18821612bf Adjust doctrine requirements 2011-12-08 15:17:20 +01:00
Jordi Boggiano
1aea0733c4 Adjust composer files to strictly require known to work packages 2011-12-08 15:17:20 +01:00
Alexander
6c69592ab2 [FrameworkBundle] Remove unused variable in TemplateLocator 2011-12-08 09:01:07 +01:00
Fabien Potencier
b33dd284dc [WebProfilerBundle] changed memory display in the WDT to MB instead of KB 2011-12-08 08:34:30 +01:00
Fabien Potencier
ebc84a76eb fixed tests 2011-12-08 08:28:11 +01:00
Fabien Potencier
4af475bb1d [FrameworkBundle] fixed previous commit 2011-12-08 08:13:12 +01:00
Fabien Potencier
2cb6260d07 changed the default XLIFF extension to .xlf instead of .xliff (this is BC and .xliff files are still valid) 2011-12-07 22:39:27 +01:00
Fabien Potencier
b7fd5198ec [Security] fixed cast 2011-12-07 20:44:38 +01:00
Fabien Potencier
acbbe8ac7f [Process] introduced usage of PHP_BINARY (available as of PHP 5.4) 2011-12-07 19:32:30 +01:00
Fabien Potencier
43a6aa9db2 merged branch Seldaek/cookiefix (PR #2698)
Commits
-------

e06cea9 [HttpFoundation] Cookie values should not be restricted

Discussion
----------

[HttpFoundation] Cookie values should not be restricted

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

The restriction I removed makes no sense IMO because we do not use setrawcookie() to send cookies. setrawcookie() does throw a warning when the cookie value contains incorrect characters, but not setcookie(). The latter will just urlencode() the value so it becomes valid. This is also what is done by `Cookie::__toString`, so this could be used in combination with header() to just send raw cookies that are valid, even with values that are invalid in their decoded form.

PHP urldecodes cookies on input, so it all works fine.
2011-12-07 16:37:58 +01:00
meze
03ed770d35 [Validator] The current class isn't set in execution context when doing validateProperty() 2011-12-07 16:20:32 +01:00
Fabien Potencier
7e9d53bc93 merged branch beberlei/DoctrineUniqueValidator (PR #2724)
Commits
-------

59397cf [DoctrineBridge] Generalize EntityValidator to work with any validation service and against any Common ClassMetadata provider

Discussion
----------

[DoctrineBridge] Generalize EntityValidator to work with any validation ...

...service and against any Common ClassMetadata provider. Also decoupled the Bridge from its implicit dependency on the "doctrine.orm.vaildator.unique" service.

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: no
2011-12-07 16:09:48 +01:00
Fabien Potencier
492812b271 merged branch kriswallsmith/security/invalid-user-provider (PR #2789)
Commits
-------

70e9332 added check for invalid user providers

Discussion
----------

[security] added check for invalid user providers

I've added an exception if an invalid user provider is passed into a context listener.

The FOSFacebookBundle configuration has been documented wrong for a long time. This exception prevent users from configuring the security layer incorrectly.

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

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

by fabpot at 2011/12/06 00:40:08 -0800

What about doing that in the 2.0 branch?

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

by kriswallsmith at 2011/12/06 03:23:59 -0800

It is possible it will break some applications -- a non-user provider that is not first in the array may never be called.
2011-12-07 08:03:46 +01:00
vagrant
9f4391f9a1 [HttpKernel] fixed DocBlocks 2011-12-06 11:38:33 -08:00
vagrant
2a61714df6 [HttpKernel] added PostResponseEvent dispatching to HttpKernel 2011-12-06 11:18:45 -08:00
vagrant
915f440cad [HttpKernel] removed BC breaks, introduced new TerminableInterface 2011-12-06 10:41:41 -08:00
Jordi Boggiano
7efe4bcb87 [HttpKernel] Add Kernel::terminate() and HttpKernel::terminate() for post-response logic 2011-12-06 11:09:36 +01:00
Fabien Potencier
7e2ca4ad93 merged branch jmikola/master-DependencyInjectionExceptions (PR #2786)
Commits
-------

da0773c Note DependencyInjection exception changes in the 2.1 changelog
9a090bc [DependencyInjection] Fix class check and failure message in PhpDumper test
2334596 [DependencyInjection] Use component's SPL classes in dumped service container
3c02ea2 [DependencyInjection] Use exception class for API doc generation
47256ea [DependencyInjection] Make exceptions consistent when ContainerBuilder is frozen
b7300d2 [DependencyInjection] Fix up @throws documentation
123f514 [DependencyInjection] Use component-specific SPL exceptions
cf2ca9b [DependencyInjection] Create additional SPL exceptions
ba8322e [DependencyInjection] Format base exception classes consistently

Discussion
----------

[DependencyInjection] Refactor usage of SPL exceptions

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

This was something discussed on the mailing list recently and a topic at the last IRC meeting. The DependencyInjection component was what I had in mind while discussing this with @lsmith a few weeks ago, as I found that it already had some local SPL exceptions, which weren't being used directly (only as base classes for the compiler exceptions). This PR replaces uses of core SPL exceptions with the component's equivalents. I've listed it as BC-breaking to be safe, but I don't think it should cause any trouble, since the new exceptions are sub-classes of those originally used.

I purposely avoided changing the exceptions in the dumped PHP container. If we agree that's worth doing, it would be a trivial addition to the PR.

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

by jmikola at 2011/12/04 22:38:47 -0800

One question I came across while implementing this PR: the doc blocks in ContainerInterface reference InvalidArgumentException (actually the component's local SPL equivalent), but there is no practical need for that class to be used in the file. How will the API doc generator handle this? Do we need to change the doc block reference to the full class path?

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

by fabpot at 2011/12/05 01:20:31 -0800

Why have you not replaced the exception in the dumped container code? I don't see any drawback.

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

by stof at 2011/12/05 03:39:25 -0800

it would even be better to be consistent in the generated code

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

by jmikola at 2011/12/05 09:48:05 -0800

I'll update the exceptions in the dumped container code as well. Thanks for the feedback.

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

by jmikola at 2011/12/05 10:41:21 -0800

Ok, this should be ready to review and merge. Tests needed some updating, but they still pass.
2011-12-06 09:42:14 +01:00
Kris Wallsmith
70e93329bf added check for invalid user providers 2011-12-05 16:26:33 -08:00
Jeremy Mikola
2334596d2b [DependencyInjection] Use component's SPL classes in dumped service container 2011-12-05 10:04:50 -08:00
Jeremy Mikola
3c02ea220c [DependencyInjection] Use exception class for API doc generation
The API doc generator needs a use statement to properly reference the component's own InvalidArgumentException class.
2011-12-05 09:52:25 -08:00
Robert Gruendler
9fcea7fcfe [DoctrineBundle] added EntityManager to use statements in registry (IDE support) 2011-12-05 15:44:31 +01:00
Fabien Potencier
30262878f0 merged branch jmikola/2.0-LoaderResolverInterface (PR #2785)
Commits
-------

7c1cbb9 [Config] Use LoaderResolverInterface for type-hinting
48b084e fixed typo
8ad94fb merged branch hhamon/doctrine_bridge_cs (PR #2775)
240796e [Bridge] [Doctrine] fixed coding conventions.
7cfc392 check for session before trying to authentication details
648fae7 merged branch proofek/domcrawlerform-radiodisabled (PR #2768)
3976b7a [DoctrineBridge] fixed CS
9a04783 merged branch beberlei/SecurityEntityRepositoryIdentifierFix (PR #2765)
3c83b89 [DoctrineBridge] Catch user-error when the identifier is not serialized with the User entity.
36c7d03 Fixed GH-2720 - Fix disabled atrribute handling for radio form elements

Discussion
----------

[Config] Use LoaderResolverInterface for type-hinting

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

I've listed this as a BC break because we're changing the argument type-hint, but I think it's unlikely to affect anyone.
2011-12-05 10:21:19 +01:00
Jeremy Mikola
47256ea76f [DependencyInjection] Make exceptions consistent when ContainerBuilder is frozen
Some methods previously threw LogicExceptions when the ContainerBuilder was frozen. Using BadMethodCallException (a descendant of LogicException) in all cases improves consistency and preserves BC.
2011-12-04 22:21:11 -08:00
Jeremy Mikola
b7300d2e07 [DependencyInjection] Fix up @throws documentation 2011-12-04 22:21:11 -08:00
Jeremy Mikola
123f514e06 [DependencyInjection] Use component-specific SPL exceptions
This replaces existing use of core SPL exceptions with the equivalent classes defined within the component. Although method documentation has been changed, this change should be BC since the component-specific SPL exceptions extend their core counterpart.

This commit purposely omits any changes to the PhpDumper, which throws several core SPL exceptions.
2011-12-04 22:21:11 -08:00
Jeremy Mikola
cf2ca9b196 [DependencyInjection] Create additional SPL exceptions 2011-12-04 22:17:41 -08:00
Jeremy Mikola
ba8322e106 [DependencyInjection] Format base exception classes consistently 2011-12-04 22:17:41 -08:00
Jeremy Mikola
7c1cbb9f37 [Config] Use LoaderResolverInterface for type-hinting 2011-12-04 22:14:25 -08:00
Fabien Potencier
48b084eb85 fixed typo 2011-12-03 09:00:15 +01:00
Hugo Hamon
240796e9f3 [Bridge] [Doctrine] fixed coding conventions. 2011-12-02 23:11:12 +01:00
Matt Lehner
7cfc3923b6 check for session before trying to authentication details 2011-12-02 13:32:26 +01:00
Fabien Potencier
648fae7746 merged branch proofek/domcrawlerform-radiodisabled (PR #2768)
Commits
-------

36c7d03 Fixed GH-2720 - Fix disabled atrribute handling for radio form elements

Discussion
----------

Fixed GH-2720 - Fix disabled atrribute handling for radio form elements

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

I wasn't really sure about the correct approach. This one is very minimalistic and following the existing concept of not duplicating nodes of the same name, but only storing multiple values for the same node. If you think that should be changed, let me know. Hints appreciated.

Thanks
2011-12-02 13:26:19 +01:00
Fabien Potencier
3976b7a5ee [DoctrineBridge] fixed CS 2011-12-02 13:16:59 +01:00
Benjamin Eberlei
3c83b89c5e [DoctrineBridge] Catch user-error when the identifier is not serialized with the User entity. 2011-12-01 20:17:08 +01:00
Fabien Potencier
8a4f9ea512 merged 2.0 2011-12-01 15:45:30 +01:00
Fabien Potencier
d6f01df790 merged branch excelwebzone/dev (PR #2706)
Commits
-------

8710a13  Added example to the change log file
c9a2b49  Fixed xml encoder test script, and group `item` tags into an array
a0561e5  Replaced `item` with `*item` when parsing XML string

Discussion
----------

Replaced `item` with `*item` when parsing XML string

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

by fabpot at 2011/11/23 22:14:12 -0800

Tests do not pass:

1) Symfony\Tests\Component\Serializer\Encoder\XmlEncoderTest::testDecode
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
         'key2' => 'val'
-        'A B' => 'bar'
         'Barry' => Array (...)
+        'item' => Array (...)
     )
     'qux' => '1'
 )

.../tests/Symfony/Tests/Component/Serializer/Encoder/XmlEncoderTest.php:173

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

by fabpot at 2011/11/24 22:57:37 -0800

I don't understand the patch anymore. I don't see any use of `*item` in the code.

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

by excelwebzone at 2011/11/24 23:04:07 -0800

I run some testing and you can't use '*item' XML parser reject it. So I modified it to convert it to an array.. Look at the test script change

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

by fabpot at 2011/11/24 23:13:30 -0800

So, you probably need to change the CHANGELOG as well? You should add an example which shows a before/after example.

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

by excelwebzone at 2011/11/24 23:15:51 -0800

Yes, forgot to change that..

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

by fabpot at 2011/11/25 01:27:42 -0800

ping @Seldaek, @lsmith77

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

by Seldaek at 2011/11/25 04:16:43 -0800

There are other meta-names available in the XmlEncoder, @-something for attributes, then there is something happening with a # but I'm not quite sure what. I'm just saying, maybe *item isn't the best name, if it introduces a third metacharacter. Apart from that I'm fine with it.

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

by excelwebzone at 2011/11/25 08:45:31 -0800

Maybe we can rename it to `wildcard` instead

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

by excelwebzone at 2011/11/25 15:12:09 -0800

Any chance we can push this throw?

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

by lsmith77 at 2011/11/27 04:06:25 -0800

here is the old PR #2682
@Seldaek: i think your comment was made for an older version of the patch.

overall I am fine with the change, the Serializer component takes a fairly simple approach. it is also not designed to really produce XML or JSON cleanly from the same data. it will really only be able to output a clean API for one or the other with the same data structure.

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

by excelwebzone at 2011/12/01 06:25:24 -0800

@fabpot can we merge this change
2011-12-01 15:44:03 +01:00
Hugo Hamon
5e5050db53 [FrameworkBundle] fixed unescaped file_link_format parameter in CodeHelper that made the functional tests fail when checking a 4xx page. The generated file link format used in an HTML stack trace didn't contain an escaped ampersand (&) character. The resulting HTML code was not validable against its DTD and so the Crawler made the tests fail when checking a 4xx page. 2011-12-01 10:53:50 +01:00
Fabien Potencier
83894be6c8 merged branch pcampr/cs_translation_fix (PR #2737)
Commits
-------

0be8820 [FrameworkBundle] fixed small typo in Czech translation

Discussion
----------

[FrameworkBundle] fixed small typo in Czech translation

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

fixed small typo in Czech translation in validators.cs.xliff
2011-12-01 08:53:13 +01:00
Fabien Potencier
cc66739f3d merged branch DavidChristmann/fix_gen_entities_namespace (PR #2746)
Commits
-------

4a8f101b Fixed problem with multiple occurences of a given namespace. fix #2688

Discussion
----------

[Console] [Doctrine] Fixed: Entities are generated in wrong folder (doctrine:generate:entities Namespace)

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

Bug-description:
In our project we have some bundles from the same root-namespace "ABC" stored under "vendors/bundles/ABC" and some bundles under "src/ABC".

Running the command "$php app/console doctrine:generate:entities ABC" from the commandline generates the entities from "src/ABC/" under "vendors/bundles/ABC/" or vice versa depending on their order in the bundle array in the Appkernel.php.

The error does not occur when the entities are generated by bundlename or by classname.

Bugfix:-description:
Bugfix was to get the path for each entity class once more before generating the entities. Before the bugfix the path was taken form the first entity class of the namespace without checking if the following entities have a different path.
2011-12-01 08:48:29 +01:00
Fabien Potencier
654352f8d1 merged branch pscheit/master (PR #2742)
Commits
-------

63e2a99 [CssSelector] Fixed Issue for XPathExprOr: missing prefix in string conversion

Discussion
----------

[CssSelector] Issue for XPathExprOr: missing prefix in string conversion

Hi there,

I created a small and dumb test for the issue. I looked at the original implementation and i think the problem is, that private properties are used in the parent class for xPathExprOr. so that the prefix cannot be accessd with $this->prefix in XPathExprOr
However I think the distribution for the prefix should be put in the parts of the or-sub-expressions the way it is shown in the test.

Hope this helps.

Best regards
Philipp
2011-12-01 08:46:19 +01:00
Fabien Potencier
342def5bfe [FrameworkBundle] make the code more generic 2011-12-01 08:44:53 +01:00
Fabien Potencier
308ac83945 merged branch ericclemmons/2743-traceableeventdispatcher-closure (PR #2744)
Commits
-------

c4303f3 TraceableEventDispatcher uses 'Closure' as the StopWatch name for Closures
0b5499e TraceableEventDispatcher test for Closures

Discussion
----------

[FrameworkBundle] (PR) TraceableEventDispatcher creates NOTICE on Closures

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

Currently a `\Closure` will cause the error:

> Notice: Undefined index: class in ...\TraceableEventDispatcher`

The test will fail in the event this Notice occurs & passes when the Closure fires correctly.

**Note**: If you use error suppression (`@$dispatcher->dispatch('onFooEvent')`), then the notice does not occur (as expected) and the listener fires correctly.  This, in my opinion, is expected behavior.

If you'd like this change rebased against another branch, let me know...
2011-12-01 08:43:16 +01:00
Fabien Potencier
c35c321e54 merged branch francisbesset/form_error_message (PR #2748)
Commits
-------

9e6a10a [Form] Added FormError::getMessage() and use it in Form class

Discussion
----------

[Form] Added FormError::getMessage()

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

by ericclemmons at 2011/11/29 18:38:40 -0800

Should this go through the translator, similar to how `field_errors` renders error messages?

> https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig#L253

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

by stof at 2011/11/29 23:11:24 -0800

``getErrorsAsString`` is there for a debugging purpose so injecting the translator in the Form class just for it seems wrong. And the logic used here is exactly what the identity translator does.
2011-12-01 08:39:32 +01:00
Dariusz Górecki
769c17bb95 Throw exceptions in case someone forgot to set method name in call.
Bug fix: yes
Feature add: no
Symfony2 tests pass: yes
Symfony2 tests added: yes

In general without this exception generated by php dumper container class, will cause PHP fatal error, bacause method call will look like this: `$instance->(/* arguments*/);`.
2011-11-30 15:59:17 +01:00
Helmer Aaviksoo
0b5c4b29c2 [Form] Date, Time, DateTimeType forget translation domain 2011-11-30 10:55:10 +02:00
Francis Besset
9e6a10a60e [Form] Added FormError::getMessage() and use it in Form class 2011-11-29 18:26:32 +01:00
David Christmann
4a8f101b9d Fixed problem with multiple occurences of a given namespace. fix #2688 2011-11-29 10:03:39 +01:00
Eric Clemmons
c4303f3a30 TraceableEventDispatcher uses 'Closure' as the StopWatch name for Closures 2011-11-28 21:07:35 -08:00
Eric Clemmons
0b5499ed1a TraceableEventDispatcher test for Closures 2011-11-28 21:07:11 -08:00
pscheit
63e2a993eb [CssSelector] Fixed Issue for XPathExprOr: missing prefix in string conversion 2011-11-28 22:00:26 +01:00
Pavel Campr
0be8820d9d [FrameworkBundle] fixed small typo in Czech translation 2011-11-27 20:15:26 +01:00
Fabien Potencier
f7fb34ad35 merged branch drak/stopwatch (PR #2734)
Commits
-------

97dd2cc [HttpKernel] Removed unused property.

Discussion
----------

[HttpKernel] Removed unused property.

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

Cleaned up unused property.
2011-11-27 15:03:55 +01:00
Fabien Potencier
9824c3aadf merged branch Seldaek/composerjson (PR #2719)
Commits
-------

6d5b296 Adjust doctrine requirements
628cce1 Adjust composer files to strictly require known to work packages

Discussion
----------

Adjust composer files to strictly require known to work packages

I also bumped doctrine common to 2.2, because it seems 2.1 doesn't have the AbstractManagerRegistry stuff that is used by symfony 2.1. Please someone correct me if this is wrong.

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

by fabpot at 2011/11/25 07:59:53 -0800

It should be done on the 2.0 branch too, no?

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

by Seldaek at 2011/11/26 16:11:25 -0800

Well as we discussed the 2.0 branch is not a priority right now, but yes if someone wants to port the changes to 2.0 it'd be good.
2011-11-27 14:51:38 +01:00
Drak
97dd2cc860 [HttpKernel] Removed unused property. 2011-11-27 19:28:03 +05:45
Arnout Boks
4535abecee [DoctrineBridge] Fixed attempt to serialize non-serializable values 2011-11-27 13:32:13 +01:00
Eric Clemmons
7a8e1b3b48 ChoiceType flattens nested Choices when expanded 2011-11-26 17:37:27 -08:00
Sebastian Marek
36c7d03040 Fixed GH-2720 - Fix disabled atrribute handling for radio form elements 2011-11-26 14:07:00 +00:00
Francis Besset
17dc605ca0 [FrameworkBundle] Checks that the template is readable before checking its modification time 2011-11-26 13:28:35 +01:00
Benjamin Eberlei
59397cf42b [DoctrineBridge] Generalize EntityValidator to work with any validation service and against any Common ClassMetadata provider 2011-11-26 11:36:09 +01:00
Jordi Boggiano
6d5b296787 Adjust doctrine requirements 2011-11-25 16:11:08 +01:00
Jordi Boggiano
628cce17e4 Adjust composer files to strictly require known to work packages 2011-11-25 15:15:14 +01:00
excelwebzone
c9a2b49eb7 Fixed xml encoder test script, and group item tags into an array 2011-11-24 09:09:38 -08:00
Fabien Potencier
1a5e0acd02 [WebProfilerBundle] added missing image for the routing in the web profiler 2011-11-24 15:58:57 +01:00
Fabien Potencier
7b1dda84b9 [HttpKernel] added unit tests for previous merge 2011-11-24 08:39:49 +01:00
Juan M Martínez
61e0bdebf8 [HttpKernel] ControllerResolver arguments reflection for Closure object.
When controller is a Closure ControllerResolver::getArguments tries to
make a ReflectionMethod of the __invoke method. But because it's an
internal function, the parameters method isDefaultValueAvailable will
return always false, even if isOptional return true.
2011-11-24 08:39:37 +01:00
Fabien Potencier
2363748ba2 merged branch canni/failed_login_event (PR #2678)
Commits
-------

09562df Update CHANGELOG for 2.1, describe new auth events
cf09c2d added authentication success/failure events

Discussion
----------

[Security] Implementation of a "failed login" event, replaces: PR #1307

As I have to use this feature I have completed its implementation.

Bugfix: no
Feature addition: yes
Symfopny2 tests pass: yes
Replaces/closes PR: #1307

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

by schmittjoh at 2011/11/18 23:57:56 -0800

Usually, this event is used for the wrong reasons (to customize what happens on authentication failure). Can you move your implementation to the AuthenticationProviderManager instead?

see https://github.com/schmittjoh/symfony/blob/master/src/Symfony/Component/Security/Core/Authentication/AuthenticationProviderManager.php#L103

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

by canni at 2011/11/19 06:00:36 -0800

Good point :) I'll not rewrite yours work, I've cherry-picked yours commits. (BTW you added call to `setEventDispatcher` on `security.authentication.manager` to commit related to some different work ;)

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

by fabpot at 2011/11/22 00:12:19 -0800

The new files are missing the LICENSE header. As far as I can see, @schmittjoh fork has a different license from the Symfony one. This needs to be clarified before I can merge this PR.

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

by schmittjoh at 2011/11/22 01:53:09 -0800

No biggy, MIT is fine here.

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

by canni at 2011/11/22 01:57:51 -0800

@fabpot done

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

by fabpot at 2011/11/22 02:22:47 -0800

@canni: Can you update the CHANGELOG file (to reference the changes and the BC breaks -- like the move of KernelEvents for instance).

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

by canni at 2011/11/22 02:40:33 -0800

@fabpot: no problem & done

PS I haven't realized that namespace change of `SecurityEvents` is actually a BC Break, thx for pointing this.

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

by fabpot at 2011/11/22 03:06:17 -0800

@canni: What about keeping a `SecurityEvents` class in the `Http` namespace that just extends the new one. That way, we don't break BC.

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

by canni at 2011/11/22 03:53:01 -0800

@fabpot: that will force us to remove `final` keyword form one of classes.

Maybe we can add new, not extending class e.g.: `GeneralSecurityEvents` or `AuthenticationEvents`, that way we dont break BC and dont introduce confusion in naming?

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

by canni at 2011/11/22 05:53:15 -0800

@fabpot: I've removed the BC break, and squashed schmittjoh commits, to keep things nice and clear.
2011-11-24 08:31:18 +01:00
Fabien Potencier
94416129a2 removed unused use statements 2011-11-24 07:17:02 +01:00
Fabien Potencier
2b5d4b90d8 merged 2.0 2011-11-24 07:16:52 +01:00
Fabien Potencier
5878490b16 removed unused use statements 2011-11-24 07:16:14 +01:00
excelwebzone
a0561e5dde Replaced item with *item when parsing XML string 2011-11-23 17:40:26 -08:00
Fabien Potencier
a7f7be2309 merged 2.0 2011-11-23 23:28:22 +01:00
Jordi Boggiano
ca974f5b4d Fix doctrine requirement 2011-11-23 18:24:40 +01:00
Jordi Boggiano
c76487ee04 Fix composer.json files to be stricter 2011-11-23 17:51:23 +01:00
Fabien Potencier
3e87fe1d56 merged branch Seldaek/composerfix2 (PR #2701)
Commits
-------

e7215ae Fix composer.json

Discussion
----------

Fix composer.json files

>=2.1 does not include the 2.1.0-dev versions, since those are lesser than 2.1.0 stable, so nothing is really working right now.
2011-11-23 16:37:09 +01:00
Jordi Boggiano
e7215aeb40 Fix composer.json 2011-11-23 16:10:32 +01:00
Jordi Boggiano
a5a867599e Fix requirement name 2011-11-23 16:04:15 +01:00
Jordi Boggiano
e06cea9aaa [HttpFoundation] Cookie values should not be restricted 2011-11-23 11:38:46 +01:00
Fabien Potencier
be09e068c0 fixed bad merge 2011-11-23 11:32:47 +01:00
Fabien Potencier
a1d12324f9 merged 2.0 2011-11-23 11:23:27 +01:00
Fabien Potencier
286ce0ea40 merged branch pulzarraider/proxy_ip_fix (PR #2695)
Commits
-------

11b6156 updated unittest
a931e21 get correct client IP from X-forwarded-for header

Discussion
----------

[HttpFoundation] Get correct client IP when using trusted proxy (Varnish)

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
Note: This is reopened PR #2686 for 2.0 branch.

If using trusted proxy (Varnish, ...) the client IP must be identified from X-Forwarded-For header. The header has de-facto standard format:

X-Forwarded-For : client1, proxy1, proxy2,

where the value is a comma+space separated list of IP addresses, the left-most being the farthest downstream client, and each successive proxy that passed the request adding the IP address where it received the request from. See: http://en.wikipedia.org/wiki/X-Forwarded-For

Function getClientIp should return only one client IP, not a list of all nonimportant IPs as it's now. Similar example can be seen in Cake framework: http://api.cakephp.org/view_source/request-handler-component/#line-477

There are many ways how to chose the first IP from X-Forwarded-For header. Any other faster and more reliable way is welcome.
2011-11-23 11:22:06 +01:00
Andrej Hudec
a931e21284 get correct client IP from X-forwarded-for header 2011-11-22 22:01:07 +01:00
Fabien Potencier
60f8525ae5 merged branch lsmith77/forward_compat (PR #2526)
Commits
-------

b6bf018 tweaked error handling for the forward compatibility
dd606b5 added note about the purpose of this class
c1426ba added locale handling forward compatibility
10eed30 added MessageDataCollector forward compatibility

Discussion
----------

Forward compat

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2522
2011-11-22 19:39:27 +01:00
Johannes Schmitt
cf09c2db55 added authentication success/failure events 2011-11-22 14:44:41 +01:00
Fabien Potencier
ec30dcb31d fixed a merge problem 2011-11-22 12:07:04 +01:00
Fabien Potencier
bb025bb904 merged branch hlecorche/valid-form-w3c (PR #2676)
Commits
-------

78e9b2f [Form] Fixed textarea_widget (W3C standards)

Discussion
----------

[Form] Fixed textarea_widget (W3C standards)

Textarea widget included the "pattern" attribute but is not valid by W3C standards.

(See PR 2666 - New PR because rebase inside the 2.0 branch)

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

by fabpot at 2011/11/18 09:01:41 -0800

@hlecorche: Thanks for your work on this issue. Can you update the unit tests to be sure that this case is covered? If you're not comfortable with this, just tell me and I will do it myself

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

by hlecorche at 2011/11/19 02:51:06 -0800

@fabpot: I did'nt commited because I am not sure. I changed the "tests/Symfony/Tests/Component/Form/AbstractLayoutTest.php" file :

    public function testTextarea()
    {
        $form = $this->factory->createNamed('textarea', 'na&me', 'foo&bar', array(
            'property_path' => 'name',
            'pattern' => 'foo',
        ));

        $this->assertWidgetMatchesXpath($form->createView(), array(),
    '/textarea
    [@name="na&me"]
    [not(@pattern)]
    [.="foo&bar"]
    '
        );
    }

Is it correct?
2011-11-22 10:25:58 +01:00
Fabien Potencier
48c0f50fa2 [Form] tweaked an exception message 2011-11-22 10:24:03 +01:00
Fabien Potencier
af2713261d merged branch canni/throw_exception_on_form_name_circulal_ref (PR #2675)
Commits
-------

36cebf0 Fix infinite loop on circullar reference in form factory

Discussion
----------

[BugFix][Form]Throw exception on form name circulal ref

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

When FormType method `getName()` returns the same value as `getParent()` we're asking about trouble, and land into infinite loop.
2011-11-22 10:21:50 +01:00
Fabien Potencier
a8fd2c4b46 merged 2.0 2011-11-22 10:13:00 +01:00
Fabien Potencier
a8e8008df3 merged branch greg0ire/patch-1 (PR #2604)
Commits
-------

5b30812 See this issue : https://github.com/symfony/symfony/issues/2433

Discussion
----------

See this issue : https://github.com/symfony/symfony/issues/2433

I changed the access speficiers to `protected`, which makes easier to extend this class if one needs to like I did.

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

by greg0ire at 2011/11/10 06:55:12 -0800

Precision on the problem I had : I wanted to use a `CollectionType` and display a collection element attribute as the label for this element. I had no choice but to extend `ResizeFormListener` and `CollectionType`.
2011-11-22 10:10:56 +01:00
Fabien Potencier
7c8d836331 merged branch willdurand/undefined-value-property-path (PR #2266)
Commits
-------

57e1aeb Fixed undefined index notice in readProperty() method (PropertyPath)

Discussion
----------

Fixed undefined index notice in readProperty() method (PropertyPath)

Hi,

For some reasons, I get `notice` errors on `readProperty()` with Propel:

    Notice: Undefined index: 0 in /Users/william/projects/Propel/testProjects/symfony2/vendor/symfony/src/Symfony/Component/Form/Util/PropertyPath.php line 284

The `PropelObjectCollection` implements `ArrayAccess`, the `readProperty()` method does not check if the given `index` exists so the `notice` error is thrown. I suppose to check whether the index exists or not has to be added.

Regards,
William

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

by fabpot at 2011/09/27 23:42:07 -0700

The patch is probably not what we want to do. First, I suppose that you are not creating the propertyPath by hand. If that is the case, we need to understand why the property path does not exist. Then, even if we might want to check the existence of the index, if it does not exist, we should probably throw an exception instead of just ignoring the problem.

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

by willdurand at 2011/09/28 01:14:49 -0700

My bad. This is a Propel bug due to `ArrayObject`. It throws a notice error if the index is not found in `offsetGet()` which is wrong according to the `ArrayAccess` interface. If the index is not found, we have to return `null`.

@fabpot Are you agree with that (for the `null` value) ?

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

by fabpot at 2011/09/28 01:17:09 -0700

My point is that it should never happen under normal circumstances.

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

by willdurand at 2011/09/28 01:23:55 -0700

@fabpot Not sure to get it.

The fact is that it tries to get the value (`getValue()`) of a fresh object, just added to the `collection` when I'm submitting a form with a `CollectionType` and a new entry in it.
I mean it tries to get this new object (not yet persisted, not yet in the collection) in the collection (`getValue()` -> `readProperty()`) which implements `ArrayAccess` but this object cannot be in the collection at this time.

Am I wrong ?

And, without this notice error thrown by Propel, I probably never opened this issue...

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

by willdurand at 2011/09/29 06:40:34 -0700

@fabpot: you can try this example: http://www.propelorm.org/cookbook/symfony2/mastering-symfony2-forms-with-propel.html#manytomany_relations in order to make your own tests. Will it be enough?
As I said, it throws a weird notice for the reasons above.

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

by jaugustin at 2011/10/04 12:58:10 -0700

any news on this ?
@fabpot did you have time to look at the test case ?

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

by cedriclombardot at 2011/11/09 14:29:42 -0800

@fabpot: can we have news about this ?
2011-11-22 09:55:47 +01:00
Fabien Potencier
9d59466599 fixed a unit test broken by previous merge 2011-11-22 09:52:29 +01:00
Drak
667c24d73d [EventDispatcher] Add name property to Events refs #2572
Should be merged/cherry-picked after #2572 closes.
2011-11-22 09:49:57 +01:00
Fabien Potencier
194f8c0739 merged branch beberlei/DoctrineValidation (PR #2535)
Commits
-------

47ebf08 Fix some bugs
fad825e Add DoctrineValidationPass to DoctrineBundle#buildContainer
a064acd Implement feature to add validations based on the Manager-Type (ORM, MongoDB, CouchDB)

Discussion
----------

[WIP] Validation on a Doctrine Manager Basis

Hello,

we have had problems before with validation that is "persistence" related. Unique-validators or any other validation that is based on services that depend on persistence.

The problem is two-fold:

1. In annotations you cannot define validators for all persistence layers you support, because then users need them all installed.
2. In XML/YAML the same is true, since there is only one validation.xml or validation.yml file looked for.

Now one solution is to have three model classes that extend from a base class to get around this (like FOSUserBundle does) but that is cumbersome. This PR provides a new solution that is Doctrine specific (and takes the responsibility out of the Core).

Each Doctrine Bundle (ORM, CouchDB, MongoDB, PHPCR) can add this compiler pass with a manager type name:

    $container->addCompilerPass(new DoctrineValidationPass('orm'));

This leads to the compiler pass searching for additional validation files "Resources/config/validation.orm.yml" and "Resources/configvalidation.orm.xml".

My first idea was to put this into the Resources/config/doctrine folder as well, but then it is detected as mapping file of course.

Regarding tests, this is not easily testable without a full fledged bundle setup, i tested this inside Acme Demo Bundle, however for a good unit-test we probably need a filesystem abstraction testing layer. Has anyone a good idea how to test this without having to setup another test-bundle? I can't use the one from DoctrineBundle since this code is in the Bridge.

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

by fabpot at 2011/11/13 23:12:06 -0800

@beberlei: Is it still WIP?

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

by beberlei at 2011/11/15 10:47:49 -0800

@fabpot it is complete, but it has no tests, that was the WIP part. :-)

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

by mvrhov at 2011/11/15 23:56:11 -0800

I wanted to refactor how validation is managed today, so it could do one validation file per class, same as with Doctrine but @stof pointed me to this PR. I still find this a great idea as the validation is easier to find.

```php
        foreach ($container->getParameter('kernel.bundles') as $bundle) {
            $reflection = new \ReflectionClass($bundle);
            $bundleDir = dirname($reflection->getFilename());

            //check for per class validation files
            if (is_dir($dir = $bundleDir . '/Resources/config/validation')) {
                $finder = new Finder();
                $finder
                    ->name('*'.$extension)
                    ->in($dir);

                foreach ($finder as $file) {
                    $files[] = realpath($file);
                    $container->addResource(new FileResource($file));
                }
            }

            //global validation file?
            if (is_file($file = $bundleDir . '/Resources/config/validation'.$extension)) {
                $files[] = realpath($file);
                $container->addResource(new FileResource($file));
            }
        }
```
2011-11-22 09:43:50 +01:00
Fabien Potencier
3dc880f02b merged branch tecbot/config_builder (PR #2542)
Commits
-------

fc4e628 [Config] added append to the node builder

Discussion
----------

[Config] added append to the node builder

Bug fix: no
Feature addition: yes
BC break: no
test pass: true

the problem is that i can only append a node if i have an array node, but if the current node is the node builder i can not append a node (and i think the node builder is like a array node).

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

by tecbot at 2011/11/16 23:23:16 -0800

@fabpot: any chance to merge this?
2011-11-22 09:42:26 +01:00
Fabien Potencier
bd5eda38fa merged branch Seldaek/eventdisp (PR #2572)
Commits
-------

fabe818 [EventDispatcher] Add reference to the EventDispatcher on the Event

Discussion
----------

[EventDispatcher] Add reference to the EventDispatcher on the Event

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

I don't like registering event listeners unless they are really used, it seems wasteful. So I tend to register listeners for the response event in other listeners, only when they will be required. @stof has [brought to my attention](fb243ace83 (commitcomment-696467)) that this may cause issues in Silex or any other situation where event listeners are not lazy loaded, since it creates a circular reference in that case.

With this PR, avoiding the circular reference is possible, without bloating the response listener with unnecessary "do I need to do anything?" code.

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

by schmittjoh at 2011/11/06 05:28:39 -0800

Did you do any benchmarks? It's just a feeling, but registering a listener at runtime might be more expensive than just having it always executed.

Also, I find these dynamic listeners a bit of a code smell. They are not easily testable, and the control flow is harder to track. Besides, you do not take into account subrequests which might happen in between.

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

by Seldaek at 2011/11/06 09:34:27 -0800

I don't see why it would be slower, if it's a commonly fired event yes you blast away the `sorted` listener cache every time you add one, but most of the time those optional listeners are for the response, which is typically not sorted yet when you add the listener, so I don't think there is any overhead.

As for the code smell, of course it's a matter of preference, but I have the opposite view on control flow, I find it weird that listeners are registered when they are not used in the end, while doing it my way I think it's more clear what happens.

For sub-requests, I'm not sure what you mean. In this instance, and in most response listeners I have seen, the sub-requests are always ignored anyway by the listener.

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

by drak at 2011/11/10 06:07:45 -0800

I don't see how loading up the dispatcher with a bunch of callables can be expensive - it's just loading an array basically.

Wouldn't it be better to have a separate `DispatcherAwareEvent extends Event`

    class DispatcherAwareEvent extends Event
    {
        protected $dispatcher;

        public function setDispatcher(EventDispatcher $dispatcher)
        {
            $this->dispatcher = $dispatcher;
        }

        public function getDispatcher()
        {
            return $this->dispatcher;
        }

This can then be used as a base class for what you need `MyEvent extends DispatcherAwareEvent`

       $event = new MyEvent($dispatcher, $foo);
       $dispatcher->dispatch($event);

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

by Seldaek at 2011/11/10 06:18:57 -0800

@drak: Every event is part the event dispatching system and therefore should be aware of the dispatcher imo. It's not like the ContainerAwareInterface which is gluing things that do not especially have to know about the DIC together.

If we do that, then we have to start arguing every time we need the dispatcher in a given event, because the original author did not think it was necessary, and then that will only make it into the next minor version, etc. Not fun at all.

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

by drak at 2011/11/10 06:36:26 -0800

By the way, the event dispatchers looks to be pretty well optimized given the fact that it only sorts listeners if they are called, and then only once.

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

by drak at 2011/11/10 12:33:28 -0800

It just seems weird.  I mean, following on, why isn't the event name a compulsory parameter also? - again, you can say both ways, if you need it, make it part of your custom Event class, or since it's a required param to be able to dispatch an event in the first place, make it part of the base Event class.  All I'm saying it it seems suspicious when it could be achieved a different way.

For example, you could inject the dispatcher into the listener itself and then the event handler could access the dispatcher if it needs:

    class MyListener
    {
        public function __construct(EventDispatcher $eventDispatcher)
        {
            //...
        }

        public function someListener(Event $event)
        {
            //...
        }
    }

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

by stof at 2011/11/10 15:20:07 -0800

@drak The issue when injecting the dispatcher in the listener is described in the issue: circular dependency: you need to create the dispatcher before the listener (as it is injected in it) and when the listener is not lazy-loaded (in Silex for instance), you need to create it before the dispatcher.

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

by drak at 2011/11/10 21:15:45 -0800

Indeed, although it might not unreasonable to expect to create the dispatcher first...  but anyway I'm convinced!

Injecting the dispatcher could lead to some __very interesting possibilities__ as standard.  While we are at it though, we should have a getter and setter for `$name` in the `Event` class and `$event->setName($eventname)` in the `dispatch()` method.  Allowing an event to know it's name is very useful.  It allows a single listener to be registered for multiple names, and even makes the event object reusable. I don't know why $name was removed, it was in the Symfony 1 dispatcher and while the new dispatcher is brilliant from an OO point of view, missing the name as standard is a big shame.

+1 from me.
2011-11-22 09:32:53 +01:00
Fabien Potencier
c73476929b merged branch stof/security_factories (PR #2668)
Commits
-------

413756c [BC break][SecurityBundle] Changed the way to register factories

Discussion
----------

[BC break][SecurityBundle] Changed the way to register factories

As discussed in #2454, this changes the way to register the factories to let each bundles register the factories it provides.
2011-11-22 09:24:57 +01:00
Fabien Potencier
98a8854c61 merged branch flevour/add-security-auth-manager-parameter (PR #2658)
Commits
-------

2adc36c [Security] renamed security option to erase_credentials
104b697 [Security] added configurable option security.erase_credentials_from_token
ede55d2 [Security] added configuration parameter for AuthorizationManagerProvider

Discussion
----------

[Security] added configuration parameter to AuthorizationManagerProvider

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

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

by fabpot at 2011/11/16 10:30:34 -0800

You should also add a configurable option under the `security` entry to ease the configurability.
2011-11-22 09:23:09 +01:00
pborreli
1fb90397c4 [FrameworkBundle] Skipping one test failing on PHP5.3.2 2011-11-22 07:40:01 +01:00
ondrowan
1dcf74ab70 Fixed small typo in phpdoc. 2011-11-21 21:11:59 +01:00
Xavier HAUSHERR
4d1e352a74 To avoid having 2 different default values for env. 2011-11-20 12:56:56 +01:00
Fabien Potencier
d59bde7585 merged branch willdurand/propel-bridge (PR #2191)
Commits
-------

5e4b7cb Renamed Propel Bridge: Propel => Propel1
cdad7ab Introducing the Propel Bridge

Discussion
----------

Introducing the Propel Bridge

Basic bridge with stable components for Propel.

This should not affect anything except the need to maintain this code (even if the most part is safe thanks to `@api` tag). As Propel future is linked to Symfony2, to maintain this bridge should not be a problem.
Don't flame me for this proposal, I do that "knowingly".

Regards,
William.

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

by stof at 2011/09/15 12:22:12 -0700

IMO, it would be better to put this code in a repo owned by the Propel organization than in the core.

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

by Richtermeister at 2011/09/15 15:33:02 -0700

Yay, great to see this, very much looking forward to using Propel again.

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

by GromNaN at 2011/09/16 01:37:53 -0700

+1 for @stof proposition.The Silex Core should stay lightweight.

Silex definitely need a site or at least a page in the doc to list all the community extensions.

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

by odino at 2011/09/16 01:39:40 -0700

Silex? :)

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

by GromNaN at 2011/09/16 01:43:20 -0700

Oups, I was looking at Silex PR and got this PR.

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

by lsmith77 at 2011/10/08 01:01:56 -0700

@willdurand we should maybe make this a topic for the next IRC meeting.

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

by willdurand at 2011/10/09 10:26:22 -0700

Agreed :)

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

by willdurand at 2011/11/03 14:18:02 -0700

Good to go ?

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

by willdurand at 2011/11/04 03:34:37 -0700

Just removed the `Query` class. /cc @Stof

Anything else?

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

by willdurand at 2011/11/05 08:45:34 -0700

@fabpot : good to merge ?

The PropelBundle has a `bridge` branch. I'm ready, I'm just waiting you merge this PR to tag the PropelBundle for Symfony 2.0, and after that I'll merge the `bridge` branch into the `master`.

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

by fabpot at 2011/11/16 22:32:42 -0800

What about renaming the directory from `Propel` to `Propel1`? That way, we will be able to have a `Propel` bridge for Propel 2.0.

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

by willdurand at 2011/11/16 23:18:56 -0800

It won't be consistent with the PropelBundle but I guess we don't have any other choice.. So I'm +1 for that.

If it's ok, I'll update this PR, just tell me.

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

by fabpot at 2011/11/17 07:09:58 -0800

yes, +1 for renaming

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

by lsmith77 at 2011/11/17 07:11:45 -0800

Why rename it to ``Propel1``? I think its enough to eventually add a ``Propel2``.

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

by willdurand at 2011/11/17 07:14:05 -0800

`Propel1` is for BC.
`Propel` will be the Propel's future :)

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

by lsmith77 at 2011/11/17 07:17:02 -0800

sounds like a bad idea .. and what happens when you come out with ``Propel3`` ?

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

by stof at 2011/11/17 07:17:31 -0800

@willdurand Maybe the bundle should renamed the same way, for consistency and to let ``PropelBundle`` for the Propel 2 one ? (but this should probably be discussed in another issue tracker)

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

by willdurand at 2011/11/17 07:30:21 -0800

That way we'll be able to handle both Propel 1 & 2 without BC break. You may want to upgrade Symfony2 but not Propel nor PropelBundle. Propel1 bridge has a limited lifetime.

@stof : the PropelBundle will be tagged and a branch will probably appear for Propel1 compatibility.

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

by stof at 2011/11/17 07:34:10 -0800

@willdurand if Symfony provides a Propel bridge using the same namespace for Propel2 and then Propel3, this means that the Sf2 update changing the bridge to use the Propel3 code will make Sf2 incompatible with Propel2 even if you have a tag for Propel2 in the PropelBundle (as you will need to downgrade Symfony to the older tag too). As long as bridges are in the main Symfony repo, they are upgraded the same time Symfony is upgraded and they can bump the requirements.

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

by willdurand at 2011/11/17 07:37:13 -0800

Yes but Propel 1 is frozen, almost dead as we won't add any new features.
Propel2 is the future and there is no plan for a Propel3 which will break BC.

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

by willdurand at 2011/11/17 07:57:05 -0800

Updated!
2011-11-19 15:01:12 +01:00
Fabien Potencier
d4f1721336 [Swiftmailer] fixed composer.json 2011-11-18 17:32:56 +01:00
Fabien Potencier
cddb706810 [Swiftmailer] fixed composer.json 2011-11-18 17:32:16 +01:00
hlecorche
78e9b2fedb [Form] Fixed textarea_widget (W3C standards) 2011-11-18 17:31:57 +01:00
Dariusz Górecki
36cebf0924 Fix infinite loop on circullar reference in form factory
When `->getName()` returns the same as `getParent()` we're going to infinite loop.
2011-11-18 14:23:22 +01:00
Fabien Potencier
3b9776aee6 merged branch rouffj/cs (PR #2671)
Commits
-------

c89d45b Fix cs

Discussion
----------

Fix cs

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

by rouffj at 2011/11/17 23:30:29 -0800

lsmith77: ok, so i revert my change only on RequestMatcher file ?
2011-11-18 12:50:14 +01:00
Fabien Potencier
5ff69e1f7c merged branch beberlei/DoctrineInfoMappingException (PR #2656)
Commits
-------

6d7e6a8 [DoctrineBundle] Enhance error reporting during mapping validation when nested exceptions occur.

Discussion
----------

Doctrine info mapping exception

Better error handling when nested exceptions occur (which is commonly possible with reflection errors).

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

by fabpot at 2011/11/16 02:10:13 -0800

It should probably be done on the 2.0 branch, no?

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

by beberlei at 2011/11/18 02:11:06 -0800

Its not necessarily a bugfix but an enhancement.
2011-11-18 12:35:14 +01:00
Joseph Rouff
c89d45ba2a Fix cs 2011-11-17 23:14:19 +01:00
Christophe Coevoet
413756c103 [BC break][SecurityBundle] Changed the way to register factories 2011-11-17 20:16:17 +01:00
Francesco Levorato
2adc36c3a9 [Security] renamed security option to erase_credentials 2011-11-17 17:27:28 +01:00
William DURAND
5e4b7cb1ba Renamed Propel Bridge: Propel => Propel1 2011-11-17 16:31:53 +01:00
Fabien Potencier
ae1e9cbedf fixed some tests broken by previous merge 2011-11-17 16:05:15 +01:00
Fabien Potencier
ec2c81bc84 merged branch stof/security_providers (PR #2454)
Commits
-------

d2195cc Fixed phpdoc and updated the changelog
9e41ff4 [SecurityBundle] Added a validation rule
b107a3f [SecurityBundle] Refactored the configuration
633f0e9 [DoctrineBundle] Moved the entity provider service to DoctrineBundle
74732dc [SecurityBundle] Added a way to extend the providers section of the config

Discussion
----------

[WIP][SecurityBundle] Added a way to extend the providers section of the config

Bug fix: no
Feature addition: yes
BC break: <del>no (for now)</del> yes
Tests pass: yes

This adds a way to extend the ``providers`` section of the security config so that other bundles can hook their stuff into it. An example is available in DoctrineBundle which is now responsible to handle the entity provider (<del>needs some cleanup as the service definition is still in SecurityBundle currently</del>). This will allow PropelBundle to provide a ``propel:`` provider for instance.

In order to keep BC with the existing configuration for the in-memory and the chain providers, I had to allow using a prototyped node instead of forcing using an array node with childrens. This introduces some issues:

- impossible to validate easily that a provider uses only one setup as prototyped node always have a default value (the empty array)
- the ``getFixableKey`` method is needed in the interface to support the XML format by pluralizing the name.

Here is my non-BC proposal for the configuration to clean this:

```yaml
security:
    providers:
        first:
            memory: # BC break here by adding a level before the users
                users:
                     joe: { password: foobar, roles: ROLE_USER }
                     john: { password: foobarbaz, roles: ROLE_USER }
        second:
            entity: # this one is BC
                class: Acme\DemoBundle\Entity\User
        third:
            id: my_custom_provider # also BC
        fourth:
            chain: # BC break by adding a level before the providers
                 providers: [first, second, third]
```

What do you think about it ? Do we need to keep the BC in the config of the bundle or no ?

Btw note that the way to register the factories used by the firewall section should be refactored using the new way to provide extension points in the extensions (as done here) instead of relying on the end user to register factories, which would probably mean a BC break anyway.

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

by lsmith77 at 2011/10/23 09:19:23 -0700

i don't think we should keep BC. the security config is complex as is .. having BC stuff in there will just make it even harder and confusing.

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

by willdurand at 2011/10/23 09:41:25 -0700

Is the security component tagged with `@api` ?

So basically, we just have to create a factory (`ModelFactory` for instance) and to register it in the `security` extension, right ? Seems quite simple to extend and much better than the hardcoded version…

Why did you call the method to pluralize a key `getFixableKey` ?

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

by beberlei at 2011/10/23 14:48:26 -0700

Changing security config will introduce risk for users. We should avoid that

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

by stof at 2011/10/23 15:34:47 -0700

@beberlei as the config is validated, it will simply give them an exception during the loading of the config if they don't update their config.

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

by stof at 2011/10/24 01:01:42 -0700

@schmittjoh @fabpot Could you give your mind about it ?

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

by stof at 2011/10/31 17:08:12 -0700

@fabpot @schmittjoh ping

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

by stof at 2011/11/11 14:08:18 -0800

I updated the PR by implementing my proposal as the latest IRC meeting agreed that we don't need to keep the BC for this change. This allows to add the validation rule now.

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

by stof at 2011/11/16 11:16:06 -0800

@fabpot ping

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

by fabpot at 2011/11/16 22:29:05 -0800

@stof: Before merging, you must also add information about how to upgrade in the CHANGELOG-2.1.md file.

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

by stof at 2011/11/17 00:01:23 -0800

@fabpot done
2011-11-17 16:00:33 +01:00
Fabien Potencier
c98c2ef5fb merged the two Locale listener hooks (this hack was needed when the Firewall was registered before the Routing; this is not needed anymore) 2011-11-17 14:22:57 +01:00
Fabien Potencier
e886d733fb merged the two Router listener hooks (this hack was needed when the Firewall was registered between those two hooks; this is not needed anymore) 2011-11-17 14:22:57 +01:00
Fabien Potencier
e3655f3a5c changed priorities for kernel.request listeners
The Firewall is now executed after the Router. This was needed to have access
to the locale and other request attributes that are set by the Router. This
change implies that all Firewall specific URLs have proper (empty) routes like
`/login_check` and `/logout`.
2011-11-17 14:22:53 +01:00
Johannes Schmitt
46e5fa5c87 fixed previous merges partially, there still seems to be a problem with the test client 2011-11-17 14:04:01 +01:00
Fabien Potencier
6ae5082bbf [SecurityBundle] fixed typos in functional tests 2011-11-17 14:02:17 +01:00
Francesco Levorato
104b697767 [Security] added configurable option security.erase_credentials_from_token 2011-11-17 09:57:17 +01:00
Fabien Potencier
43e6c36909 [FrameworkBundle] changed the session listeners to be subscribers 2011-11-17 09:54:24 +01:00
Christophe Coevoet
d2195cc3d1 Fixed phpdoc and updated the changelog 2011-11-17 08:59:41 +01:00
Fabien Potencier
62fb019c62 added event priorities in the profiler 2011-11-17 08:26:11 +01:00
Fabien Potencier
1ae3682bb9 merged branch snc/login-referer (PR #2518)
Commits
-------

f9a65ba Redirect to default_target_path if use_referer is true and the referer is the login_path.

Discussion
----------

Login redirect

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

Redirect to default_target_path if use_referer is true and the referer is the login_path.

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

by Seldaek at 2011/10/30 10:52:38 -0700

👍

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

by stealth35 at 2011/10/30 11:04:16 -0700

@snc BC break ?

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

by snc at 2011/10/30 12:11:39 -0700

Well I'm sure it is never intended by a developer to be redirected to the login page after logging in but it could be possible that the controller which displays the login form handles this case, so my change would break it.
2011-11-17 07:41:20 +01:00
Fabien Potencier
12299c4de9 merged branch kriswallsmith/form/checkbox-view (PR #2661)
Commits
-------

79ae3fc [Form] fixed radio and checkbox when data is not bool

Discussion
----------

[Form] fixed checkbox view

The checkbox view was being built based on app data, not client data. This fixes it.

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

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

by fabpot at 2011/11/16 13:31:09 -0800

`RadioType` suffers from the same problem, no?

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

by kriswallsmith at 2011/11/16 13:32:50 -0800

Yeah, I'll fix that too.

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

by kriswallsmith at 2011/11/16 13:43:29 -0800

Updated to include `RadioType`.
2011-11-17 07:05:47 +01:00
Fabien Potencier
92474cf912 fixed Swiftmailer bridge composer.json 2011-11-17 07:01:49 +01:00
Fabien Potencier
bd708247f0 merged 2.0 2011-11-17 07:00:22 +01:00
Fabien Potencier
d1ae6c7cb6 bumped Symfony version in composer.json files to 2.0.7 2011-11-17 06:58:47 +01:00
Fabien Potencier
3ef8079b50 bumped Symfony version to 2.0.7-DEV 2011-11-17 06:58:18 +01:00
Kris Wallsmith
79ae3fced9 [Form] fixed radio and checkbox when data is not bool 2011-11-16 13:39:36 -08:00
Fabien Potencier
b55a43813e updated VERSION for 2.0.6 2011-11-16 20:35:49 +01:00
Francesco Levorato
ede55d2abe [Security] added configuration parameter for AuthorizationManagerProvider 2011-11-16 11:51:44 +01:00
Benjamin Eberlei
6d7e6a87a8 [DoctrineBundle] Enhance error reporting during mapping validation when nested exceptions occur. 2011-11-16 10:59:58 +01:00
Fabien Potencier
7af5f598d9 merged branch tacker/2.0 (PR #2641)
Commits
-------

8399574 Fixes a small php doc issue of Symfony\Component\Console\Command\Command::setDefinition()

Discussion
----------

Fixes a small php doc issue of Symfony\Component\Console\Command\Command::setDefinition()

Have setDefinition() accept InputDefinition instead of Definition.
2011-11-15 07:59:56 +01:00
Fabien Potencier
262bf54d51 merged branch drak/doctrinebundles_tests (PR #2650)
Commits
-------

f83ef1e [DoctrineBundle] Fix tests - incorrect class names (copy paste error most probably)

Discussion
----------

[DoctrineBundle] Fix tests - incorrect class names

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

Some classes are incorrectly named resulting in failed tests for DoctrineBundle, looks like a copy paste error.
2011-11-15 07:57:44 +01:00
Fabien Potencier
a765c0a7d6 merged branch jdreesen/trans-formatting-fix (PR #2648)
Commits
-------

470f872 [FrameworkBundle] fixed formatting of farsi translation file

Discussion
----------

[FrameworkBundle] fixed formatting of farsi translation file

It now matches the other languages translation files.
2011-11-15 07:57:06 +01:00
Drak
f83ef1ec4a [DoctrineBundle] Fix tests - incorrect class names (copy paste error most probably) 2011-11-15 07:41:36 +05:45
jdreesen
5e57854db2 [FrameworkBundle] Updated German validator translation 2011-11-14 20:48:14 +01:00
jdreesen
470f872bf6 [FrameworkBundle] fixed formatting of farsi translation file 2011-11-14 20:33:13 +01:00
jdreesen
67d91f05d4 fixed typo in exception message 2011-11-14 20:16:31 +01:00
Markus Tacker
839957487a Fixes a small php doc issue of Symfony\Component\Console\Command\Command::setDefinition() 2011-11-14 14:56:06 +01:00
Fabien Potencier
1340ea67a6 Merge branch '2.0'
* 2.0:
  [HttpKernel] fixed Content-Length header when using ESI tags (closes #2623)
  [HttpFoundation] added an exception to MimeTypeGuesser::guess() when no guesser are available (closes #2636)
  [Security] fixed HttpUtils::checkRequestPath() to not catch all exceptions (closes #2637)
  [DoctrineBundle] added missing default parameters, needed to setup and use DBAL without ORM
  [Transation] Fix grammar.
  [TwigBundle] Fix trace to not show 'in at line' when file/line are empty.
2011-11-14 14:32:22 +01:00
Fabien Potencier
f7c5bf1db2 [HttpKernel] fixed Content-Length header when using ESI tags (closes #2623) 2011-11-14 13:46:20 +01:00
Fabien Potencier
d67fbe9e48 [HttpFoundation] added an exception to MimeTypeGuesser::guess() when no guesser are available (closes #2636) 2011-11-14 13:21:49 +01:00
Fabien Potencier
0462a89562 [Security] fixed HttpUtils::checkRequestPath() to not catch all exceptions (closes #2637) 2011-11-14 13:10:32 +01:00
Fabien Potencier
769a1e3e0a Merge pull request #2632 from drak/9eb0ef5f106992a5a6300c47e5e03576df578bd2
Grammar fix
2011-11-13 23:10:46 -08:00
Konstantin Kudryashov
24dcd0faf9 [DoctrineBundle] added missing default parameters, needed to setup and use DBAL without ORM 2011-11-14 01:43:18 +02:00
Drak
9eb0ef5f10 [Transation] Fix grammar.
In English, zero is plural so need to use 'are' - "there are no apples".
English's pluralisation rule is: nplurals=2; plural=n != 1;
2011-11-12 14:30:17 +05:45
Fabien Potencier
b6a98bfc98 merged branch dpb587/patch-trace (PR #2593)
Commits
-------

4858fbe [TwigBundle] Fix trace to not show 'in at line' when file/line are empty.

Discussion
----------

[TwigBundle] Fix trace to not show 'in at line' when file/line are empty.

Occasionally I saw call stacks where file/line are empty in the raw exception object, but the trace.html.twig file was still showing 'in at line' with empty values. I believe this fixes that.

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

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

by fabpot at 2011/11/09 22:49:35 -0800

The current code looks correct to me. Can you try with the latest version of Twig to be sure that you don't have this issue because of a bug in Twig that has been fixed since then?

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

by dpb587 at 2011/11/10 07:20:34 -0800

Thanks for the feedback. Should I change my patch to check that both are defined and non-empty, such as `trace.file is defined and trace.file and trace.line is defined and trace.line`?

I think the issue is that I'm seeing the file and line keys are defined but empty. I created another branch with a pseudo-test case that shows a little more information. Using symfony-standard with symfony in deps as follows and symfony/twig removed from deps.lock.

    [symfony]
        git=git://github.com/dpb587/symfony.git
        version=origin/patch-trace-debug

Then running the following:

    phpunit -c app/ vendor/symfony/tests/Symfony/Tests/Bundle/TwigBundle/Controller/ExceptionController.php

The test (is backwards) and passes, dumping the following (this call happens right after a call_user_func):

    Array
    (
        [namespace] => Symfony\Bundle\FrameworkBundle\EventListener
        [short_class] => RouterListener
        [class] => Symfony\Bundle\FrameworkBundle\EventListener\RouterListener
        [type] => ->
        [function] => onKernelRequest
        [file] =>
        [line] =>
        [args] => Array
            (
                [0] => Array
                    (
                        [0] => object
                        [1] => Symfony\Component\HttpKernel\Event\GetResponseEvent
                    )

            )

    )

I saw the same results with two php versions:

    PHP 5.3.3-7+squeeze3 with Suhosin-Patch (cli) (built: Jun 28 2011 08:24:40)
    Copyright (c) 1997-2009 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
        with Xdebug v2.1.1, Copyright (c) 2002-2011, by Derick Rethans
        with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH

    PHP 5.3.8 (cli) (built: Nov  4 2011 05:43:22)
    Copyright (c) 1997-2011 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
        with the ionCube PHP Loader v4.0.10, Copyright (c) 2002-2011, by ionCube Ltd., and
        with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies

Sorry if I'm simply missing something or doing something silly.

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

by fabpot at 2011/11/11 13:12:21 -0800

`trace.file is defined and trace.file and trace.line is defined and trace.line` looks good to me.
2011-11-12 09:19:12 +01:00
Fabien Potencier
c681b68bde Merge branch '2.0'
* 2.0:
  [FrameworkBundle] fixed a unit test
  [Form] Check for normal integers. refs 0427b126c1
  [Form] Replace `an` with `is`
2011-11-12 09:18:01 +01:00
Fabien Potencier
564b4b91ae [FrameworkBundle] fixed a unit test 2011-11-12 09:17:56 +01:00
Danny Berger
4858fbe7e0 [TwigBundle] Fix trace to not show 'in at line' when file/line are empty. 2011-11-11 18:20:32 -06:00
Manuel de Ruiter
462580c06f [Form] Check for normal integers. refs 0427b126c1 2011-11-12 00:58:46 +01:00
Manuel de Ruiter
970e2a2608 [Form] Replace an with is 2011-11-12 00:57:14 +01:00
Fabien Potencier
83b24c5e5b Merge branch '2.0'
* 2.0:
  changed the way we store the current ob level (refs #2617)
2011-11-11 23:36:46 +01:00
Fabien Potencier
bb5fb79c3d changed the way we store the current ob level (refs #2617) 2011-11-11 23:35:49 +01:00
Fabien Potencier
b8e0f411d7 merged 2.0 2011-11-11 23:22:38 +01:00
Fabien Potencier
fb0fffe6db [Validator] fixed a unit test for PHP 5.4 (closes #2585) 2011-11-11 23:22:12 +01:00
Christophe Coevoet
9e41ff4db5 [SecurityBundle] Added a validation rule
This enforces to configure each provider in exactly one way.
2011-11-11 23:02:41 +01:00
Fabien Potencier
21cec043d7 Merge branch '2.0'
* 2.0:
  [Form] fixed previous merge
  [Form] simplified previous merge
  Also identify FirePHP by the X-FirePHP-Version header
  [TwigBundle] Extract output buffer cleaning to method
  [TwigBundle] Do not clean output buffering below initial level
  Fixed rendering of FileType (value is not a valid attribute for input[type=file])
  Added tests for string fix in DateTimeToArrayTransformer (8351a11286).
  Added check for array fields to be integers in reverseTransform method. This prevents checkdate from getting strings as arguments and throwing incorrect ErrorException when submitting form with malformed (string) data in, for example, Date field. #2609
  [Translation] removed unneeded methods
  [Translation] added detection for circular references when adding a fallback catalogue
  [DomCrawler] trim URI in getURI
  [Yaml][Tests] Fixed missing locale string for Windows platforms which caused test to fail
2011-11-11 22:52:07 +01:00
Christophe Coevoet
b107a3fdf0 [SecurityBundle] Refactored the configuration
The configuration is now cleaner by avoiding using prototyped nodes
as additional keys. This is a BC break for existing providers.

 - MemoryProvider:

    security:
        providers:
	    my_provider:
	        memory:  # this level has been added
		    users:
		    	# ...

 - ChainProvider:

    security:
        providers:
	    my_provider:
	    	chain:  # This level has been added
		    providers:
		    	# ...
2011-11-11 22:42:14 +01:00
Fabien Potencier
1940bec31b merged branch igorw/phpunit-ob-level (PR #2617)
Commits
-------

29e12af [TwigBundle] Extract output buffer cleaning to method
ed1a6c2 [TwigBundle] Do not clean output buffering below initial level

Discussion
----------

[TwigBundle] Do not clean output buffering below initial level

This resulted in issues with PHPUnit 3.6, which will buffer all output and clean them in the end. Since
we cleaned their buffer, the subsequent clean would raise a warning. This is documented in [issue 390](https://github.com/sebastianbergmann/phpunit/issues/390) of
the PHPUnit tracker.

Closes #2531.

This also affects FOSRestBundle's ExceptionController /cc @lsmith.

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

by fabpot at 2011/11/11 07:33:24 -0800

I have a similar fix locally but I have not merged it yet as it looks a bit dirty (but I've not a better idea yet). Anyway, your PR is better than mine as you've added some unit tests already.
2011-11-11 22:17:55 +01:00
Fabien Potencier
7f32043f19 merged branch jalliot/file_widget (PR #2608)
Commits
-------

e83e00a Fixed rendering of FileType (value is not a valid attribute for input[type=file])

Discussion
----------

Fixed rendering of FileType

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

According to the W3C validator, `value` is not a valid attribute for `input[type=file]`.

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

by fabpot at 2011/11/10 23:01:24 -0800

Instead of creating yet another block, what about modifying the `field_widget` to not render the `value` attribute if the value is empty? Also, the PHP template must be fixed too.

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

by jalliot at 2011/11/11 02:02:52 -0800

@fabpot Changed ;)
2011-11-11 22:01:59 +01:00
Fabien Potencier
0427b126c1 [Form] fixed previous merge 2011-11-11 22:01:46 +01:00
Fabien Potencier
3922fb839a [Form] simplified previous merge 2011-11-11 21:49:47 +01:00
Fabien Potencier
7475a3924c merged branch ondrowan/2.0 (PR #2614)
Commits
-------

2582fcb Added tests for string fix in DateTimeToArrayTransformer (8351a11286).
8351a11 Added check for array fields to be integers in reverseTransform method. This prevents checkdate from getting strings as arguments and throwing incorrect ErrorException when submitting form with malformed (string) data in, for example, Date field. #2609

Discussion
----------

Fix for #2609

Second take for fix for #2609, hope it's ok now. Tests are failing without my fix and passing with it.
2011-11-11 21:48:12 +01:00
Joseph Rouff
fb0379d3b7 Fix some CheckStyle violations on Components.
On casts, Control signature etc.
2011-11-11 20:46:32 +01:00
Fabien Potencier
6140869baa Revert "merged branch drak/eventdispatcher_opimization (PR #2597)"
This reverts commit db6fea9fd0, reversing
changes made to 47b09f791b.
2011-11-11 16:28:23 +01:00
Costin Bereveanu
7cba0a07b6 Also identify FirePHP by the X-FirePHP-Version header 2011-11-11 17:04:36 +02:00
Igor Wiedler
29e12affb0 [TwigBundle] Extract output buffer cleaning to method 2011-11-11 14:54:44 +01:00
Igor Wiedler
ed1a6c2e45 [TwigBundle] Do not clean output buffering below initial level
This resulted in issues with PHPUnit 3.6, which will buffer all output and clean them in the end. Since
we cleaned their buffer, the subsequent clean would raise a warning. This is documented in issue 390 of
the PHPUnit tracker.

Closes #2531.
2011-11-11 12:09:57 +01:00
Jordan Alliot
e83e00a7b8 Fixed rendering of FileType (value is not a valid attribute for input[type=file]) 2011-11-11 11:01:38 +01:00
ondrowan
8351a11286 Added check for array fields to be integers in reverseTransform method. This prevents checkdate from getting strings as arguments and throwing incorrect ErrorException when submitting form with malformed (string) data in, for example, Date field. #2609 2011-11-11 09:58:40 +01:00
Fabien Potencier
6b0e7c8c41 [Translation] removed unneeded methods 2011-11-11 09:02:31 +01:00
Fabien Potencier
db6fea9fd0 merged branch drak/eventdispatcher_opimization (PR #2597)
Commits
-------

0fe8ac6 [EventDispatcher] Removed unused argument.

Discussion
----------

[EventDispatcher] Removed unused parameter in doDispatch().

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

Removed unused parameter.

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

by Seldaek at 2011/11/10 02:30:01 -0800

A simple $foo($arg) is faster than call_user_func, fine, but with all the if/else logic here are you sure it is still faster?

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

by drak at 2011/11/10 06:44:41 -0800

call_user_func is inordinately slow, I'll make some benchmarks. The if logic here is pretty, two conditionals for array callables or one conditional for closures/functions.

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

by drak at 2011/11/10 12:45:27 -0800

After doing some benchmarks, there are savings to be made in all cases except when the listener is an instantiated object when it's marginally slower, so I've reverted these changes and made this PR just to remove the unused argument in `doDispatch()`. You can see the benchmark code here: https://gist.github.com/1356129.

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

by drak at 2011/11/10 12:46:55 -0800

This PR is ready for consideration.
2011-11-11 08:31:28 +01:00
Fabien Potencier
45b218e7c4 [Translation] added detection for circular references when adding a fallback catalogue 2011-11-11 08:29:16 +01:00
Drak
0fe8ac6149 [EventDispatcher] Removed unused argument. 2011-11-11 02:25:05 +05:45
stealth35
a245e15434 [DomCrawler] trim URI in getURI 2011-11-10 15:38:28 +01:00
Grégoire Paris
5b30812b26 See this issue : https://github.com/symfony/symfony/issues/2433 2011-11-10 15:38:07 +01:00
Fabien Potencier
47b09f791b merged branch snc/issue-1798-sf21 (PR #2598)
Commits
-------

4d80ebd Remove security token if user was deleted, is disabled or locked to prevent infinite redirect loops to the login path (fixes #1798).

Discussion
----------

[2.1] Fix for issue 1798

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

This is a simplified PR of #2528 for the master branch.
2011-11-10 10:55:51 +01:00
Fabien Potencier
0025673d15 Merge branch '2.0'
* 2.0:
  Added a class to the logs ol element to prevent hiding it when toggling an exception (fixes #2589).
  Remove only the security token instead of the session cookie.
  Clear session cookie if user was deleted, is disabled or locked to prevent infinite redirect loops to the login path (fixes #1798).
2011-11-10 10:55:16 +01:00
Fabien Potencier
3c584f5683 merged branch snc/issue-1798 (PR #2528)
Commits
-------

f9befb6 Remove only the security token instead of the session cookie.
348bccb Clear session cookie if user was deleted, is disabled or locked to prevent infinite redirect loops to the login path (fixes #1798).

Discussion
----------

Fix for issue 1798

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

Clear session cookie if user was deleted, is disabled or locked to prevent infinite redirect loops to the login path (fixes #1798).

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

by snc at 2011/11/01 04:01:49 -0700

@stof I have changed the code so that it only removes the token... do we still need any hook support?

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

by stof at 2011/11/01 04:07:17 -0700

well, the hook is for your own use case but it would be for 2.1 only anyway, not for 2.0

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

by snc at 2011/11/07 15:11:52 -0800

Now that #2414 is merged to 2.1, this could be simplified for the master branch...
2011-11-10 10:54:32 +01:00
H. Westphal
4d80ebd5c8 Remove security token if user was deleted, is disabled or locked to prevent infinite redirect loops to the login path (fixes #1798). 2011-11-10 10:34:33 +01:00
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
Lukas Kahwe Smith
1e370d70c5 typo fix 2011-11-04 09:15:42 +01:00
Lukas Kahwe Smith
93d8d44a7d added some more infos about Config 2011-11-04 09:15:32 +01:00
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
Lukas Kahwe Smith
27efd59070 added READMEs for the bridges 2011-11-03 21:29:55 +01:00
Lukas Kahwe Smith
34fc866b5a cosmetic tweaks 2011-11-03 21:26:29 +01:00
Lukas Kahwe Smith
d6af3f145c fixed README for Console 2011-11-03 21:17:38 +01:00
Lukas Kahwe Smith
6a72b8c6b9 added basic README files for all components
heavily inspired by http://fabien.potencier.org/article/49/what-is-symfony2 and the official Symfony2 documentation
2011-11-03 21:11:40 +01:00
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