Commit Graph

7752 Commits

Author SHA1 Message Date
stealth35
3759ff0777 [Locale] StubNumberFormatter allow to parse 64bit number in 64bit mode 2011-12-11 17:45:39 +01:00
lsmith77
b1ca0cdfe9 added several tests to the serializer (mainly for deserialization) 2011-12-11 12:09:53 +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
Arnout Boks
4fe4dfd116 Fixed vendor version mismatch in tests 2011-12-08 18:09:06 +01:00
Fabien Potencier
76ba2bc7ac merged branch kriswallsmith/security/demeter-fix (PR #2816)
Commits
-------

41872cd [Security] added SecurityContextInterface::getUser()

Discussion
----------

[Security] added SecurityContextInterface::getUser()

This changes helps the common use case of fetching the current user and better complies with the [Law of Demeter][1].

Before (still works):

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

After:

    $user = $context->getUser();

The fine print:

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

[1]: http://en.wikipedia.org/wiki/Law_of_Demeter
2011-12-08 17:58:34 +01:00
Fabien Potencier
c6db266d83 merged branch stof/reference_case_insensitive (PR #2815)
Commits
-------

2c3e9ad [DependencyInjection] Made the reference case insensitive

Discussion
----------

[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

Replaces #2811 by targeting the good branch
2011-12-08 17:53:12 +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
84d657959f update CONTRIBUTORS for 2.0.7 2011-12-08 15:17:21 +01:00
Fabien Potencier
9cb52ee2a7 updated CHANGELOG 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
Fabien Potencier
2efb6d516e updated vendors for 2.0.7 2011-12-08 14:59:35 +01:00
Fabien Potencier
b00e91b290 merged branch asm89/remove-unused-variable-2.0 (PR #2803)
Commits
-------

6c69592 [FrameworkBundle] Remove unused variable in TemplateLocator

Discussion
----------

[FrameworkBundle] Remove unused variable in TemplateLocator

2.0 version of #2799
2011-12-08 09:49:31 +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
237c36a167 [HttpKernel] fixed tests that can sporadically fail 2011-12-07 21:39:45 +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
Fabien Potencier
1c4bfb4c0d [Validator] added some unit tests for previous merge 2011-12-07 16:27:15 +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
Fabien Potencier
faa7e53a86 merged branch jmikola/patch-1 (PR #2793)
Commits
-------

ea2b0e5 Note LoaderResolverInterface type hinting in the 2.1 changelog

Discussion
----------

Note LoaderResolverInterface type hinting in the 2.1 changelog

Although #2785 was originally opened against 2.0, its merge to master seems to be intentional. This documents the BC break that some experienced (see: FriendsOfSymfony/FOSRestBundle#155).
2011-12-07 07:37:34 +01:00
Jordi Boggiano
7c2f11f713 Merge pull request #1 from pminnieur/post_response
[HttpKernel] Add Kernel::terminate() and HttpKernel::terminate() for post-response logic (without the BC break)
2011-12-06 13:36:39 -08:00
Jeremy Mikola
ea2b0e5454 Note LoaderResolverInterface type hinting in the 2.1 changelog 2011-12-06 11:55:17 -08: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