Commit Graph

7055 Commits

Author SHA1 Message Date
Igor Wiedler
83c23ca0be [streaming] Do not set a Transfer-Encoding header of chunked
Apache expects the response to already be in chunked format in that case,
which causes it to not deliver the streamed body.

If no Content-Length is set on the response, web servers will automatically
switch to chunked Transfer-Encoding, and handle the chunking for you.

Nginx does not share the issue that apache has, but will add the Content-
Length header too.
2012-01-02 19:50:39 +01:00
Fabien Potencier
5f959e3e6f merged branch henrikbjorn/security-extension-check-path (PR #3005)
Commits
-------

c37c145 [SecurityBundle] Only throw exception if check_path looks like an url

Discussion
----------

[SecurityBundle] Only throw exception if check_path looks like an url

fixes #2954 and enables the usage of route names like you can in all other paths
2012-01-02 19:16:50 +01:00
Fabien Potencier
dcf209a4aa [DoctrineBundle] removed the bundle (migrated to the Doctrine organization) 2012-01-02 18:07:52 +01:00
Fabien Potencier
d3ab39d3b6 merged branch rouffj/propel-extension (PR #3011)
Commits
-------

20f96bd Fix CS
2f47cca [Propel1] Add a PropelExtension

Discussion
----------

[Propel1] Add a PropelExtension

The propel extension allow to use propel specific type (ModelType) outside of
Symfony2.

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

by rouffj at 2012/01/01 15:36:10 -0800

@Stof Fixed :).

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

by willdurand at 2012/01/02 07:38:22 -0800

👍
2012-01-02 17:51:14 +01:00
Fabien Potencier
ce6399e254 [TwigBridge] added a way to specify a default domain for a Twig template (via the 'trans_default_domain' tag)
Note that the tag only influences the current templates. It has no effect on included files to avoid unwanted side-effects.
2012-01-02 17:48:19 +01:00
Fabien Potencier
2a5758f082 [TwigBridge] allow the domain translation to be null when calling the trans and transchoice filters (to allow passing a locale without hardcoding the messages domain) 2012-01-02 17:10:27 +01:00
Fabien Potencier
7424e62d67 [TwigBridge] moved the default value for the translation domain to the Node compilation (allows to know when a domain has been provided by the user) 2012-01-02 17:09:43 +01:00
Fabien Potencier
c73e034229 [TwigBridge] added missing transchoice filters whe extracting translations from templates 2012-01-02 17:08:10 +01:00
Fabien Potencier
789d5ad20f [FrameworkBundle] allowed attributes of the render() method to be arrays 2012-01-02 16:31:32 +01:00
Fabien Potencier
cadf3d4243 [HttpKernel] fixed doubled results for the file profiler (closes #2915) 2012-01-02 12:10:17 +01:00
Fabien Potencier
254e49b47c [FrameworkBundle] removed the possibility to pass a non-scalar attributes when calling render() to make the call works with or without a reverse proxy (closes #2941) 2012-01-02 11:47:41 +01:00
Joseph Rouff
20f96bd49d Fix CS 2012-01-02 00:34:34 +01:00
Joseph Rouff
2f47ccab9c [Propel1] Add a PropelExtension
The propel extension allow to use propel specific type (ModelType) outside of
Symfony2.
2012-01-02 00:25:31 +01:00
Peter Kokot
fae715798a slovenian validators translations correction 2012-01-01 20:48:21 +01:00
Fabien Potencier
1e2d1a3406 [WebProfilerBundle] fixed some bugs 2011-12-31 16:35:58 +01:00
Fabien Potencier
66a18f3239 [BrowserKit] first attempt at fixing CookieJar (closes #2209) 2011-12-31 16:32:51 +01:00
Fabien Potencier
b46114a0f6 [WebProfilerBundle] moved the computation of the Router panel at runtime 2011-12-31 15:53:13 +01:00
Fabien Potencier
3d5ecc0478 [HttpKernel] added the path info in the request data collector 2011-12-31 15:51:33 +01:00
Fabien Potencier
e462f7b668 [Templating] simplified PhpEngine as it cannot implements the streaming interface 2011-12-31 14:50:33 +01:00
Fabien Potencier
6c6d91ed74 fixed typo 2011-12-31 10:50:19 +01:00
Fabien Potencier
899e252032 merged branch symfony/streaming (PR #2935)
Commits
-------

887c0e9 moved EngineInterface::stream() to a new StreamingEngineInterface to keep BC with 2.0
473741b added the possibility to change a StreamedResponse callback after its creation
8717d44 moved a test in the constructor
e44b8ba made some cosmetic changes
0038d1b [HttpFoundation] added support for streamed responses

Discussion
----------

[HttpFoundation] added support for streamed responses

To stream a Response, use the StreamedResponse class instead of the
standard Response class:

    $response = new StreamedResponse(function () {
        echo 'FOO';
    });

    $response = new StreamedResponse(function () {
        echo 'FOO';
    }, 200, array('Content-Type' => 'text/plain'));

As you can see, a StreamedResponse instance takes a PHP callback instead of
a string for the Response content. It's up to the developer to stream the
response content from the callback with standard PHP functions like echo.
You can also use flush() if needed.

From a controller, do something like this:

    $twig = $this->get('templating');

    return new StreamedResponse(function () use ($templating) {
        $templating->stream('BlogBundle:Annot:streamed.html.twig');
    }, 200, array('Content-Type' => 'text/html'));

If you are using the base controller, you can use the stream() method instead:

    return $this->stream('BlogBundle:Annot:streamed.html.twig');

You can stream an existing file by using the PHP built-in readfile() function:

    new StreamedResponse(function () use ($file) {
        readfile($file);
    }, 200, array('Content-Type' => 'image/png');

Read http://php.net/flush for more information about output buffering in PHP.

Note that you should do your best to move all expensive operations to
be "activated/evaluated/called" during template evaluation.

Templates
---------

If you are using Twig as a template engine, everything should work as
usual, even if are using template inheritance!

However, note that streaming is not supported for PHP templates. Support
is impossible by design (as the layout is rendered after the main content).

Exceptions
----------

Exceptions thrown during rendering will be rendered as usual except that
some content might have been rendered already.

Limitations
-----------

As the getContent() method always returns false for streamed Responses, some
event listeners won't work at all:

* Web debug toolbar is not available for such Responses (but the profiler works fine);
* ESI is not supported.

Also note that streamed responses cannot benefit from HTTP caching for obvious
reasons.

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

by Seldaek at 2011/12/21 06:34:13 -0800

Just an idea: what about exposing flush() to twig? Possibly in a way that it will not call it if the template is not streaming. That way you could always add a flush() after your </head> tag to make sure that goes out as fast as possible, but it wouldn't mess with non-streamed responses. Although it appears flush() doesn't affect output buffers, so I guess it doesn't need anything special.

When you say "ESI is not supported.", that means only the AppCache right? I don't see why this would affect Varnish, but then again as far as I know Varnish will buffer if ESI is used so the benefit of streaming there is non-existent.

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

by cordoval at 2011/12/21 08:04:21 -0800

wonder what the use case is for streaming a response, very interesting.

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

by johnkary at 2011/12/21 08:19:48 -0800

@cordoval Common use cases are present fairly well by this RailsCast video: http://railscasts.com/episodes/266-http-streaming

Essentially it allows faster fetching of web assets (JS, CSS, etc) located in the &lt;head>&lt;/head>, allowing those assets to be fetched as soon as possible before the remainder of the content body is computed and sent to the browser. The end goal is to improve page load speed.

There are other uses cases too like making large body content available quickly to the service consuming it. Think if you were monitoring a live feed of JSON data of newest Twitter comments.

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

by lsmith77 at 2011/12/21 08:54:35 -0800

How does this relate the limitations mentioned in:
http://yehudakatz.com/2010/09/07/automatic-flushing-the-rails-3-1-plan/

Am I right to understand that due to how twig works we are not really streaming the content pieces when we call render(), but instead the entire template with its layout is rendered and only then will we flush? or does it mean that the render call will work its way to the top level layout template and form then on it can send the content until it hits another block, which it then first renders before it continues to send the data?

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

by stof at 2011/12/21 09:02:53 -0800

@lsmith77 this is why the ``stream`` method calls ``display`` in Twig instead of ``render``. ``display`` uses echo to print the output of the template line by line (and blocks are simply method calls in the middle). Look at your compiled templates to see it (the ``doDisplay`` method)
Rendering a template with Twig simply use an output buffer around the rendering.

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

by fabpot at 2011/12/21 09:24:33 -0800

@lsmith77: We don't have the Rails problem thanks to Twig as the order of execution is the right one by default (the layout is executed first); it means that we can have the flush feature without any change to how the core works. As @stof mentioned, we are using `display`, not `render`, so we are streaming your templates for byte one.

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

by fabpot at 2011/12/21 09:36:41 -0800

@Seldaek: yes, I meant ESI with the PHP reverse proxy.

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

by fabpot at 2011/12/21 09:37:34 -0800

@Seldaek: I have `flush()` support for Twig on my todo-list. As you mentioned, It should be trivial to implement.

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

by fzaninotto at 2011/12/21 09:48:18 -0800

How do streaming responses deal with assets that must be called in the head, but are declared in the body?

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

by fabpot at 2011/12/21 09:52:12 -0800

@fzaninotto: What do you mean?

With Twig, your layout is defined with blocks ("holes"). These blocks are overridden by child templates, but evaluated as they are encountered in the layout. So, everything works as expected.

As noted in the commit message, this does not work with PHP templates for the problems mentioned in the Rails post (as the order of execution is not the right one -- the child template is first evaluated and then the layout).

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

by fzaninotto at 2011/12/21 10:07:35 -0800

I was referring to using Assetic. Not sure if this compiles to Twig the same way as javascript and stylesheet blocks placed in the head - and therefore executed in the right way.

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

by fabpot at 2011/12/21 10:34:59 -0800

@Seldaek: I've just added a `flush` tag in Twig 1.5: 1d6dfad4f5

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

by catchamonkey at 2011/12/21 13:29:22 -0800

I'm really happy you've got this into the core, it's a great feature to have! Good work.
2011-12-31 08:12:02 +01:00
Fabien Potencier
887c0e9c04 moved EngineInterface::stream() to a new StreamingEngineInterface to keep BC with 2.0 2011-12-31 08:11:20 +01:00
Henrik Bjørnskov
c37c14528e [SecurityBundle] Only throw exception if check_path looks like an url 2011-12-30 20:00:08 +01:00
Fabien Potencier
d12f5b202c [Routing] removed trailing slash support for routes that are not available for GET/HEAD methods (as the redirection will always occurs with a GET/HEAD request, closes #2626) 2011-12-30 19:30:23 +01:00
Fabien Potencier
eef8a3c513 [FrameworkBundle] changed the implementation of Controller::getUser() to be similar to the one from GlobalVariables::getUser() 2011-12-30 16:15:28 +01:00
Fabien Potencier
a78437bba9 Revert "merged branch kriswallsmith/security/demeter-fix (PR #2816)"
This reverts commit 76ba2bc7ac, reversing
changes made to 4730f4303b.
2011-12-30 16:05:26 +01:00
Fabien Potencier
466a8b8f48 Merge branch '2.0'
* 2.0:
  [Tests] Skip segfaulting form test
  Rename test file
  [BrowserKit] added missing @return PHPDoc for the Client::submit() method.
  also test PHP 5.3.2, since this is the official lowest supported PHP version
2011-12-30 15:44:05 +01:00
alefranz
de9d7d8c3c Updated italian traslation of validator 2011-12-29 20:56:01 +01:00
Anton Babenko
1cd74ec2cd Added norwegian translations of validators 2011-12-29 18:21:01 +01:00
Hugo Hamon
885fa02871 [BrowserKit] added missing @return PHPDoc for the Client::submit() method. 2011-12-29 15:00:40 +01:00
Fabien Potencier
23e04e3acb merged 2.0 2011-12-29 09:22:11 +01:00
Fabien Potencier
a01eee8536 merged branch ericclemmons/2884-parameterbag-with-spaces (PR #2976)
Commits
-------

85ca8e3 ParameterBag no longer resolves parameters that have spaces.
99011ca Added tests for ParameterBag parameters with spaces

Discussion
----------

[DependencyInjection] Parameters with spaces are not resolved

Bug fix: yes
Feature addition: no
Backwards compatibility break: no (not likely, according to convention)
Symfony2 tests pass: yes
Fixes the following tickets: #2884

`ParameterBag` currently resolves anything between two `%` signs, which creates issues for any parameters in the DIC that are legitimate text.  This PR enforces the [documented parameter convention](http://symfony.com/doc/2.0/book/service_container.html#service-parameters) so that only `%parameters.with.no_spaces%` are resolved.

I was considering using instead `^%([^\w\._-]+)%$`, but felt that was too constricting & could easily introduce issues with existing applications.
2011-12-28 21:36:04 +01:00
Fabien Potencier
cab70f4083 merged 2.0 2011-12-28 20:44:29 +01:00
Fabien Potencier
48203fc1a2 merged branch havvg/patch-1 (PR #2957)
Commits
-------

41950a6 [WebProfilerBundle] add margin-bottom to caption

Discussion
----------

[WebProfilerBundle] add margin-bottom to caption

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

by fabpot at 2011/12/26 13:15:57 -0800

What does it fix?

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

by havvg at 2011/12/27 02:46:16 -0800

Just a minor design issue with table captions.

Without: http://dl.dropbox.com/u/548684/PR2957/without-margin.png
With: http://dl.dropbox.com/u/548684/PR2957/with-margin.png

I currently hold it in a custom css, but thought it is generic enough to be put into the bundle.

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

by henrikbjorn at 2011/12/27 04:03:53 -0800

@havvg What custom bundle is that ? and what does it show? look interesting

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

by havvg at 2011/12/27 04:40:18 -0800

@henrikbjorn It's a bundle (not published yet, https://github.com/havvg/HavvgCloudcontrolBundle) adding features to fully utilize applications on http://cloudcontrol.com PaaS.
2011-12-28 20:42:42 +01:00
Fabien Potencier
6c96ccef4f merged branch javiereguiluz/phpdoc-console-component (PR #2978)
Commits
-------

3f2e1b0 [Console] Updated tests to reflect the change from `program` to `application`
2b64944 [Console][Output] Fixed some minor typos and grammatical errors
96997f1 [Console][Input] Added missing PHPDoc and fixed some minor typos and grammatical errors
855b8af [Console][Helper] Added missing PHPDoc and fixed some minor typos and grammatical errors
3ad02bd [Console][Formatter] Added missing PHPDoc @throws and fixed some minor typos and grammatical errors
33e3f11 [Console] Added a missing PHPDoc and replaced `program` by `application`

Discussion
----------

[Console] Fixed and completed PHPDoc

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

Fixes the following tickets: -

* Fixed minor typos and grammatical errors
* Added missing PHPDoc for some methods
* Added missing @throws
2011-12-28 20:38:46 +01:00
Fabien Potencier
15d72733ef merged branch mshtukin/master (PR #2979)
Commits
-------

1bc10e5 Forgotten </trans-unit> tag added

Discussion
----------

Forgotten </trans-unit> tag added

on src/Symfony/Bundle/FrameworkBundle/Resources/translations/validators.es.xlf
2011-12-28 20:38:29 +01:00
Javier López
60f845f518 'for' was duplicated 2011-12-28 16:35:20 +00:00
Michael
1bc10e5375 Forgotten </trans-unit> tag added 2011-12-28 14:15:50 +02:00
Javier Eguíluz
2b64944fd7 [Console][Output] Fixed some minor typos and grammatical errors 2011-12-28 10:42:15 +01:00
Javier Eguíluz
96997f12d6 [Console][Input] Added missing PHPDoc and fixed some minor typos and grammatical errors 2011-12-28 10:39:14 +01:00
Javier Eguíluz
855b8af776 [Console][Helper] Added missing PHPDoc and fixed some minor typos and grammatical errors 2011-12-28 10:33:49 +01:00
Javier Eguíluz
3ad02bd5f9 [Console][Formatter] Added missing PHPDoc @throws and fixed some minor typos and grammatical errors 2011-12-28 10:29:22 +01:00
Javier Eguíluz
33e3f11f48 [Console] Added a missing PHPDoc and replaced program by application 2011-12-28 10:22:28 +01:00
Eric Clemmons
85ca8e3615 ParameterBag no longer resolves parameters that have spaces.
They must be strictly "%some.parameter%" or similar.
2011-12-27 12:49:22 -08:00
Fabien Potencier
e10448e9ea Merge branch '2.0'
* 2.0:
  [TwigBridge] changed composer.json max version for Twig
  use the forward compat version in the Filesystem service
2011-12-27 12:11:56 +01:00
Fabien Potencier
c92d75f6dd [TwigBridge] changed composer.json max version for Twig 2011-12-27 12:11:50 +01:00
Fabien Potencier
b254851e91 merged branch lsmith77/forward_compat_filesystem (PR #2971)
Commits
-------

aacb2de use the forward compat version in the Filesystem service

Discussion
----------

use the forward compat version in the Filesystem service

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

by changing the service it should fix any type hints for the Filesystem class inside 2.1, but it shouldn't affect anyone still type hinting the old location in 2.0 since the new forward compat file extends the old file.

See
00c988bf0c (commitcomment-820879)

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

by tobiassjosten at 2011/12/26 18:41:45 -0800

👍
2011-12-27 10:01:26 +01:00
lsmith77
aacb2deb20 use the forward compat version in the Filesystem service 2011-12-27 00:32:17 +01:00
Fabien Potencier
228f3fc540 merged branch webfactory/tolerant_esi_include (PR #2952)
Commits
-------

cae7db0 Be more tolerant and also accept <esi:include ...></esi:include>, also if it is not 100% standards compliant.

Discussion
----------

Be more tolerant and also accept <esi:include ...></esi:include>

I know this is not 100% standards compliant, but:

We need to do some XHTML processing on the output using PHP's DOM extension and the underlying libxml2.

libxml2 seems to be unable to keep the <esi:include /> tag as such and will expand it to ```<esi:include ...></esi:include>```.

Note this has nothing to do with having LIBXML_NOEMPTYTAG set (http://php.net/manual/de/domdocument.savexml.php). Rather it seems to be a problem for libxml that it cannot recognize <esi:include> as an "EMPTY" tag (in the DTD sense) because it is not defined in a standard xhtml1-strict DTD.
2011-12-26 22:30:23 +01:00
Fabien Potencier
8282cd9f66 reverted wrong CD fix 2011-12-26 22:17:17 +01:00
Fabien Potencier
83dbbb2691 merged branch javiereguiluz/add-image-validator-spanish-translation (PR #2969)
Commits
-------

341dc2b [FrameworkBundle] Added Image validator messages translation for Spanish

Discussion
----------

[FrameworkBundle] Added Image validator messages translation for Spanish
2011-12-26 21:58:22 +01:00
Fabien Potencier
cc9eff0bc6 merged 2.0 2011-12-26 21:57:48 +01:00
Fabien Potencier
aa74e90772 merged branch javiereguiluz/add-unique-entity-spanish-translation (PR #2968)
Commits
-------

eb2d6e6 [FrameworkBundle] Added UniqueEntity message translation for Spanish

Discussion
----------

[FrameworkBundle] Added UniqueEntity message translation for Spanish
2011-12-26 21:56:59 +01:00
Javier Eguíluz
341dc2b9eb [FrameworkBundle] Added Image validator messages translation for Spanish 2011-12-26 20:53:04 +01:00
Javier Eguíluz
eb2d6e6f2f [FrameworkBundle] Added UniqueEntity message translation for Spanish 2011-12-26 20:39:34 +01:00
Ryan Weaver
a9b54dfa4b [HttpFoundation] Adding some additional PHPDoc to ParameterBag 2011-12-26 12:25:02 -06:00
Fabien Potencier
5b4e6190c4 updated VERSION for 2.0.8 2011-12-26 11:56:10 +01:00
Drak
628016dbdb Partial revert of b6a7167 JS syntax requires space in else if. 2011-12-26 08:42:19 +05:45
Fabien Potencier
b6a7167907 merged branch drak/cs (PR #2953)
Commits
-------

79793e4 Coding standards and removing whitespace.

Discussion
----------

Coding standards and removing whitespace.

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

Please note `2.0` cs passes, this is specifically for the `master` branch.
2011-12-25 22:44:26 +01:00
Fabien Potencier
f8d0c8dd0c merged branch lsmith77/filesystem_forward_compat (PR #2956)
Commits
-------

6e98730 added forwards compatibility for the Filesystem component

Discussion
----------

added forwards compatibility for the Filesystem component

see #2949 and #2946

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

by willdurand at 2011/12/25 05:24:01 -0800

👍

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

by ManuelAC at 2011/12/25 06:38:44 -0800

👍

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

by NAYZO at 2011/12/25 07:45:55 -0800

👍

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

by avalanche123 at 2011/12/25 09:52:59 -0800

I think extracting interface and committing it to both branches is preferable.

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

by lsmith77 at 2011/12/25 12:17:59 -0800

what interface?

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

by avalanche123 at 2011/12/25 12:19:03 -0800

FilesystemInterface

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

by lsmith77 at 2011/12/25 12:22:31 -0800

an interface doesn't really relate to this PR .. aka its a separate topic. the purpose of this PR is to make it easier to write code targeting with 2.0 and 2.1 with minimal impact.

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

by willdurand at 2011/12/25 12:23:51 -0800

Seems overkill to add an interface here. I dont think there are different implementations.

Le 25 déc. 2011 à 21:19, Bulat Shakirzyanov<reply@reply.github.com> a écrit :

> FilesystemInterface
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/2956#issuecomment-3271576

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

by avalanche123 at 2011/12/25 12:28:49 -0800

@lsmith77 point taken, makes sense
@willdurand there are plenty of alternatives to default filesystem (databases, s3, etc.)

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

by willdurand at 2011/12/25 12:52:58 -0800

Gaufrette (KnpLabs) is suitable for what you describe. I don't know if this component is designed to handle various adapters.
This is just a layer for files manipulations on disk.

Le 25 déc. 2011 à 21:28, Bulat Shakirzyanov<reply@reply.github.com> a écrit :

> @lsmith77 point taken, makes sense
> @willdurand there are plenty of alternatives to default filesystem (databases, s3, etc.)
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/2956#issuecomment-3271596
2011-12-25 22:44:06 +01:00
Fabien Potencier
f8f31a2d59 Merge branch '2.0'
* 2.0:
  [Twig] made code compatible with Twig 1.5
2011-12-25 22:40:56 +01:00
Fabien Potencier
adea589a3d [Twig] made code compatible with Twig 1.5 2011-12-25 22:37:25 +01:00
Toni Uebernickel
41950a625f [WebProfilerBundle] add margin-bottom to caption 2011-12-25 14:49:49 +01:00
lsmith77
6e987307fc added forwards compatibility for the Filesystem component 2011-12-25 14:02:01 +01:00
Drak
79793e442a Coding standards and removing whitespace. 2011-12-24 15:50:47 +05:45
Fabien Potencier
b498138471 merged branch willdurand/filesystem-component (PR #2949)
Commits
-------

4afc6ac Updated CHANGELOG-2.1
3d3239c Added Filesystem Component mention in composer.json
5775a0a Added composer.json
b26ae4a Added README
fbe9507 Added LICENSE
818a332 [Component] Moved Filesystem class to its own component

Discussion
----------

Filesystem component

Related to #2946

William

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

by stof at 2011/12/22 10:58:25 -0800

you need to add the new component in the ``replace``  section of the main composer.json, and you also need to add it as a dependency for FrameworkBundle as it defines a service using it.

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

by stof at 2011/12/22 10:59:34 -0800

and you need to update the changelog file

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

by willdurand at 2011/12/22 11:06:04 -0800

@stof thanks. Is it ok ?

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

by stof at 2011/12/22 11:13:31 -0800

mentioning the move only once in the changelog would probably be enough (and it is especially not needed in the FrameworkBundle section IMO) but otherwise it's fine
2011-12-24 09:15:42 +01:00
Matthias Pigulla
cae7db0d19 Be more tolerant and also accept <esi:include ...></esi:include>, also if it is not 100% standards compliant. 2011-12-23 19:02:12 +01:00
Gustavo Piltcher
4a797df90b Oracle issues
minor modifications
2011-12-23 14:13:05 -02:00
Joseph Bielawski
9daa2a6cc8 [Profiler] Add function to get parent token directly 2011-12-23 09:45:13 +01:00
Fabien Potencier
d635be4e20 fixed merge 2011-12-23 09:21:58 +01:00
Fabien Potencier
5b2bc7d7f9 merged 2.0 2011-12-23 08:57:06 +01:00
Fabien Potencier
bebdd07f41 [TwigBridge] simplified code 2011-12-23 08:55:49 +01:00
Fabien Potencier
74cfd04504 [Security] made the logout path check configurable 2011-12-23 08:28:15 +01:00
William DURAND
3d3239c29b Added Filesystem Component mention in composer.json
- In the global Symfony2 composer.json file as a replacement
- In the FrameworkBundle composer.json file as a requirement
2011-12-22 20:02:15 +01:00
William DURAND
5775a0a24a Added composer.json 2011-12-22 19:44:28 +01:00
William DURAND
b26ae4aac3 Added README 2011-12-22 19:43:09 +01:00
William DURAND
fbe950721b Added LICENSE 2011-12-22 19:42:52 +01:00
William DURAND
818a3321c0 [Component] Moved Filesystem class to its own component 2011-12-22 19:36:46 +01:00
Fabien Potencier
4404d6f0be merged branch stof/entity_provider_registry (PR #2928)
Commits
-------

373ab4c Fixed tests added from 2.0
9653be6 Moved the EntityFactory to the bridge
caa105f Removed useless use statement
24319bb [DoctrineBridge] Made it possible to change the manager used by the provider

Discussion
----------

[DoctrineBridge] Made it possible to change the manager used by the provider

This improves the support of several entity managers by allowing using a non-default one for the provider.

It is BC for the user as the default value for the name is ``null`` which means using the default one.

I'm preparing the PR for DoctrineBundle too

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

by stof at 2011/12/19 14:16:38 -0800

I'm wondering if the EntityFactory used to integrate the bundles with SecurityBundle should be moved to the bridge or not. Moving it (making the key and the abstract service id configurable) would allow reusing it in all Doctrine bundles instead of copy-pasting it (see the CouchDBBundle pull request linked above).
The bridge was initially meant to integrate third party libraries with the components and this class is about the SecurityBundle, not the component. But on the other hand, we already share the abstract DI extension between the bundles using the bridge.

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

by stof at 2011/12/19 14:17:48 -0800

@fabpot @beberlei thoughts ?

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

by stof at 2011/12/21 04:43:50 -0800

@fabpot @beberlei what do you thing about moving the EntityFactory to the bridge ?

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

by henrikbjorn at 2011/12/21 05:10:56 -0800

Missing mongodb bundle

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

by stof at 2011/12/21 05:52:06 -0800

@henrikbjorn I was planning to send the PR for mongodb too but the namespace change was not merged yet yesterday. And now, you want to wait for the answer to know if I need to copy-paste the factory to the mongodb bundle too or if I move it to the bridge

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

by beberlei at 2011/12/21 15:14:17 -0800

I think moving it to the Bridge makes sense if we can re-use across all the bundles then. Also it is really about integrating security with doctrine, so its a bridge topic.

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

by stof at 2011/12/22 08:39:52 -0800

I updated the PR to move the factory to the bridge. The DoctrineBundle and DoctrineCouchDBBundle PRs are updated too.

@fabpot the PR should be ready to be merged

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

by fabpot at 2011/12/22 08:53:02 -0800

Tests do not pass for me:

    ...E

    Time: 0 seconds, Memory: 14.75Mb

    There was 1 error:

    1) Symfony\Tests\Bridge\Doctrine\Security\User\EntityUserProviderTest::testSupportProxy
    Argument 1 passed to Symfony\Bridge\Doctrine\Security\User\EntityUserProvider::__construct() must implement interface Doctrine\Common\Persistence\ManagerRegistry, instance of Doctrine\ORM\EntityManager given, called in tests/Symfony/Tests/Bridge/Doctrine/Security/User/EntityUserProviderTest.php on line 89 and defined

    src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php:35
    tests/Symfony/Tests/Bridge/Doctrine/Security/User/EntityUserProviderTest.php:89

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

by stof at 2011/12/22 08:56:33 -0800

@fabpot I fixed it before your comment (thanks travis ^^). It was the test added in my other PR to 2.0 and so not updated in the original commit. I forgot it when rebasing
2011-12-22 17:59:27 +01:00
Christophe Coevoet
9653be618a Moved the EntityFactory to the bridge 2011-12-22 16:54:29 +01:00
Bart van den Burg
0a9ea2614c fixed the display of the current value in a doctrine entity type, when the current value is for example an instance of Doctrine\Orm\Proxy\Proxy and is not yet initialized 2011-12-22 16:37:13 +01:00
Christophe Coevoet
caa105fef9 Removed useless use statement 2011-12-22 16:14:18 +01:00
Christophe Coevoet
24319bb0f4 [DoctrineBridge] Made it possible to change the manager used by the provider 2011-12-22 16:14:12 +01:00
Bart van den Burg
231e79ce0f fixed entity choice list BC break 2011-12-22 10:49:27 +01:00
Fabien Potencier
473741b9db added the possibility to change a StreamedResponse callback after its creation 2011-12-22 07:58:59 +01:00
Kris Wallsmith
1b4aaa2c8e [HttpFoundation] fixed ApacheRequest
Pathinfo was incorrect when using mod_rewrite.
Added better test coverage.
2011-12-21 13:57:56 -08:00
Fabien Potencier
8717d4425e moved a test in the constructor 2011-12-21 18:53:18 +01:00
Fabien Potencier
e44b8ba521 made some cosmetic changes 2011-12-21 18:34:44 +01:00
Fabien Potencier
2af5cb5602 merged branch marekkalnik/upload-flash (PR #2938)
Commits
-------

8235848 [HttpFoundation][File] Add flv file default extension

Discussion
----------

[HttpFoundation][File] Add flv file default extension

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes (doesn't affect tests)
Fixes the following tickets: -
Todo: -

This commit adds default extension for video/x-flv mime-type, which is a Flash Video file. Lack of this definition causes File::guessExtension() return null for this type of file, which breaks uploaded file in some user cases.
2011-12-21 17:08:06 +01:00
Marek Kalnik
8235848b5b [HttpFoundation][File] Add flv file default extension 2011-12-21 16:18:42 +01:00
Muharrem Demirci
5a6c989abc FrameworkBundle: Adding test-attribute in xsd-schema to write functional-tests if using xml-configurations 2011-12-21 15:50:59 +01:00
Fabien Potencier
0038d1bac4 [HttpFoundation] added support for streamed responses
To stream a Response, use the StreamedResponse class instead of the
standard Response class:

    $response = new StreamedResponse(function () {
        echo 'FOO';
    });

    $response = new StreamedResponse(function () {
        echo 'FOO';
    }, 200, array('Content-Type' => 'text/plain'));

As you can see, a StreamedResponse instance takes a PHP callback instead of
a string for the Response content. It's up to the developer to stream the
response content from the callback with standard PHP functions like echo.
You can also use flush() if needed.

From a controller, do something like this:

    $twig = $this->get('templating');

    return new StreamedResponse(function () use ($templating) {
        $templating->stream('BlogBundle:Annot:streamed.html.twig');
    }, 200, array('Content-Type' => 'text/html'));

If you are using the base controller, you can use the stream() method instead:

    return $this->stream('BlogBundle:Annot:streamed.html.twig');

You can stream an existing file by using the PHP built-in readfile() function:

    new StreamedResponse(function () use ($file) {
        readfile($file);
    }, 200, array('Content-Type' => 'image/png');

Read http://php.net/flush for more information about output buffering in PHP.

Note that you should do your best to move all expensive operations to
be "activated/evaluated/called" during template evaluation.

Templates
---------

If you are using Twig as a template engine, everything should work as
usual, even if are using template inheritance!

However, note that streaming is not supported for PHP templates. Support
is impossible by design (as the layout is rendered after the main content).

Exceptions
----------

Exceptions thrown during rendering will be rendered as usual except that
some content might have been rendered already.

Limitations
-----------

As the getContent() method always returns false for streamed Responses, some
event listeners won't work at all:

* Web debug toolbar is not available for such Responses (but the profiler works fine);
* ESI is not supported.

Also note that streamed responses cannot benefit from HTTP caching for obvious
reasons.
2011-12-21 14:34:26 +01:00
Fabien Potencier
7ea9c5b92a merged branch stloyd/missingClientTransformer (PR #2421)
Commits
-------

49d2685 [Form] Add default validation to TextType field (and related)

Discussion
----------

[Form] Add default transformer to TextType field (and related)

Bug fix: yes&no (?)
Feature addition: yes (?)
BC break: no
Symfony2 tests pass: yes
Fixes the following tickets: #1962.

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

by stloyd at 2011/12/19 03:43:37 -0800

@fabpot ping ;-)

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

by fabpot at 2011/12/19 10:58:20 -0800

Is it really needed? I have a feeling that it enforces unneeded constraints, but I can be wrong of course.

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

by hlecorche at 2011/12/20 02:31:03 -0800

It's needed because with TextType field, and without the ValueToStringTransformer, the user data (when sending the form) can be an array !!!

For example:
- if there is a TextType field
- and if there is a MaxLengthValidator
- and if the user data (when sending the form) is an array
So the exception "Expected argument of type string, array given in src\Symfony\Component\Validator\Constraints\MaxLengthValidator.php at line 40" is thrown
2011-12-21 12:55:51 +01:00
Fabien Potencier
5803146a9e merged 2.0 2011-12-20 20:16:39 +01:00
Tobias Schultze
1eb5583168 fixes #2906 2011-12-20 18:12:37 +01:00
Fabien Potencier
34f1b5893c merged branch aerialls/webprofiler (PR #2925)
Commits
-------

b0987a3 [WebProfilerBundle] fixed toolbar height

Discussion
----------

[WebProfilerBundle] fixed toolbar height

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: none
Todo: none
2011-12-19 19:53:40 +01:00
Fabien Potencier
05285e429c merged branch dustin10/cache-clearers (PR #2857)
Commits
-------

3ae976c fixed CS
84ad40d added cache clear hook

Discussion
----------

[Cache][2.1] Added cache clear hook

Allows bundles to hook into the `cache:clear` command by using the `kernel.cache_clearer` tag instead of using the `event_dispatcher` service.

See #1884

Bug fix: No
Feature addition: Yes
Backwards compatibility break: No
Symfony2 tests pass: Yes
Fixes the following tickets: #1884
References the following tickets: #1884

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

by dustin10 at 2011/12/16 11:03:54 -0800

Rebased to squash all commits into one.

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

by lsmith77 at 2011/12/17 05:27:29 -0800

@fabpot: we figured that priorities wouldn't be needed for cleaning .. haven't tested the PR, but conceptually it looks good to me and aside from the priority stuff its modeled after the cache warners.

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

by dustin10 at 2011/12/19 09:46:26 -0800

@fabpot Updated to pass cache dir to `clear` method.

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

by dustin10 at 2011/12/19 10:02:21 -0800

@stof and @fabpot Another thought I just had. Should the `$this->getContainer()->get('cache_clearer')->clear($realCacheDir);` call in the `CacheClearCommand` be done before the warming?

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

by stof at 2011/12/19 10:03:59 -0800

indeed. the clearing should be done before the warming.

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

by dustin10 at 2011/12/19 10:19:28 -0800

Squashed all commits into one. Let me know if there is anything else.

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

by dustin10 at 2011/12/19 10:31:50 -0800

Fixed extra lines.
2011-12-19 19:52:15 +01:00
Fabien Potencier
ce41b8eafa merged branch stof/entity_provider (PR #2923)
Commits
-------

f1199c0 [DoctrineBridge] Decoupled the EntityUserProvider from the ORM

Discussion
----------

[DoctrineBridge] Decoupled the EntityUserProvider from the ORM

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

The entity provider can now be used by any Doctrine project implementing the interfaces from Doctrine Common 2.2.
2011-12-19 19:48:33 +01:00
Fabien Potencier
ddf6534cc6 merged branch stof/doctrine_choice_list (PR #2921)
Commits
-------

200ed54 [DoctrineBridge] Extracted the common type and made the choice list generic
3c81b62 [Doctrine] Cleanup and move loader into its own method
7646a5b [Doctrine] Dont allow null in ORMQueryBuilderLoader
988c2a5 Adjust check
3b5c617 [DoctrineBridge] Remove large parts of the EntityChoiceList code that were completly unnecessary (code was unreachable).
b919d92 [DoctrineBridge] Optimize fetching of entities to use WHERE IN and fix other inefficencies.
517eebc [DoctrineBridge] Refactor entity choice list to be ORM independant using an EntityLoader interface.

Discussion
----------

[DoctrineBridge] Refactor EntityChoiceList

Bug fix: no
Feature addition: yes
Backwards compatibility break: no (99%)
Symfony2 tests pass: yes

This decouples the ORM from the EntityChoiceList and makes its much more flexible. Instead of having a "query_builder" to do smart or complex queries you can now create "loader" instances which can arbitrarily help loading entities.

Additionally i removed lots of code that was unnecessary and not used by the current code.

There is a slight BC break in that the EntityChoiceList class is now accepting an EntityLoaderInterface instead of a querybuilder. However that class was nested inside the EntityType and should not be widely used or overwritten.

The abstract class DoctrineType is meant to be used as base class by other Doctrine project to share the logic by simply using a different type name and a different loader implementation.

This PR replaces #2728.

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

by beberlei at 2011/12/19 09:20:43 -0800

Thanks for doing the last refactorings, this is now fine from my side as well.
2011-12-19 19:46:30 +01:00
Julien Brochet
b0987a3c9c [WebProfilerBundle] fixed toolbar height 2011-12-19 19:44:57 +01:00
Dustin Dobervich
3ae976cd5a fixed CS 2011-12-19 12:30:32 -06:00
Dustin Dobervich
84ad40dcc8 added cache clear hook 2011-12-19 12:17:48 -06:00
Christophe Coevoet
649fa5219f [DoctrineBridge] Fixed the entity provider to support proxies 2011-12-19 18:32:21 +01:00
Christophe Coevoet
f1199c0c68 [DoctrineBridge] Decoupled the EntityUserProvider from the ORM
It can now be used by any Doctrine project implementing the interfaces
from Doctrine Common 2.2.
2011-12-19 18:20:00 +01:00
Christophe Coevoet
200ed5490b [DoctrineBridge] Extracted the common type and made the choice list generic 2011-12-19 17:53:23 +01:00
Benjamin Eberlei
3c81b62955 [Doctrine] Cleanup and move loader into its own method 2011-12-19 17:46:18 +01:00
Benjamin Eberlei
7646a5bc6d [Doctrine] Dont allow null in ORMQueryBuilderLoader 2011-12-19 17:46:09 +01:00
Benjamin Eberlei
988c2a525e Adjust check 2011-12-19 17:46:04 +01:00
Benjamin Eberlei
3b5c617ad0 [DoctrineBridge] Remove large parts of the EntityChoiceList code that were completly unnecessary (code was unreachable). 2011-12-19 17:45:59 +01:00
Benjamin Eberlei
b919d92b52 [DoctrineBridge] Optimize fetching of entities to use WHERE IN and fix other inefficencies. 2011-12-19 17:45:50 +01:00
Benjamin Eberlei
517eebcb31 [DoctrineBridge] Refactor entity choice list to be ORM independant using an EntityLoader interface. 2011-12-19 17:32:04 +01:00
Fabien Potencier
30f2be3b70 merged branch juliendidier/twig-security-class (PR #2835)
Commits
-------

60ebaaa [SecurityBundle] fix service class by adding a parameter, on twig extension

Discussion
----------

[SecurityBundle] fix service class by adding a parameter, on twig extension

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

To override the is_granted twig function, the class of TwigExtension is now set in a parameter.

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

by stof at 2011/12/10 10:38:38 -0800

First thing, you could overwrite the extension at the twig level by simply registering another twig extension with the same ``getName`` method.

And second point, replacing core Twig functions is probably one of the best way to forbid you to use third party bundles as the change will also impact their code. Do you really need to do it (especially considering that this function simply calls the security context and all the logic is in the context) ?

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

by juliendidier at 2011/12/10 15:43:08 -0800

Yes, overriding ```is_granted``` function is probably a bad example. But having it set as parameter allow you to redefine it (if you know what you are doing).
2011-12-19 08:06:39 +01:00
Fabien Potencier
e6e78f6a81 [TwigBundle] added Twig Debug extension support 2011-12-18 20:55:28 +01:00
Fabien Potencier
5d6a7d35b0 merged 2.0 2011-12-18 14:48:17 +01:00
Fabien Potencier
4316595dbb fixed CS 2011-12-18 14:42:59 +01:00
Fabien Potencier
3ba767703a merged branch stloyd/profiler_design_fix (PR #2907)
Commits
-------

d1fa8cc [WebProfiler] Fix some design glitches (closes #2867)

Discussion
----------

[WebProfiler] Fix some design glitches

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

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

by jalliot at 2011/12/17 04:54:11 -0800

Thanks @stloyd.
However it only fixes the second and third issues related in #2867. The filesystem provider bug is much more annoying!

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

by stloyd at 2011/12/17 05:38:13 -0800

@jalliot Did you cleaned profiler dir after update to latest master commit ? This is mentioned and kinda known BC break... I'm asking because I cannot reproduce this issue.

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

by jalliot at 2011/12/17 08:17:21 -0800

@stloyd It has nothing to do with your recent PR adding HTTP method as I had the bug even before that.
I've tested on a fresh Symfony (master) install (before and after the merge) and have the bug each time.
I thought maybe it was related to some of the bundles I installed but the bug occurs even in a freshly installed SE.
2011-12-18 14:39:41 +01:00
Fabien Potencier
bbec4bb32b merged branch canni/fix_type_hint (PR #2912)
Commits
-------

e417153 [BugFix][Console] Fix type hint for output formatter

Discussion
----------

[BugFix][Console] Fix type hint for OutputFormatter in OutputStream constructors

I consider this as a bug, cause it disables ability to change formatter implementation

BugFix: yes
Feature addition: no
Sysmfony2 test pass: yes

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

by fabpot at 2011/12/18 00:23:05 -0800

It's not a bug fix as existing code that extend these classes will now fail.

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

by stof at 2011/12/18 03:51:38 -0800

@fabpot does the constructor enforces its signature for child classes ? I don't think so.
2011-12-18 14:37:49 +01:00
Fabien Potencier
d08c2ef8b4 removed unused use statements 2011-12-18 14:36:25 +01:00
Fabien Potencier
6504d05804 fixed CS 2011-12-18 14:36:25 +01:00
Fabien Potencier
3f4d718c5b [Console] fixed previous merge 2011-12-18 14:36:20 +01:00
Fabien Potencier
a13d2270ed merged branch andrewtch/plain-commands (PR #2914)
Commits
-------

2181f6c Fixed space
5f98b73 Raw output of commands in app/console list

Discussion
----------

Raw output of commands in app/console list

Breaks compatibility: no
Feature addition: yes
Symfony test pass: yes, with appropriate modifications

Simply, it adds ```--raw``` parameter to ```app/console list``` command. With this key, ```list``` returns simply command names.

This is mainly useful in command completion / embedding, like https://github.com/andrewtch/oh-my-zsh/tree/symfony2-completion/plugins/symfony2 ; I know about the presence of --xml, but in some environments (like shell scripts) parsing XML could be a problem.

This is an unobtrusive feature addition that is not likely to add problems in future.

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

by andrewtch at 2011/12/18 04:09:58 -0800

fixed
2011-12-18 14:28:52 +01:00
Fabien Potencier
997f354d53 tweaked the README files 2011-12-18 14:22:28 +01:00
Andrew Tch
2181f6c8b6 Fixed space 2011-12-18 14:03:17 +02:00
Fabien Potencier
0f2caf1106 merged branch lsmith77/component_readmes (PR #2561)
Commits
-------

1e370d7 typo fix
93d8d44 added some more infos about Config
27efd59 added READMEs for the bridges
34fc866 cosmetic tweaks
d6af3f1 fixed README for Console
6a72b8c added basic README files for all components

Discussion
----------

added basic README files for all components and bridges

heavily based on http://fabien.potencier.org/article/49/what-is-symfony2 and the official Symfony2 documentation

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

by jmikola at 2011/11/03 13:36:07 -0700

Great work. For syntax highlighting on the PHP snippets, you could add "php" after the three backticks.

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

by lsmith77 at 2011/11/03 13:41:29 -0700

done

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

by stealth35 at 2011/11/03 13:49:31 -0700

Nice job, but you also need to add `<?php`

ex :

``` php
<?php
use Symfony\Component\DomCrawler\Crawler;

$crawler = new Crawler();
$crawler->addContent('<html><body><p>Hello World!</p></body></html>');

print $crawler->filter('body > p')->text();
```

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

by lsmith77 at 2011/11/03 13:56:57 -0700

done

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

by ericclemmons at 2011/11/03 19:57:57 -0700

@lsmith77 Well done!  This makes consumption of individual components that much easier, *especially* now that `composer.json` files have been added.

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

by lsmith77 at 2011/11/04 01:18:23 -0700

ok .. fixed the issues you mentioned @fabpot

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

by lsmith77 at 2011/11/11 15:00:27 -0800

@fabpot anything else left? seems like an easy merge .. and imho there is considerable benefit for our efforts to spread the word about the components with this PR merged.

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

by drak at 2011/11/11 18:54:13 -0800

You know, it might be a nice idea to put a link to the documentation for each component if there is some at symfony.com

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

by lsmith77 at 2011/11/12 00:59:14 -0800

i did that in some. but i might have missed a few places.
On 12.11.2011, at 03:54, Drak <reply@reply.github.com> wrote:

> You know, it might be a nice idea to put a link to the documentation for each component if there is some at symfony.com
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/2561#issuecomment-2715762

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

by breerly at 2011/11/21 10:28:36 -0800

Pretty excited with this.

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

by dbu at 2011/11/24 00:02:50 -0800

is there anything we can help with to make this ready to be merged?

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

by lsmith77 at 2011/12/18 02:39:23 -0800

@fabpot: seriously .. if you are not going to deliver something "better" and don't provide a reason what is wrong with this .. then its beyond frustrating. i obviously do not claim that these README's are perfect (and certainly still no replacement for proper documentation), but I do claim that in their current form they are a radical step forward to potential users of the Symfony2 components.
2011-12-18 12:42:02 +01:00
Fabien Potencier
7b619e7b32 added nl2br use as it is now part of Twig core 2011-12-18 12:39:28 +01:00
Andrew Tch
5f98b73e7c Raw output of commands in app/console list 2011-12-18 01:19:10 +02:00
Dariusz Górecki
e417153e49 [BugFix][Console] Fix type hint for output formatter 2011-12-17 22:55:00 +01:00
Dariusz Górecki
cab03344d7 [Console] Enable stderr support
Bug fix: no
Feature addition: yes
BC break: no
Symfony2 test pass: yes, but some tests had to be modified

Now all error messages goes to stdout, we cannot separate error
from normal behaviour, this enables writing to stderr stream,
so scripts ran e.g. from cron, can benefit from this well known concept.

There are 2 much nicer implememntations, but:
1) First requires to break the `@api` tagged interfaces.
2) Second requires rewrite of `execute` command declatarion all commands in bundles.
2011-12-17 18:34:12 +01:00
Joseph Bielawski
d1fa8cc1cc [WebProfiler] Fix some design glitches (closes #2867) 2011-12-17 11:44:50 +01:00
Fabien Potencier
108cd50ac9 merged branch stloyd/set-cookie-fix (PR #2889)
Commits
-------

5c41ec9 [HttpKernel][Client] Only simple (name=value without any other params) cookies can be stored in same line, so lets add every as standalone to be compliant with rfc6265

Discussion
----------

[HttpKernel][Client] Set cookie fix

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

Only simple cookies can be stored in same line:

* Used by now (__wrong__): `Set-Cookie: name1=value, name2=value`
* Proper according to RFCs: `Set-Cookie: name1=value; name2=value`

So lets add every as standalone ([next header](http://tools.ietf.org/html/rfc6265#section-3.1)) to be compliant with [RFC6265](http://tools.ietf.org/html/rfc6265). This fixes #2881.
2011-12-17 11:09:03 +01:00
Fabien Potencier
62e37dd807 merged branch stloyd/local_stub_cs (PR #2890)
Commits
-------

ed353da [Locale][Stub] Fixed CS

Discussion
----------

[Locale][Stub] Fixed CS

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

Just fixed code according to Symfony2 CS.
2011-12-17 11:06:15 +01:00
Fabien Potencier
be4e5388ef [FrameworkBundle] fix a functional test 2011-12-17 11:05:18 +01:00
Fabien Potencier
43a51c5d7f Merge branch '2.0'
* 2.0:
  fixed functional tests so that the cache/logs are specific to one version of Symfony (to avoid weird side effects)
  [FrameworkBundle] Prove client insulation and non-insulation works in session tests.
  [FrameworkBundle] Add tests to prove functional testing works with simultaneous clients.
  [FrameworkBundle] Small changes to test setup.
  [DoctrineBundle] Fixed incorrectly shown params
  [SwiftmailerBundle] fixed the send email command when the queue does not extends Swift_ConfigurableSpool
2011-12-17 11:02:23 +01:00
Fabien Potencier
f03692a507 fixed functional tests so that the cache/logs are specific to one version of Symfony (to avoid weird side effects) 2011-12-17 11:02:17 +01:00
Fabien Potencier
4a88287b29 merged branch stof/doctrine_profiling (PR #2895)
Commits
-------

8713c2d [DoctrineBridge][DoctrineBundle] Refactored the DBAL logging

Discussion
----------

[DoctrineBridge][DoctrineBundle] Refactored the DBAL logging

This allows enabling the logging and the profiling separately. This is useful for instance when doing batch processing leading to memory issue because of the profiling. In such case, the only solution currently is to disable the logging totally whereas disabling only the use of the profiler would allow seeing the queries in the logs (and the profiles are not collected in the CLI anyway).

I'm not sure about the place where the ``Stopwatch`` should be used. Keeping it in the ``DbalLogger`` with Monolog was the easy way as it allows using the DBAL class directly to collect queries for the profiler but technically the ``Stopwatch`` is used by the profiler.

the bundle changes are part of the PR to avoid letting the bundle in a broken state. I will also submit them to the doctrine/DoctrineBundle repo

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

by fabpot at 2011/12/16 02:33:05 -0800

Tests do not pass for me (even after upgrading the Doctrine deps to their latest versions):

    There was 1 error:

    1) Symfony\Bundle\DoctrineBundle\Tests\ContainerTest::testContainer
    Argument 1 passed to Doctrine\DBAL\Logging\LoggerChain::addLogger() must implement interface Doctrine\DBAL\Logging\SQLLogger, instance of Doctrine\Dbal\Logging\DebugStack given

    vendor/doctrine-dbal/lib/Doctrine/DBAL/Logging/LoggerChain.php:39
    src/Symfony/Component/DependencyInjection/ContainerBuilder.php:777
    src/Symfony/Component/DependencyInjection/ContainerBuilder.php:349
    src/Symfony/Bundle/DoctrineBundle/Tests/ContainerTest.php:22

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

by stof at 2011/12/16 04:24:46 -0800

this is weird. DebugStack implements the interface, and the test passes for me

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

by fabpot at 2011/12/16 05:30:11 -0800

actually, the test pass when I run the `ContainerTest.php` file alone, but fail when I'm running the whole test suite.

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

by stof at 2011/12/16 05:39:15 -0800

I'm not able to run the whole testsuite. With intl enabled, it fails before the first test somewhere in the Locale component tests (Intl seems to be broken on 5.3.8 on windows as using the constructor of the intl classes gives me ``null`` in the variable). And after disabling intl, I got an error about allowed memory size exhausted during the EntityType tests

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

by stloyd at 2011/12/16 05:42:09 -0800

@stof And here goes Travis with help! ;-)

Just log in there, enable hook for your symfony repo, force an push, and watch result at: http://travis-ci.org/#!/stof/symfony

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

by stof at 2011/12/16 05:47:57 -0800

Note: when running only the testsuite for bundles, I also get such an error after about 450 of the 500 tests. It seems like the garbage collector does not clean the memory between tests...

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

by stof at 2011/12/16 05:52:08 -0800

anyway, the error seems really weird as the class implements the interface. I don't see how it could be passed without implementing it

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

by stof at 2011/12/16 06:10:43 -0800

@stloyd Travis allows me to see that this issue is not specific to @fabpot's computer. But it does not allow me to debug the test as I only get the result of the test, which does not make any sense
2011-12-17 10:46:03 +01:00
Kris Wallsmith
d7712a3e2a [Process] added ProcessBuilder
This class was copied from Assetic.
2011-12-16 11:17:43 -08:00
Drak
9b8cdabf16 [FrameworkBundle] Prove client insulation and non-insulation works in session tests. 2011-12-16 14:30:02 +00:00
Drak
ce66548782 [FrameworkBundle] Add tests to prove functional testing works with simultaneous clients. 2011-12-16 14:29:52 +00:00
Drak
ff0412a2bd [FrameworkBundle] Small changes to test setup. 2011-12-16 20:45:29 +05:45
Christophe Coevoet
8713c2d540 [DoctrineBridge][DoctrineBundle] Refactored the DBAL logging
This allows enabling the logging and the profiling separately for instance
when doing batch processing leading to memory issue due to the profiling.
2011-12-16 14:57:00 +01:00
Fabien Potencier
9a0aefd192 [SwiftmailerBundle] added support for the new memory spool 2011-12-16 10:38:07 +01:00
Arnout Boks
662fdc3a0e [DoctrineBundle] Fixed incorrectly shown params
After the changes in #2733, the parameters to Doctrine queries were
always shown as 'Array' in the profiler. This commit puts back the
yaml_encode that is still needed after all.
2011-12-16 08:08:01 +01:00
Fabien Potencier
aa9b86ed75 [HttpKernel] added the terminate() call to the Client 2011-12-15 19:17:41 +01:00
Fabien Potencier
9e38d6a18f [SwiftmailerBundle] fixed the send email command when the queue does not extends Swift_ConfigurableSpool 2011-12-15 19:10:17 +01:00
Fabien Potencier
2750adb52d Merge branch '2.0'
* 2.0:
  [FrameworkBundle] Added functional tests.
  [Form] Added missing use statements (closes #2880)
  [Console] Improve input definition output for Boolean defaults
  [SecurityBundle] Changed environment to something unique.
  2879: missing space between catch and the brace
  #2688: Entities are generated in wrong folder (doctrine:generate:entities Namespace)
  [TwigBundle] Fix the exception message escaping
2011-12-15 18:17:38 +01:00
Fabien Potencier
2c3672bff8 [HttpKernel] added request and response as arguments to the TerminableInterface::terminate() method 2011-12-15 18:16:29 +01:00
Fabien Potencier
abad85cbc4 merged branch Seldaek/post_response (PR #2791)
Commits
-------

7c2f11f Merge pull request #1 from pminnieur/post_response
9f4391f [HttpKernel] fixed DocBlocks
2a61714 [HttpKernel] added PostResponseEvent dispatching to HttpKernel
915f440 [HttpKernel] removed BC breaks, introduced new TerminableInterface
7efe4bc [HttpKernel] Add Kernel::terminate() and HttpKernel::terminate() for post-response logic

Discussion
----------

[HttpKernel] Add Kernel::terminate() and HttpKernel::terminate() for post-response logic

This came out of a discussion on IRC about doing stuff post-response, and the fact that right now there is no best practice, and it basically requires adding code after the `->send()` call.

It's an attempt at fixing it in an official way. Of course terminate() would need to be called explicitly, and added to the front controllers, but then it offers a standard way for everyone to listen on that event and do things without slowing down the user response.

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

by stof at 2011/12/06 02:41:26 -0800

We discussed it on IRC and I suggested a way to avoid the BC break of the interface: adding a new interface (``TerminableInterface`` or whatever better name you find) containing this method.
HttpKernel, Kernel and HttpCache can then implement it without breaking the existing apps using the component (Kernel and HttpCache would need an instanceof check to see if the inner kernel implements the method)

For Symfony2 users it will mean they have to change their front controller to benefit from the new event of course, but this is easy to do.

Btw, Silex can then be able to use it without *any* change for the end users as it can be done inside ``Application::run()``

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

by pminnieur at 2011/12/06 11:47:03 -0800

@Seldaek: I opened a pull request so that the discussion on IRC is fulfilled and no BC breaks exist: https://github.com/Seldaek/symfony/pull/1/files

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

by fabpot at 2011/12/07 07:59:49 -0800

Any real-world use case for this?

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

by Seldaek at 2011/12/07 08:10:31 -0800

Doing slow stuff after the user got his response back without having to implement a message queue. I believe @pminnieur wanted to use it to send logs to loggly?

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

by pminnieur at 2011/12/07 09:08:41 -0800

Its a good practice to defer code execution without the introduction of a new software layer (like gearman, amqp, whatever tools people use to defer code execution) which may be way too much just for the goal of having fast responses, whatever my code does.

My real world use case which made me miss this feature the first time:

 > I have a calendar with a scheduled Event. For a given period of time, several Event entities will be created, coupled to the scheduled event (the schedule Event just keeps track of `startDate`, `endDate` and the `dateInterval`). Let's say we want this scheduled Event to be on every Monday-Friday, on a weekly basis, for the next 10 years.

This means I have to create `10*52*5` Event entities before I could even think about sending a simple redirect response. If I could defer code execution, I'd only save the scheduled Event, send the redirect response and after that, I create the `10*52*5` entities.

The other use case was loggly, yes. Sending logging data over the wire before the response is send doesn't make sense in my eyes, so it could be deferred after the response is send (this especially sucks if loggly fails and i get a 500 --the frontend/public user is not interested in a working logging facility, he wants his responses).

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

by mvrhov at 2011/12/07 10:07:03 -0800

This would help significantly, but the real problem, that your process is busy and unavailable for the next request, is still there.

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

by fabpot at 2011/12/07 10:15:18 -0800

I think this is the wrong solution for a real problem.

Saying "Its a good practice to defer code execution without the introduction of a new software layer" is just wrong.

It is definitely a good practice to defer code execution, but you should use the right tool for the job.

I'm -1.

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

by pminnieur at 2011/12/07 10:25:44 -0800

It should just give a possibility to put unimportant but heavy lifting code behind the send request with ease. With little effort people could benefit from the usage of `fastcgi_finish_request` without introducing new software, using `register_shutdown_function` or using `__destruct `(which works for simple things, but may act weird with dependencies).

It should not simulate node.js ;-) I agree that the real problem is not solved, but small problems could be solved easily. I personally don't want to setup RabbitMQ or whatever, maintain my crontab or any other software that may allow me to defer code execution.

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

by Seldaek at 2011/12/08 01:08:32 -0800

@fabpot: one could say that on shared hostings it is still useful because they generally don't give you gearman or \*MQs. Anyway I think it'd be nice to really complete the HttpKernel event cycle.

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

by pminnieur at 2011/12/08 01:48:57 -0800

not only on shared hostings, sometimes teams/projects just don't have the resources or knowledge or time to setup such an infrastructure.

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

by videlalvaro at 2011/12/08 01:53:06 -0800

I can say we used `fastcgi_finish_request` quite a lot at poppen with symfony 1.x. It certainly helped us to send data to Graphite, save XHProf runs, send data to RabbitMQ, and so on.

For example we used to connect to RabbitMQ and send the messages _after_ calling `fastcgi_finish_request` so the user never had to wait for stuff like that.

Also keep in mind that if you are using Gearman or RabbitMQ or whatever tool you use to defer code execution… you are not deferring the network connection handling, sending data over the wire and what not. I know this is obvious but is often overlooked.

So it would be nice to have an standard way of doing this.

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

by henrikbjorn at 2011/12/13 01:42:23 -0800

This could have been useful recently while implementing a "Poor mans cronjob" system. The solution was to do a custom Response object and do the stuff after send have been called with a Connection: Close header and ignore_user_abort(); (Yes very ugly)
2011-12-15 17:53:42 +01:00
Joseph Bielawski
49d2685bff [Form] Add default validation to TextType field (and related) 2011-12-15 13:49:39 +01:00
Joseph Bielawski
ed353da164 [Locale][Stub] Fixed CS 2011-12-15 13:03:21 +01:00
Joseph Bielawski
5c41ec9e4f [HttpKernel][Client] Only simple (name=value without any other params) cookies can be stored in same line, so lets add every as standalone to be compliant with rfc6265 2011-12-15 11:35:58 +01:00
Fabien Potencier
75dfc7945a merged branch drak/securitybundle_test (PR #2888)
Commits
-------

62f3dc4 [SecurityBundle] Changed environment to something unique.

Discussion
----------

[SecurityBundle] Fix name clash with functional tests

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

Functional tests need a unique environment or it will produce class redeclare errors when multiple bundles are functional tested at the same time.
2011-12-15 11:31:09 +01:00
Drak
ba7d8104f8 [FrameworkBundle] Added functional tests.
Added functional tests to prove session attributes and flashes in practice.
2011-12-15 15:49:20 +05:45
Joseph Bielawski
8069ea69dd [Form] Added missing use statements (closes #2880) 2011-12-15 10:01:35 +01:00
Jeremy Mikola
d5a1343c29 [Console] Improve input definition output for Boolean defaults
Previously, Boolean defaults were printed as strings, which lead to true and false being printed as "1" and "", respectively. With this change, they are now printed as "true" and "false".
2011-12-15 01:07:36 -05:00
Drak
62f3dc4c49 [SecurityBundle] Changed environment to something unique.
If you run functional tests from different bundles you it will cause a redeclare error
because the DIC appKernel name is not unique.
2011-12-15 05:36:58 +00:00
Fabien Potencier
b7c7ed4791 merged branch lsmith77/serializer_interface (PR #2530)
Commits
-------

0776b50 removed supports(De)Serializiation()
72b9083 SerializerAwareNormalizer now only implements SerializerAwareInterface
97389fa use Serializer specific RuntimeException
cb495fd added additional unit tests for deserialization
967531f fixed various typos from the refactoring
067242d updated serializer tests to use the new interfaces
d811e29 CS fix
351eaa8 require a (de)normalizer inside the (de)normalizable interfaces instead of a serializer
c3d6123 re-added supports(de)normalization()
078f7f3 more typo fixes
c3a711d abstract class children should also implement dernormalization
2a6741c typo fix
d021dc8 refactored encoder handling to use the supports*() methods to determine which encoder handles what format
f8e2787 refactored Normalizer interfaces
58bd0f5 refactored the EncoderInterface
b0daf35 split off an EncoderInterface and NormalizerInterface from SerializerInterface

Discussion
----------

[Serializer] split off an EncoderInterface and NormalizerInterface from SerializerInte

Bug fix: no
Feature addition: no
Backwards compatibility break: yes (but not inside a stable API)
Symfony2 tests pass: ![Build Status](https://secure.travis-ci.org/lsmith77/symfony.png?branch=serializer_interface)
Fixes the following tickets: #2153

The purpose is to make it easier for other implementations that only implement parts of the interface due to different underlying approaches like the JMSSerializerBundle.

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

by schmittjoh at 2011/11/01 03:36:17 -0700

Actually, you can keep the current interface and I will just provide an adapter, sth like the following:

```php
<?php

class SymfonyAdapter implements SymfonyInterface
{
    public function __construct(BundleInterface $serializer) { /* ... */ }
    // symfony serializer methods mapped to bundle methods
}
```
I like to provide an adapter instead of implementing the interface directly since the bundle can be used standalone right now, and I don't want to add a dependency on the component just for the sake of the interface.

However, I do not completely see the purpose of the component. When would someone be recommended to use it? Everything the component does, the bundles does at the same level with the same complexity or simplicity (however you want to view that).

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

by lsmith77 at 2011/11/01 03:40:55 -0700

standalone in what way? you mean even out of the context of Symfony? In that context imho you should ship that code outside of a Bundle.

Regardless, how will that adaptor work? How would you implement methods like ``getEncoder()``? Afaik you can't and this is what this PR is about, splitting the interface to enable people to more finely specify what they provide.

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

by schmittjoh at 2011/11/01 04:03:56 -0700

I would just throw exceptions when something is not supported.

The more important question though is what is the goal of the component in the long-term, i.e. what problems is it supposed to solve, or in which cases should it be used?

Because right now it seems to me - correct me if I'm wrong - that the only purpose is that people don't have to install an extra library. However, that might even be frustrating for users because they need to migrate their code to the bundle as soon as they need to customize the serialization process which you need in 99% of the cases. For deserialization, the situation in the component is even worse. So, if my assessment is correct here (i.e. component to get started fast, if you need more migrate to the bundle), I think it would be better and less painful to have them start with the bundle right away.

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

by lsmith77 at 2011/11/01 04:15:10 -0700

Well then imho it would be better to split the interface.

I think the serializer component is sufficient for many situations and imho its easier to grok. Furthermore the normalizer/encoder concept it can be used in situations where JMSSerializerBundle cannot be used.

And splitting up the interfaces has exactly the goal of reducing the "frustrations" caused by out growing the the component.

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

by schmittjoh at 2011/11/01 04:29:39 -0700

I don't agree, but it's a subjective thing anyway.

So, whatever interface you come up with (preferably as few methods as possible), I will provide an adapter for it.

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

by fabpot at 2011/11/07 08:45:25 -0800

What's the status of this PR?

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

by lsmith77 at 2011/11/07 10:28:14 -0800

from my POV its good to go. but would like a nod from someone else in terms of the naming of the new interfaces

On 07.11.2011, at 17:45, Fabien Potencier <reply@reply.github.com> wrote:

> What's the status of this PR?
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/2530#issuecomment-2655889

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

by stof at 2011/11/08 11:37:40 -0800

@lsmith77 what about doing the same for the ``NormalizerInterface`` instead of adding a new interface with a confusing name ? The Serializer class could implement ``Normalizer\NormalizerInterface`` by adding the 2 needed methods instead of duplicating part of the interface.

The next step is to refactor the Serializer class so that it choose the encoder and the decoder based on the ``support*`` methods. But this could probably be done in a separate PR.

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

by lsmith77 at 2011/11/08 11:51:27 -0800

yeah .. i wanted to do that once we are in agreement on the encoder stuff. question then is if we should again split off Denormalization. i guess yes.

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

by lsmith77 at 2011/11/08 12:06:34 -0800

ok done ..

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

by lsmith77 at 2011/11/08 12:59:51 -0800

i guess the next big task is to add more tests .. had to fix way too few unit tests with all this shuffling around .. will also help validating the concept. i should also test this out in a production application.

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

by lsmith77 at 2011/11/14 13:27:48 -0800

@ericclemmons can you also have a look at this PR and potentially help me adding tests?

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

by fabpot at 2011/12/07 07:32:06 -0800

@lsmith77: Is it ready to be merged? Should I wait for more unit tests?

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

by lsmith77 at 2011/12/07 07:34:56 -0800

If you merge it I am afraid I might get lazy and not write tests. This is why I changed the topic to WIP. I promise to finish this on the weekend.

Note however I was planning to write the tests for 2.0 and send them via a separate PR.
Once that PR is merged into 2.0 and master. I would then refactor them to work for this PR.
This way both 2.0 and master will have tests.

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

by fabpot at 2011/12/07 07:42:15 -0800

@lsmith77: sounds good. Thanks.

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

by lsmith77 at 2011/12/11 12:02:12 -0800

@fabpot ok i am done from my end.
@schmittjoh would be great if you could look over the final interfaces one time and give your blessing that you will indeed be able to provide implementations for these interfaces inside JMSSerializerBundle (even if just via an adapter)

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

by stof at 2011/12/12 12:43:49 -0800

@schmittjoh can you take a look as requested by @lsmith77 ?

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

by schmittjoh at 2011/12/13 03:33:23 -0800

Are the supports methods necessary? This is what I'm using in the bundle:
https://github.com/schmittjoh/JMSSerializerBundle/blob/master/Serializer/SerializerInterface.php

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

by lsmith77 at 2011/12/13 04:08:49 -0800

@schmittjoh without them determining if something is supported will always require an exception, which is pretty expensive. especially if one iterates over a data structure this can cause a lot of overhead.

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

by schmittjoh at 2011/12/13 04:24:18 -0800

my question was more if you have a real-world use case where this is useful?

On Tue, Dec 13, 2011 at 1:08 PM, Lukas Kahwe Smith <
reply@reply.github.com
> wrote:

> @schmittjoh without them determining if something is supported will always
> require an exception, which is pretty expensive. especially if one iterates
> over a data structure this can cause a lot of overhead.
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/2530#issuecomment-3122157
>

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

by lsmith77 at 2011/12/13 04:28:08 -0800

yes .. this serializer .. since it traverses the tree and decides what is the current normalizer one by one (aka not via visitors as in your implementation). without the supports*() methods it would need to have the normalizer throw exceptions, but this is not exceptional, its the normal code flow to have to iterate to find the correct normalizer.

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

by schmittjoh at 2011/12/13 04:30:36 -0800

can we split it off into a second interface?

On Tue, Dec 13, 2011 at 1:28 PM, Lukas Kahwe Smith <
reply@reply.github.com
> wrote:

> yes .. this serializer .. since it traverses the tree and decides what is
> the current normalizer one by one (aka not via visitors as in your
> implementation). without the supports*() methods it would need to have the
> normalizer throw exceptions, but this is not exceptional, its the normal
> code flow to have to iterate to find the correct normalizer.
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/2530#issuecomment-3122315
>

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

by lsmith77 at 2011/12/13 04:33:27 -0800

hmm .. i guess we could .. these methods in a way are implementation specific and are mainly public because its different objects interacting with each other, though for users of the lib they can also be convenient at times.

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

by lsmith77 at 2011/12/14 09:13:53 -0800

ok i reviewed things again and just removed those two methods, since the possibility for these methods to be feasible is too tied to the implementation and for this particular implementation supportsEncoding() and supportsDecoding() are still available.

so all ready to be merged ..

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

by lsmith77 at 2011/12/14 09:15:44 -0800

hmm i realized one thing just now:
cb495fd7a3

that commit should also be included in 2.0 .. i am not sure what the most elegant way is to make that happen ..

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

by fabpot at 2011/12/14 10:10:16 -0800

@lsmith77: commit cb495fd7a3 cannot be cherry picked in 2.0 as is as the tests do not pass:  "Fatal error: Call to undefined method Symfony\Component\Serializer\Serializer::supportsDenormalization() in tests/Symfony/Tests/Component/Serializer/SerializerTest.php on line 150"

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

by lsmith77 at 2011/12/14 10:11:55 -0800

ah of course .. i just removed that method :) .. then never mind .. all is well.
2011-12-14 19:34:07 +01:00
Fabien Potencier
2312f93b77 merged branch alexandresalome/fix-exception-new-line (PR #2870)
Commits
-------

f3e92c4 [TwigBundle] Fix the exception message escaping

Discussion
----------

[2.0][TwigBundle] Fix exception new line

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
2011-12-14 19:17:17 +01:00
Fabien Potencier
a6cdddd716 merged 2.0 2011-12-14 19:13:35 +01:00
lsmith77
0776b50cf6 removed supports(De)Serializiation() 2011-12-14 18:10:48 +01:00
Arno Geurts
7ac43fc91c 2879: missing space between catch and the brace 2011-12-14 12:20:07 +01:00
Arno Geurts
0900ecc895 #2688: Entities are generated in wrong folder (doctrine:generate:entities Namespace) 2011-12-14 11:19:02 +01:00
alexandresalome
f3e92c4cc1 [TwigBundle] Fix the exception message escaping 2011-12-14 00:31:21 +01:00
Fabien Potencier
9641c55d16 merged branch RapotOR/2.0-PR2504-squashed (PR #2868)
Commits
-------

4d64d90 Allow empty result; change default *choices* value to **null** instead of **array()**. - added *testEmptyChoicesAreManaged* test - `null` as default value for choices. - is_array() used to test if choices are user-defined. - `null` as default value in __construct too. - `null` as default value for choices in EntityType.

Discussion
----------

[Doctrine][Bridge] EntityType: Allow empty result; default `choices` value changed to null

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

- added *testEmptyChoicesAreManaged* test
- `null` as default value for choices.
-  is_array() used to test if choices are user-defined.
- `null` as default value in __construct too.
- `null` as default value for choices in EntityType.

I squashed commits from PR #2504 as requested.
2011-12-13 22:28:46 +01:00
Cédric Lahouste
4d64d90f13 Allow empty result; change default *choices* value to **null** instead of **array()**.
- added *testEmptyChoicesAreManaged* test
- `null` as default value for choices.
- is_array() used to test if choices are user-defined.
- `null` as default value in __construct too.
- `null` as default value for choices in EntityType.
2011-12-13 18:12:20 +01:00
Fabien Potencier
cfe2640877 merged branch ocubom/fix-absolute-paths-detection (PR #2809)
Commits
-------

600066e [Templating] fixed 'scheme://' not detected as absolute path
e6f2687 [HttpKernel] fixed 'scheme://' not detected as absolute path
b50ac5b [Config] fixed 'scheme://' not detected as absolute path

Discussion
----------

[Config][HttpKernel][Templating] 'scheme://' paths not detected as absolute

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

The method ```isAbsolutePath``` does not detect URL schemes as absolute. This makes imposible the use of wrappers to access remote files or the use of files (mostly configuration or templates) stored on phar archives (uses the scheme ```phar://``` in the path).

Three classes implement this methods: ```Symfony\Component\Config\FileLocator```, ```Symfony\Component\HttpKernel\Util\Filesystem``` and ```Symfony\Component\Templating\Loader\FilesytemLoader```. All are updated. Also includes a new check  on all related tests (```Symfony\Component\HttpKernel\Util\Filesystem``` lacks of test).
2011-12-13 17:41:54 +01:00
Fabien Potencier
12ea7568a0 merged branch pulzarraider/explode_optimalisation (PR #2782)
Commits
-------

cd24fb8 change explode's limit parameter based on known variable content
b3cc270 minor optimalisations for explode

Discussion
----------

[FrameworkBundle][CssSelector][HttpFoundation][HttpKernel] [Security][Validator] Minor optimizations for "explode" function

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

I added limit parameter in some places, where it may be usefull. I did not check the context of what values may have been exploded. So to not break anything, I added +1 to limit parameter.

If you find out that in some places limit (or limit+1) is not important or meaningless, write a comment please and I will fix it.

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

by fabpot at 2011/12/07 06:56:49 -0800

Adding +1 just to be sure to not break anything is clearly something we won't do. What is the benefit of doing that anyway?

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

by pulzarraider at 2011/12/07 13:50:24 -0800

The main idea of making this PR was to notify about some places that may run faster with just adding one parameter to explode function.

If in code is someting like: ```list($a, $b) = explode(':', $s);```
Function ```explode``` will create n-items (depends on ```$s```), but we need in code only the first two items. There is no reason to let ```explode``` create more items in memory that are NEVER used in our code. The limit parameter is there for these situations, so let's use it.

I know that it is microoptimization and may look unimportant, but we are writing a framework - so people expect that code will be as fast as possible without this kind of mistakes.

As I've noticed above, I know that +1 is not ideal solution, but the fastest without debugging the code. I expect that someone (with good knowledge of that code) will look at it and write in comments if variable may contain 1 comma (dot or someting on what is doing the explode) or maybe 2 in some situations or more.

Anyway, +1 will not break anything, because same items are created as it is now, but no unnecessary item is created.

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

by fabpot at 2011/12/07 23:14:59 -0800

I'm +1 for adding the number to avoid problems but I'm -1 on the optimization side of things as it won't optimize anything.

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

by helmer at 2011/12/08 12:46:49 -0800

*.. The main idea of making this PR was to notify about some places that **may** run faster ..*

I am also unsure the optimization is really an optimization, care to benchmark (with meaningful inputs)? As for the limit+1 thing, why would you want to +1 it? The number of ``list`` arguments should always reflect the ``limit`` parameter, no?

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

by pulzarraider at 2011/12/08 23:11:34 -0800

@helmer please try this simple benchmark:

```
<?php

header('Content-Type: text/plain; charset=UTF-8');
define('COUNT', 10000);

$source_string = 'aaaaaaaaaaaaaaaaaaaa:bbbbbbbbbbbbbbbbbbbbb:cccccccccccccccccccccccc:dddddddddddddddddddddd:eeeeeeeeeeeeeeeeeeeeeeeee:fffffffffffffffffffffffffff';

$start = microtime(true);
for ($i = 0; $i < COUNT; $i++) {
    list($a, $b) = explode(':', $source_string);
}
$end = microtime(true)-$start;
echo 'without limit: '.$end."\n";

$start = microtime(true);
for ($i = 0; $i < COUNT; $i++) {
    list($a, $b) = explode(':', $source_string, 2);
}
$end = microtime(true)-$start;
echo 'with limit:    '.$end."\n";
```

My results are:

```
without limit: 0.057228803634644
with limit:    0.028676986694336
```
That is 50% difference (with APC enabled).  Of course the result depends on the length of source string and if it's too short, the difference may be none or very very small. That's why I said, that it **may** run faster and is just a micro optimization.

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

by pulzarraider at 2011/12/08 23:18:12 -0800

@helmer And why +1? It depends on a code:

```
$source_string = 'aaaaaaaaaaaaaaaaaaaa:bbbbbbbbbbbbbbbbbbbbb:cccccccccccccccccccccccc';
list($a, $b) = explode(':', $source_string, 2);
var_dump($a, $b);
```

and

```
$source_string = 'aaaaaaaaaaaaaaaaaaaa:bbbbbbbbbbbbbbbbbbbbb:cccccccccccccccccccccccc';
list($a, $b) = explode(':', $source_string, 3);
var_dump($a, $b);
```
gives different results. That's why the content of the variable must be known.

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

by helmer at 2011/12/09 00:08:28 -0800

@pulzarraider Thanks for the benchmark, seems like a gain enough. Although, we are more likely having a scenario of:
``explode(':', 'a🅱️c')`` vs ``explode(':', 'a🅱️c', 3)`` with a ``COUNT`` of 10, where the difference is not even in microseconds anymore :)

The limit addition alters the behaviour though, ie suddenly you can define a controller [logical name](http://symfony.com/doc/current/book/routing.html#controller-string-syntax) as ´´AcmeBlogBundle:Blog:show:something``, and things go downhill from there on.

All that aside, I'm +1 for setting the limit to the exact number of ``list`` parameters, but certainly not number+1, this is just too wtfy (as you said, this was a safety thing, but I reckon for this PR to be merged it needs to be +0).

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

by drak at 2011/12/09 08:28:58 -0800

Overall `list()` is ugly as it's not very explicit.  Even though it would mean extra lines, it's better to `explode()` then explicitly assign variables:

```
$parts = explode(':', $foo);
$name = $parts[0];
$tel = $parts[1];
```

`list()` is one of those bad relics from the PHP past...

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

by fabpot at 2011/12/11 10:07:47 -0800

@drak: why is `list` not explicit? It is in fact as explicit as the more verbose syntax you propose.

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

by pulzarraider at 2011/12/11 13:08:50 -0800

@drak: I agree with @fabpot. In speech of benchmarks ```list``` is faster then using a helper variable.

@fabpot, @helmer I've changed explode's limit to be correct (without +1) and removed some changes from this PR, where I can't find out what the content of variable may be. Unit tests pass, so I think it's ready for merge.
2011-12-13 17:39:32 +01:00
Tobias Schultze
f44bcafa8f fix error due to merging 2.0 into master 2011-12-13 16:41:40 +01:00
Fabien Potencier
142cef21bb merged 2.0 2011-12-13 16:12:53 +01:00
Fabien Potencier
ec7eec5f35 [DependencyInjection] fixed espacing issue (close #2819) 2011-12-13 15:38:10 +01:00
Fabien Potencier
28d93f0803 [WebProfilerBundle] made the profile URL clickable only when the method is GET or HEAD 2011-12-13 14:20:27 +01:00
Fabien Potencier
09678b78da [WebProfilerBundle] added the method information in the profiler 2011-12-13 14:19:34 +01:00
Fabien Potencier
bf45b22447 merged branch stloyd/profiler_by_method (PR #2824)
Commits
-------

5f22268 [Profiler] Sync with master
1aef4e8 Adds collecting info about request method and allowing searching by it

Discussion
----------

[WebProfiler] Add ability to filter data by request method

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

For discussion & description checkout: #1515 & #2279

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

by fabpot at 2011/12/11 10:02:41 -0800

After merging this PR, the toolbar is not displayed anymore for me.

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

by stof at 2011/12/12 14:18:20 -0800

@fabpot the toolbar works for me using this branch
2011-12-13 14:13:16 +01:00
Fabien Potencier
f06105ce01 merged branch Tobion/patch-1 (PR #2856)
Commits
-------

6548354 fixed data-url

Discussion
----------

[WebProfilerBundle] fixed and adjusted HTML5 markup

I corrected some markup errors that I found when validating the pages of the WebProfilerBundle.
Along the way I also improved the semantic structure of HTML5 like table header and body, lang attribute.
Removed type="text/css" that is the default with rel="stylesheet". Also no need for media="screen"!? Otherwise style does not apply when debugging with handheld device or when printing.

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

by fabpot at 2011/12/12 23:37:15 -0800

@Tobion: Can you squash your commit before I merge your PR? Thanks.

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

by Tobion at 2011/12/13 03:14:51 -0800

@fabpot I would appreciate if you could do this.

I see two problems with pull requests on @github that occur again and again. It's pretty annoying compared to the otherwise very user-friendly Github.

1. Squashing commits of a pull request: If you've already pushed commits to GitHub, and then squash them locally, you will not be able to push that same branch to GitHub again. So you need to create a new branch and a new pull request.
So there should be a button on Github that simply squashes all commits and allows you to enter a new commit message.

2. Opening a pull request based on the master branch instead of the 2.0 branch where bug fixes should be made. So people must rebase their stuff and open a new pull request again. All this back and forth is taking time unnecessarily (both for admins and contributors) and cluttering Githubs news feed.
There should be the possibility to allow switching the pull request base branch. Or at least give the users a configurable hint about the best practice of contributing to a specific repo when they open a pull request.

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

by henrikbjorn at 2011/12/13 03:16:10 -0800

@Tobion

1. Solved by doing a git push -f remote_name branch_name
2. Yes here you need to open a new PR

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

by fabpot at 2011/12/13 03:21:47 -0800

@Tobion: I'm more than aware of these issues but unfortunately, there is nothing I can do if we want to continue using the Github PRs (and automatic closing).

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

by Tobion at 2011/12/13 03:51:47 -0800

That's why I hope that @github will provide a convenient solution to these issues.

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

by stof at 2011/12/13 04:08:07 -0800

@Tobion send a feature request to github. Commenting here will not make them implement it

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

by Tobion at 2011/12/13 04:18:31 -0800

@fabpot I squashed commits.
@stof I will do it. But there is no public issue tracker for the Github software, is there? So need to use the contact form I suppose.
2011-12-13 14:05:30 +01:00
Tobias Schultze
6548354a11 fixed data-url
fixed markup: <pre> not valid inside <p>

adjusted base html structure for HTML5

improved table markup in bag.html.twig

improved table markup in results.html.twig

update exception.html.twig
2011-12-13 13:09:29 +01:00
Bart van den Burg
d97d7e93c0 Added a check to see if the type is a string if it's not a FormTypeInterface 2011-12-13 12:27:51 +01:00
Kevin Bond
73ac77336b [Config] added ability to set info message and example to node definition 2011-12-13 06:04:53 -05:00
Fabien Potencier
e3421a0b1d [DoctrineBridge] fixed some CS 2011-12-13 10:22:12 +01:00
Gustavo Piltcher
81d73bb968 Oracle issues
minor changes on code
2011-12-13 00:38:22 -02:00
Jonathan Ingram
7827f72cf4 Fixes #2817: ensure that the base loader is correctly initialised 2011-12-13 08:44:35 +11:00
jpauli
7fadd089a1 static::$privateField is an OOP non-sense (extending the class is not possible) 2011-12-12 17:52:53 +01:00
alexandresalome
73b744b851 [WebProfilerBundle] Remove a useless statement 2011-12-12 16:44:23 +01:00
Christophe Coevoet
9c1fbb884f [DoctrineBridge] fixed the refreshing of the user for invalid users 2011-12-12 13:36:19 +01:00
Andrej Hudec
cd24fb86a8 change explode's limit parameter based on known variable content 2011-12-11 21:58:35 +01:00
Andrej Hudec
b3cc270450 minor optimalisations for explode 2011-12-11 21:58:30 +01:00
lsmith77
72b9083ca1 SerializerAwareNormalizer now only implements SerializerAwareInterface 2011-12-11 21:18:03 +01:00
lsmith77
97389fa349 use Serializer specific RuntimeException 2011-12-11 21:01:02 +01:00
lsmith77
967531faa5 fixed various typos from the refactoring 2011-12-11 20:53:57 +01:00
Lukas Kahwe Smith
351eaa8506 require a (de)normalizer inside the (de)normalizable interfaces instead of a serializer 2011-12-11 20:03:01 +01:00
Lukas Kahwe Smith
c3d61232c9 re-added supports(de)normalization() 2011-12-11 20:03:01 +01:00
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